Hi William,
> I still don't get it. If what you're saying is true, then why doesn't
> the 'pragma' itself get treated as an IDENTIFIER?
If I understand correct, using 'pragma' in a parser rule (lower case)
creates a lexical rule like
PRAGMA : 'pragma' ;
It would be nice if there was a way in lexical ruse to say we want an
IDENTIFIER with a specific value, i.c. 'pragma'...
And maybe pragmas have a generic structure that can be defined and
parsed, without the guidance of specific keywords.
I also wonder how the grammars acts when 'pragma' is not between
whitespaces, like pragmazz or zzpragma... I'll have to test this.
and FYI: debugging with antlrworks is running. I turns out that the
interpreter does not support our grammar, so you need the debugger.
Make sure the options are:
options {
language=Java;
// language=C;
// ASTLabelType=pANTLR3_BASE_TREE; // C code
output=AST;
backtrack = true;
}
and configure your local firewall to allow traffic (allow button at
the popup worked for me). Antlrworks has a few quirks: once launching
the debugger has failed, you have to restart the application. And make
sure you check if compile is succesfull every time you launch the
debugger, because when it isn't (e.g. because you did not set the
options right), it runs the debugger on the last succesfull build and
not on the code it shows you!
But even when you take these quirks into account, you still have a
very powerfull and useful tool at hand which changes the 'pinhole
view' to a full overview.
> It may be worthwhile to have some small JAL 'regression' tests that I
> can look at, not just Antlr grammar syntax. Show me some actual JAL
> code that breaks. I'll run it here for myself, and then probably I
> will 'get it through my thick skull'. :-)
I gave some exampels in the other post. And indeed, it is not so easy
to comprehend what's going on, especially in cases where multiple
rules could apply. The debugger showed me that within one parser rule,
different options are processed from top to bottom, so order does
matter at this level. But does it at other levels (between rules, lex,
parser)? Well, it's fun, gives a steep learning curve and quite a long
way to go :)
Joep
>
> Thanks,
>
> William
> ps: sleep may help. I'll try that and check back when I wake up. :-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" 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/jallib?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"jallib" 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/jallib?hl=en.