[il-antlr-interest: 29231] [antlr-interest] Help needed with baby LaTeX parser

2010-06-22 Thread Pavel Grinfeld
Hi, I'm doing pretty well recognizing LaTeX commands, but now I'm at the stage where I want to capture the "text". I'm having trouble defining "everything else". Basically, I currently define LaTeX as commands (as I define them), possibly separated by WS, and everything that's not a command is

[il-antlr-interest: 29230] Re: [antlr-interest] Multiple alternatives warning

2010-06-22 Thread Pavel Grinfeld
I'm sorry, you did tell me how to fix it! On 6/22/2010 11:59 AM, John B. Brodie wrote: > Greetings! > > On Tue, 2010-06-22 at 11:08 -0400, Pavel Grinfeld wrote: > >> Hi, >> >> I'm begging to get my bearings on this But the following gives two >> "multiple alternatives" warnings. >> >> How

[il-antlr-interest: 29229] Re: [antlr-interest] determining tokens at runtime

2010-06-22 Thread Jon
> The lexer rule should be... > ED: .; > Dot will match any one character. Then it works as expected. Thanks for your insight...I'm off and running again! It seems so obvious now that you showed me ;) Back to the TDAR book and thinking how the wide-open-lexer-rule-plus-predicate validation ca

[il-antlr-interest: 29228] Re: [antlr-interest] Multiple alternatives warning

2010-06-22 Thread John B. Brodie
Greetings! On Tue, 2010-06-22 at 11:08 -0400, Pavel Grinfeld wrote: > Hi, > > I'm begging to get my bearings on this But the following gives two > "multiple alternatives" warnings. > > How come? > > Many thanks in advance, > > Pavel > > grammar PGTeX; > > doc > : > (a=text{System.o

[il-antlr-interest: 29227] [antlr-interest] Multiple alternatives warning

2010-06-22 Thread Pavel Grinfeld
Hi, I'm begging to get my bearings on this But the following gives two "multiple alternatives" warnings. How come? Many thanks in advance, Pavel grammar PGTeX; doc : (a=text{System.out.print(">"+$a.value+"<");}|b=command{System.out.print($b.value);})+ EOF; command returns [ Strin

[il-antlr-interest: 29226] [antlr-interest] lexer vs. grammer

2010-06-22 Thread Pavel Grinfeld
Hi, Is it always clear cut whether to call something a token or make it part of grammar. For example, suppose we are parsing TeX and a command is something that looks like this: \name{stuff} Should "command" be in the lexer section or grammar section? Sorry for such a vague question, but I a

[il-antlr-interest: 29225] Re: [antlr-interest] Help me get started

2010-06-22 Thread John B. Brodie
Greetings! On Tue, 2010-06-22 at 04:22 -0400, Pavel Grinfeld wrote: > Hi, > > Here's my first attempt at an ANTLR project. For practice, I just want > to read a file with lowercase words and print them. I feed it "hi there > how are you" > All that the program prints is "hi". > > Many thanks i

[il-antlr-interest: 29224] Re: [antlr-interest] [OT]Hello!

2010-06-22 Thread Borneq
2010/6/21 Bart Kiers : > Yes, lots of people. > Regards, > Bart. Recently I don't get any mail 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

[il-antlr-interest: 29223] Re: [antlr-interest] Help me get started

2010-06-22 Thread Borneq
2010/6/22 Pavel Grinfeld : > grammar pg; Grammar pg compiling OK, but in html.g we have class HTMLParser extends Parser; options { exportVocab=HTML; k = 1; } and compiler not works... List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mai

[il-antlr-interest: 29222] [antlr-interest] Help me get started

2010-06-22 Thread Pavel Grinfeld
Hi, Here's my first attempt at an ANTLR project. For practice, I just want to read a file with lowercase words and print them. I feed it "hi there how are you" All that the program prints is "hi". Many thanks in advance, PG grammar pg; doc :a = word {System.out.println($a.value);} ( WS b