dal-ast-js
v0.0.11-dev
Published
This tool currently takes a design defined in a Design Abstraction Language (DAL) and produces an Abstract Syntax Tree (AST).
Readme
DAL Abstract Syntax Tree Library
This tool currently takes a design defined in a Design Abstraction Language (DAL) and produces an Abstract Syntax Tree (AST).
To achieve this it implements the following tools:
- Lexer
- Parser
This tool will be extended to also do the following:
- Syntactic Validation:
- Provide metadata about the result of the lexing and parsing to identify syntax errors. This will be used by the workbench to visually provide feedback in realtime.
- Semantic Validation:
- Validate the design by ensuring that it is internally consistent in realtime.
This initial commit contains a working workflow but it is clearly not complete. I wanted to commit a working example to the repo to establish the workflow with the engine/workbench before I move forward.
Some relevant files:
Test
While it does have test cases to verify functionality, currently this is more functional than complete.
Install libraries:
npm i To run all test cases:
npm run testTo run specific test case:
npm run test tests/Lexer.test.jsRun the lexer.test.js while providing it with a design file with a .dal extension. This will produce an AST output. Currently, I am reading the designs from the designs folder and writing the ast's to the output folder.
This will be streamlined by integrating everything into the workbench. It will automatically produce the AST and synthesize the program by invoking the python synthesizer.
Providing feedback
You can use GitHub issues to report a bug or request a feature.
