vyaakaran icon indicating copy to clipboard operation
vyaakaran copied to clipboard

Vyaakaran CLI

Open blenderskool opened this issue 8 months ago • 5 comments

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 and strings command from the console that would work for all the above grammar types.

For someone interested to work on this:

  • Go through the compiler and editor code to familiarize yourself with various functions exposed by compiler to process grammars.
  • Create a new cli directory at the root of the project and add it to the pnpm-workspace.yaml file.
  • Initialise a new Node.js project with TypeScript. You can add @vyaakaran/compiler as a dependency in the cli project to use all the functions exposed by the compiler.
  • 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.

blenderskool avatar Jun 22 '24 08:06 blenderskool