我需要这样说:
"qqq www eee" -> "qqq", "www", "eee" (case A)
"qqq www eee" -> "qqq", "www", "eee" (case B)
这里的图表一目前有:
grammar Query;
SHORT_NAME : ( a .. z )+ ;
name returns [String s]: SHORT_NAME { $s = $SHORT_NAME.text; };
names
returns [List<String> v]
@init { $v = new ArrayList<String>(); }
: name1 = name { $v.add($name1.s); }
( name2 = name { $v.add($name2.s); })*;
它对<条码>A的工作进行罚款,但因<条码>而失效。
line 1:4 missing SHORT_NAME at
line 1:5 extraneous input expecting SHORT_NAME
line 1:10 extraneous input expecting SHORT_NAME
如何使其发挥作用的想法?