DashAB Setup Instructions

[Next ][Prev ][Up ]

2.5 Configuring first project

  1. Click Create new project
  2. Select Java Project and then next to Project SDK select New -> JDK
  3. The location should be
    C:\Programs Files\Java\jdk<Version>\
  4. Click Next then click Next again.
  5. Name your project and click Finish again
  6. Open Project manager (Default hotkey Alt-1)
  7. In the project menu that you just opened right-click on the src folder -> New -> File
  8. name the file
    hello.g4
  9. In the new file put the following content
    grammar hello; 
     
    rule: 'hello' id; 
    id  : STRING; 
     
    STRING: CHAR+; 
    CHAR: [a-z|A-Z]; 
    WS: ' '+ -> skip;
  10. right click on rule -> select Test Rule rule
  11. There are three new boxes that open:
    1. a small that appears to be to input a file name
    2. a larger one underneath
    3. To the right of that there is a box on top of which is "Parse tree | Profiler"

    in the second box type

    hello <your name>

    in the third box a tree should appear a parse tree

  12. Congratulations you’ve made your first Antlr4 parser