Configure | Create parsing analysis files for grammar. - AJ-comp/Compiler GitHub Wiki

Create files for analysis

This chapter explains how to create the files for analysis. The kind of files for analysis consist of as below.

  1. Canonical table (shows canonical relation)
  2. Ambiguity check (shows where shift-reduce or reduce-reduce conflict is fired.)
  3. Grammar expression (shows grammar as EBNF format)
  4. First-follow value (shows first-follow value for symbol in grammar)
  5. Parsing table (shows how parsing to process for specified symbol)

To create files for analysis you have to use ajutil program. if you execute a ajutil console program directly you have to do as below.

I assume you already read the manual for Compiler basic configure before read this.

  1. Build CommandPrompt.Util project.
  2. Follow the sequence of this page. (I assume your solution path is "C:/ajtest".)
  3. Add the path of ajutil to the environment variable. ajutil program is created after build CommandPrompt.Util project.
  4. Check whether ajutil is executed as below.

image

  1. If ajutil is executed then execute the command "ajutil print C:\ajtest\bin\Analysis" as below.

image

  1. The result the parsing analysis files is created to path "C:\ajtest\bin\Analysis" as below.

image


If you want to configure in VS Code unlock comment in tasks.json as below.

image

Ok, and if you build then it will be created the parsing analysis files as below.

image

Thank you for reading if you have a problem please contact me.