|Re: How to solve QualifiedName ambiguity [message #1152799 is a reply to message #1151332]
||Thu, 24 October 2013 07:17
| Filipp Andjelo
Registered: October 2013
I don't understand what you mean. I have reference paths, which contain Type and Member as its parts. The real grammar I have is following:
type = [Type | QualifiedName] tail = ReferenceTail
'.' member = [Member | ID] tail = ReferenceTail?
This way I can implement a IScopeProvider for available Members, since I have to detect a Type of one member to calculate scope for the next one. The problem here is, that I'm using QualifiedName for Type reference, that way ANTLR can't decide where the QualifiedName is finished and where my the ReferenceTail rule starts, since this one has the same signature as QualifiedName. If I use ID (instead of QualifiedName) for Type reference, I can't reference my Types by using namespaces.
I want two following examples working:
com.example.MyTypeA.memberA.memberB - This one needs QualifiedName for Type reference, but is ambigous grammar
MyTypeA.memberA.memberB - Works fine with ID for Type reference, but ignores namespaces. What if I have MyTypeA in multiple namespaces and I want to mix them?
Powered by FUDForum
. Page generated in 0.02082 seconds