Open
Description
A CLI tool over the existing Vyaakaran compiler which exposes similar functionality to the Vyaakaran editor.
The CLI tool would take source grammar file as input and generate an output based on the type of grammar:
- Regular Grammar: Regular Expression, ε-NFA and NFA graphs.
- Context Free Grammar: LL(1), LR(0), SLR(1), LR(1), LALR(1) parse tables, parsing automaton, first & follow sets.
- Turing Machine: State Transition Diagram.
- Console:
test
andstrings
command from the console that would work for all the above grammar types.
For someone interested to work on this:
- Go through the
compiler
andeditor
code to familiarize yourself with various functions exposed bycompiler
to process grammars. - Create a new
cli
directory at the root of the project and add it to thepnpm-workspace.yaml
file. - Initialise a new Node.js project with TypeScript. You can add
@vyaakaran/compiler
as a dependency in thecli
project to use all the functions exposed by thecompiler
. - You are free to develop the compiler however you want with whatever libraries you want. Take inspiration from other popular CLI tools as a reference.
- Usability and the structure of the commands exposed by the CLI is important.
- CLI should be extensible in the future for different grammars, different outputs and any new options.
- Help descriptions for every command in the CLI must be added.
- Well formatted outputs with appropriate colors for error messages would be appreciated.
Activity