> Alternatively, you can apply semantic predicate to lexer rules like this:
> ------------------------
>
> C:  { $pos == 0 }?=> 'C' ;
>
> ------------------------
>
> It should only match "C" at the beginning of the line, but I found (in
> my noob experiences) semantic predicate can be pretty tricky due to
> "hoisting out" business and how it affects prediction DFA construction -
> I'm sure more experienced hands can tell you better.

Thanks.  But I'm actually pretty against intermixing lexical,
grammatical, and semantic rules.  At that point (at least in my
particular project) I've given up most of the clarity that I was
hoping to gain by using ANTLR as opposed to a hand-written recursive
descent parser.

I think at this point I'm just going to hand-write the parser for my
DSL.  Thanks very much for the help.

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.

Reply via email to