enter image description here enter image description here我已经在antlr工作中定义了intlr3中的两个规则; 但效果不理想;
从原子规则中删除fun_call起作用; 当添加它时,原子不匹配“ id”字段
atom : ( fun_call | id | literal | LPAR arith_expr RPAR );
fun_call : id LPAR ( fun_actual_args )? RPAR ;
id : ID ;
我想输入'close'获得匹配原子-> id; 然后输入'get('hello')'macth atom-> fun-call