I derived my grammar from Terry's C grammar. I have added a lot of
semantic actions and kept the typedef symbol definition. I have run into a
problem and need help. Consider the following:
typedef int uint32_t;
typedef uint32_t result_t;
I can have any number of these typedefs, but this case is sufficient to
illustrate the problem I am encountering. The grammar looks ahead beyond
the first semicolon before committing the 'uint32_t' in the scope table.
Needless to say, the second line always fails. I watched step-by-step,
placing System.err.print()'s along the way to find out when the
'$Symbols::types.add(name);' is called. The test (boolean
isTypeName(String name)) always occurs *before* 'uint32_t' is stored. I
added a { addName(name) }? test (which always returns true) to see if I
could force an execution of the semantic action without success.
How do I get the symbol committed?
How do I keep ANTLR from looking so far ahead?
Any help is appreciated. This is a major roadblock.
-Sean Walton
PhD Student, SoC, U of U
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.