This is because QualifiedName
consumes dots (.
). Adding ('.' ...)?
makes two alternatives. Consider input
a.b.c
This could be parsed as
head="a"
tail = "b.c"
head="a.b"
tail = "c"
If I understand your intention of using predicate =>
right, than you just have to replace
head=[Greet|QualifiedName]
with
head=[Greet]
In this case however you will not be able to parse references with dots.
As a solution I would recommend to substitute your dot with some other character. For example with colon:
Usage:
'use' head=[Greet|QualifiedName] (':' tail=[Operation])?