5812bd8429
As of this commit, to change the configuration using Banana, we need to make an HTTP POST request to `/banana` REST API. This API is temporary and is likely to be changed later. The implementation is done entirely in the `banana` module. Under this module there are: * `typeck` module contains the type checker, * `grammar` module contains the parser and the AST and, * `eval` module contains the interpreter. Additionally, a test framework has been created to ease the test of particular conditions of the language. Within the banana module, there is a README.md file for each associated sub-module explaining further the details of the language. Once this commit is merged, there's still a lot that can be improved: - All components should be tested in Banana. - The 'deadpathck' pass could be improved (see TODO) - We don't support generated JSON ingestors yet. - Imports will be key for reusability (not implemented). Change-Id: I1305bdfa0606f30619b31404afbe0acf111c029f |
||
---|---|---|
.. | ||
__init__.py | ||
config.py | ||
ctx.py | ||
old_style.py | ||
README.md |
Interpreter / Evaluator
This folder contains everything related to the evaluation of banana files.
This pass makes some assumptions: it is valid to create all the components and connecting them won't throw any errors.
Some components might need to be created in order to check if they are valid. For instance, when a DNS lookup is involved. In such cases, an error will be thrown during the interpretation. However, the general intention is to move the checks out of the evaluation as much as possible. We want to avoid at all cost an half-working pipeline as it could have side-effects on external data sources by corrupting them or feeding them with incorrect data.
The execution environment (e.g Spark) might also reject the
pipeline during an evaluation for some reason. However, this is
less likely to happen as the deadpathck
pass removes
components and paths that would lead to errors.
This is the last step of the pipeline:
+---------------------+
| |
---> | AST & TypeTable | ---- interpret ---> Done
| |
+---------------------+
Current status
- Evaluate expressions
- Create components
- Connect components
- Restart the pipeline
Tests
All tests are located in test/banana/eval
. We only try
to evaluate valid files, so for this pass there's only a
should_pass
directory.
Available instruction
# LHS_EQ <string-version-of-the-value>
: This instruction compares the evaluation of the left hand side of the previous expression with the provided string. If they are not equal, the test will fail.