John B. Brodie schreef:
> Greetings!
> 
> Hendrik Maryns asked:
> 
>> I showed you my grammar yesterday.  Now trying it out on some simple
>> inputs blows me away right away: it doesn’t even parse anything.

> Your problem seems to be with your Lexer rule for LABEL which is :
> 
> LABEL : ~(')')+ ;
> 
> this means that any sequence of characters that is not a ')' must be a
> LABEL.

I am starting to understand the difference between lexer and parser now.
 I was thinking of it as some sort of regular expression parser, but
since the lexer does not know anything about the parser, it doesn’t care
about it.

> another problem is that ')' is not matched by any Lexer rule. did you
> want OPEN and CLOSE to be parens?

Yes, sorry, a relict of debugging.

>> Grateful for any suggestions,
> 
>>.....remainder of message snipped....
> 
> Hope this helps

It did, in that I know what is wrong, but I still have no solution to my
problem: how can I make the variable in my label rule be anything?  That
is, I would think anything except whitespace and braces and control
characters would be fine.  In particular, it definitely has to accept
any word in any script, along with some punctuation characters such as .
- _ $ and probably more.

H.
-- 
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Attachment: signature.asc
Description: OpenPGP digital signature

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to