LRSTAR: LR(*) parser generator


  Home Downloads Feedback Comparison History Theory Papers Doc. Contact  
  Installation LRSTAR DFA Definitions  


The download is a compressed file, for example:

Unzip this file to a directory (folder), such as:


You will get a directory with the name:


Inside this directory, you should have the following subdirectories:

bin   - executable programs
doc   - documentation (online version may be more up-to-date)
grm   - 20 BNF grammars
license   - license agreement
project   - 7 sample projects

Visual Studio Setup

Step 1. Set the tabs setting to 3.

The source code was created with tabs set to 3. If you don't use tabs=3, the source code will look wierd. Some people like 2 and others like 4. The tab setting should be part of the source code file, probably the last byte in the file. Afterall, word processors contain the formatting settings in the file, why can't source code have the tab setting in the file? Maybe 100 years from now, it will happen, maybe. Go to:

Tools / Options / Text Editor / C/C++ / Tabs
Then set Tab size" to 3 and "Indent size" to 3.

Step 2. Add File Extensions 'grm' and 'code' to Visual Studio.

Go to:

Tools / Options / Text Editor / File Extension
For the "Extension" add "grm"
For the "Editor" select Microsoft Visual C++.

For the "Extension" add "code"
For the "Editor" select Microsoft Visual C++.

Now you will have syntax coloring for all grammar files (.grm files) and (.code files). Why? You will be able to double-click on a parse action (e.g. "store_") in your grammar and you will be taken to the Definition (function) or Declaration for "store". For example, in your grammar you may have the following rule which contains the parse action "store_":

Stmt -> Target '=' Exp ';'   => store_

Step 3. Set Read-Only Files NOT to Allow Editing.

Go to

Tools / Options / Environment / Documents
And unselect the 3rd little box from the top, which says:
[  ] Allow editing of read-only file; warn when attempt to save.

Make sure this is unchecked as shown above. Then you will not waste any time making changes to a file that was generated automatically. All generated files are read-only.

Getting Started

Go to the project Calc folder:

Go to:

LRSTAR / LRSTAR.9.1.001 / project / Calc
Open (double-click) the file name:
workspace.sln or
Do a:
Build / Build Solution
Then do a:
Debug / Start Debugging (f5) (if you have built the Debug version) or
Debug / Start Without Debugging (Ctrl+F5) (if you have built the Release version)
Now look at the "test.output" file to see what happened. Good luck and have fun. In case of errors or problems, please send me an email and let me know what's not working or just ask a question. I love to get emails.

  (c) Copyright Paul B Mann 2018.  All rights reserved.