ANTLR How to differentiate input arguments of the same type
问题 If I have my input message: name IS (Jon, Ted) IS NOT (Peter); I want this AST: name | |-----| IS IS NOT | | | Peter |----| Jon Ted But I'm receiving: name | |-----------------| IS IS NOT | | | | |----|-----| |----|-----| Jon Ted Peter Jon Ted Peter My Grammar file has: ... expression | NAME 'IS' OParen Identifier (Comma Identifier)* CParen 'IS NOT' OParen Identifier (Comma Identifier)* CParen -> ^(NAME ^('IS' ^(Identifier)*) ^('IS NOT' ^(Identifier)*)) ; ... NAME : 'name' ; Identifier : ('a'