项目作者: michaelssavage

项目描述 :
Antlr4 is used for lexical, syntax, and semantic analysis of structured text.
高级语言: ANTLR
项目地址: git://github.com/michaelssavage/Antlr4_Grammars.git
创建时间: 2020-11-06T18:17:03Z
项目社区:https://github.com/michaelssavage/Antlr4_Grammars

开源协议:

下载


Antlr4_Grammars

Antlr4 is used for lexical, syntax, and semantic analysis of structured text.

From the website:

  1. Download https://www.antlr.org/download/antlr-4.8-complete.jar.
  2. Add antlr4-complete.jar to CLASSPATH, either:
  3. Permanently: Using System Properties dialog > Environment variables > Create or append to CLASSPATH variable
  4. Temporarily, at command line:
  5. SET CLASSPATH=.;C:\Javalib\antlr4-complete.jar;%CLASSPATH%
  6. Create batch commands for ANTLR Tool, TestRig in dir in PATH
  7. antlr4.bat: java org.antlr.v4.Tool %*
  8. grun.bat: java org.antlr.v4.gui.TestRig %*

For myself I had to make sure the classpath in environment variables pointed to the antlr4-complete.jar. If you have Java like me installed append it as such:

  1. .;
  2. antlr4-complete.jar;

If using VSCode, the referenced libraries need to be set to the antlr jar also.

Folders and their difficulty

  1. hello.g4 is an introductory program to show the tokens.
  2. slp.g4 is good for viewing the gui.
  3. draw.g4 uses a java file and reads from a file.
  4. cal.g4 overwrites the ErrorListener.java file.
  5. bp.g4 extends the BaseVisitor.java file and gives results back.