我想说的是:
rule: (rule2 | rule3) {;}; //How can i get at this point rule2 or rule3 text?
rule2: HELLO+;
rule3: WORLD*;
我想获取rule2或rule3文本,但我得到的只是type_return
,只能给我start
和stop
。
有什么想法吗?
答案 0 :(得分:1)
尝试:
rule
: r=(rule2 | rule3) {String txt = $r.text;}
;