/** Simple statically-typed programming language with functions and variables
* taken from "Language Implementation Patterns" book.
*/
grammar Cymbol;
file:(functionDecl | varDecl)+;
varDecl
: type ID ('=' expr)?';&
1.概述参考:Antlr权威指南 8.3 章g4文件如下/** Simple statically-typed programming language with functions and variables * taken from "Language Implementation Patterns" book. */grammar Cymbol;file: (functionDecl | varDecl)+ ;varDecl : type ID ('=' exp.