This site is a demo for tscc-compiler, an LALR(1) parser generator written in typescript. The project is hosted on github, documentation can be found at wiki for tscc-compiler. It has been published on npm, you can install tscc-compiler using the command
You can input any grammar file you like, or select a demo file by clicking . After you've done that, press to compile. The compilation includes generating tables and the parser's source code, and "compile" the code using function constructor of Javascript, with two arguments: console and input. The former is an object with the method log, which prints a specified string into the "Output" tab of the footer panel; The latter is a string whose value is the value of the text area in the "Input" tab. You can access these two variables in the inline code blocks or epilogue in the grammar file.
Errors and warnings will be printed in the "Messages" tab of the footer panel if they occur. When input is accepted, you can either run the generated code by clicking , or print parse table and DFA tables by pressing and select what you want to print. Tables will be printed in the "Output" tab.
This site is hosted on Github Pages, together with the following libraries:
The same as tscc-compiler, this site is licensed under MIT.