[antlr-interest] Implicit imports
Gustaf Johansson
gustaf.j at gmail.com
Wed Jan 20 01:49:14 PST 2010
Hi,
I have a grammar in which there can be implicit imports of a few
definitions example:
module A {
enum myEnumA { A1, A2, A3 }
}
module B {
import module A;
function myFuncB (int, myEnumA) {
...
}
}
module Prog {
import B;
myFuncB (1, A2); *
}
*Here A2 is implicitly known to be of type myEnumA, since the
definition of myFuncB is in B and B imports A.
The problem i have is that my parser reports A2 as unknown.
I have not come up with a good and simple solution to this.
I have been thinking along the lines of:
Check definition of myFuncB and if it takes a enum as argument, check
the local module's imports for the definition of that enum.
Any help is really appreciated.
Best Regards Gustaf
More information about the antlr-interest
mailing list