Beetl 0.61 发布

10 views
Skip to first unread message

atu

unread,
Sep 4, 2011, 11:30:03 PM9/4/11
to antlr中文论坛
支持定义json变量,支持switch,支持map循环。功能上不再增加,准备进军超高难度的预编译版本


switchStatment
: a='switch' '(' base=exp ')' '{' caseStatment* defaultStatment? '}'
->^(SWITCH[$a] $base caseStatment* defaultStatment? ) ;
caseStatment
: a='case' exp ':' statmentBlock ->^(CASE[$a] exp statmentBlock);
defaultStatment
: a='default' ':' statmentBlock -> ^(DEFAULT[$a] statmentBlock);
json : '[' atom (',' atom)* ']' ->^(JSONARRAY atom*)
| '{' jsonKeyValue (',' jsonKeyValue)* '}' ->^(JSONMAP jsonKeyValue*)
;
jsonKeyValue
: StringLiteral ':' atom ->^(JSONKEYVALUE StringLiteral atom ) ;

Reply all
Reply to author
Forward
0 new messages