The App
OK, Let’s explore the app.
The App is used to generate the parser code from source. The source is written in an external editor. You point the app to the source file and select the Generate button. Let’s go through each section.
Copyright
Just verbiage on the copyright. This is a commercial app and you need to puchase a license for legal use. You will own the license forever and be given access to all future upgrades. The parsers you write in the parser language are yours. To purchase a license to the Algodal™ Parser Generator Tool, goto this website: https://algodal.itch.io/algodal-parser-generator-tool . We definitely appreciate the support ❤️. It goes a long way in helping us to continue support the tool with improvements and new features.
Input
This is the section where you point to the source file as well as provide the name of your parser. The file can have any extension. On the other hand, our official extensions are .algodal-parser or .parser so feel free to use either.
The name you provide the parser must be C naming variables compliant. That is, no spaces, no dashes, must start with a letter, etc.
Here is a screenshot of a sample parser code in vscode:
The only required field in the app is the Input File - everything else is optional.
Output
By default, the generated parser file is saved in a folder called Output relative to the App binary. You can change which folder the generated parser file is saved into using the Output Folder field.
Demo
You have the option, with one button click, to quickly:
generate a parser
compile said parser
run said parser on a given text
view the results
You have to provide the location of the C or C++ compiler into the compiler field and the location of the text to parse in the text field. The output of the Demo will be stored in a folder called DemoOutput relative to the location of the App. The output of the result of parsing will be stored in a file called log.txt in said folder.
Flags
The Flags fields allows you to chose how the the code is generated and set preprocessor flags in the code to control default behaviour.
Separate Files
By default, a single C file is generate which contains the program, (optionally) the machine and (optionally) a main program (for quick demo). If you check this flag, you can store each component in a separate file.
Separate Header
By default, declarations are written into the file along with definitions code. If this flag is checked then declarations code is stored in a header file and other files include said file.
Exclude VM
This excludes the machine code from being generated.
Store Non-Terminal Strings
AST generated do not have string values for non-terminal nodes by default. This flag does the opposite.
Exclude Main
This excludes the main code from being generated. (This refering to demo code which contains a main() function)
No Printing
The main code include a lot of printing for feedback. You can turn them off with this flag.
Print Using Export
Demonstrate the export feature.
Include JSON Converter Code
If you want the machine to run your parser with its program stored as a json, you have to check this flag to include the json converter code.
Generate JSON
Generate the Program as JSON.
Generate
Finally, the generate button. You press this to generate your parser.