[il-antlr-interest: 19907] [antlr-interest] tokens - when to use?

2008-10-09 Thread Juergen Weber
[Fixed the subject] > > From: Martin Probst > Subject: Re: [antlr-interest] tokens - when to use? > > The easiest way to work around this is to allow all tokens that are > valid explicitly also as identifiers: > > id: ID | QUOTEDSTRING | NONE | REMOVE | ...; > > ... which is a bit inconvenient a

[il-antlr-interest: 19906] [antlr-interest] opaque non-LL(*) decision error

2008-10-09 Thread Chris Rebert
I'm getting a non-LL(*) decision error when trying to generate code for my grammar, which is at http://rebertia.com/Iguana.g (it's a bit long, otherwise I'd post it). I've tried looking at the flowcharts in ANTLRWorks to figure out what the problem is, but I can't make heads or tails of what the c

[il-antlr-interest: 19905] FREE Home Based Online Job Offer for Indians 4

2008-10-09 Thread [EMAIL PROTECTED]
FREE Home Based Online Job Offer for Indians Dear Friend, Do you want to earn extra income in your spare time working from home? To Join Click the link below 1. http://bestways-makemoneyonline.50webs.com/   <<>>   2. http://bestways-makemoneyonline.50webs.com/earn

[il-antlr-interest: 19904] Re: [antlr-interest] Java *_return Access Level

2008-10-09 Thread Terence Parr
On Oct 9, 2008, at 5:43 PM, Randall R Schulz wrote: > So a couple of options suggest themselves right off: > > 1) (Crude) A single option that specifies the protection level of the > generated parser code's returns classes (or structs or whatever > they're > called in other target languages). >

[il-antlr-interest: 19903] Re: [antlr-interest] Java *_return Access Level

2008-10-09 Thread Randall R Schulz
On Thursday 09 October 2008 17:32, Terence Parr wrote: > On Oct 9, 2008, at 5:29 PM, Randall R Schulz wrote: > > Hi, > > > > Is there any reason the many *_return classes generated when a > > grammar uses the "returns [ ... ]" construct (under Java) cannot be > > declared "private" (or, at least,

[il-antlr-interest: 19901] [antlr-interest] Java *_return Access Level

2008-10-09 Thread Randall R Schulz
Hi, Is there any reason the many *_return classes generated when a grammar uses the "returns [ ... ]" construct (under Java) cannot be declared "private" (or, at least, "protected")? This would have the salutary effect of excluding them from the external JavaDoc HTML typically generated from

[il-antlr-interest: 19902] Re: [antlr-interest] Java *_return Access Level

2008-10-09 Thread Terence Parr
Hi. I had not thought of that. yes that is a problem, but you need to access the return structures to pull results from the start symbol like the tree. Ter On Oct 9, 2008, at 5:29 PM, Randall R Schulz wrote: > Hi, > > Is there any reason the many *_return classes generated when a grammar > us

[il-antlr-interest: 19900] Re: [antlr-interest] Composite tree grammar

2008-10-09 Thread Bill Andersen
Gavin, Yeah, I goofed the line numbers up. Here are the files again. My question is whether the syntax is correct. I can't see anything wrong. Thanks for any help. grammar Foo; options { output=AST; } tokens { FOO = 'foo'; BAR = 'bar'; ZAP; } start

[il-antlr-interest: 19899] Re: [antlr-interest] antlr-interest Digest, Vol 47, Issue 9

2008-10-09 Thread Juergen Weber
> > From: Martin Probst <[EMAIL PROTECTED]> > Subject: Re: [antlr-interest] tokens - when to use? > > The easiest way to work around this is to allow all tokens that are > valid explicitly also as identifiers: > > id: ID | QUOTEDSTRING | NONE | REMOVE | ...; > > ... which is a bit inconvenient as

[il-antlr-interest: 19898] Streaming Adult Movies

2008-10-09 Thread [EMAIL PROTECTED]
On-line Tube video TV group. Go and Look free tube http://groups.google.com.ua/group/adult-stream-video/web/xxx_stream.html http://groups.google.com.ua/group/adult-stream-video --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[il-antlr-interest: 19897] Re: [antlr-interest] tokens - when to use?

2008-10-09 Thread Martin Probst
> Seems that the NONE is in a list of known tokens and cannot be entered > for ID, isn't it? > > It surprises me, that using a TOKEN breaks a rule. It works after > changing to This is due to the way Lexer and Parser separation works - the lexer produces tokens, which the parser consumes and

[il-antlr-interest: 19896] [antlr-interest] tokens - when to use?

2008-10-09 Thread Juergen Weber
Hi, for the grammar below, when it parses the input REMOVE NONE there is a MismatchedSetException When I change the NONE in r1 to NON the phrase is parsed. Seems that the NONE is in a list of known tokens and cannot be entered for ID, isn't it? It surprises me, that using a TOKEN breaks a ru

[il-antlr-interest: 19895] Re: [antlr-interest] template parameter passing

2008-10-09 Thread Torsten Curdt
I obviously enjoy talking to myself ;) }; separator="\n"> it is :) cheers -- Torsten On Oct 9, 2008, at 15:26, Torsten Curdt wrote: > Why does this fail > > }; separator="\n"> >>> > > reading(number,slots) ::= << >>> > > while this works fine? > > }; separator="\n"> >>> > >

[il-antlr-interest: 19894] Re: [antlr-interest] How to reuse lexer object and parser object

2008-10-09 Thread Randall R Schulz
On Thursday 09 October 2008 00:30, Ronghui Yu wrote: > On Thu, Oct 9, 2008 at 3:12 PM, Gavin Lambert <[EMAIL PROTECTED]> wrote: > > At 19:59 9/10/2008, Ronghui Yu wrote: > >> As I mentioned before, I use the same lexer and parser object for > >> parsing different SQL statements. > > > > Is there

[il-antlr-interest: 19893] [antlr-interest] template parameter passing

2008-10-09 Thread Torsten Curdt
Why does this fail }; separator="\n"> >> reading(number,slots) ::= << >> while this works fine? }; separator="\n"> >> reading(slots) ::= << >> The underlying object is of type Map> Any idea? cheers -- Torsten List: http://www.antlr.org:8080/mailman/listinf

[il-antlr-interest: 19892] Re: [antlr-interest] indirect template references

2008-10-09 Thread Torsten Curdt
Seem it needs to be or <(typeMap.(a.type))(a)> But how do I add a prefix? cheers -- Torsten On Oct 9, 2008, at 14:16, Torsten Curdt wrote: > What wrong with the following indirect reference? > > )> > }> > > typeMap ::= [ > "int":"INTEGER", > "string":"ST

[il-antlr-interest: 19891] [antlr-interest] indirect template references

2008-10-09 Thread Torsten Curdt
What wrong with the following indirect reference? )> }> typeMap ::= [ "int":"INTEGER", "string":"STRING", default:"OBJECT" ] writeSTRING(a) ::= << // STRING >> writeINTEGER(a) ::= << // INT >> writeOBJECT(a) ::= << // OBJECT >> cheers -- Torsten List:

[il-antlr-interest: 19890] Re: [antlr-interest] iterating trees and maps

2008-10-09 Thread Torsten Curdt
Found the map iteration explained here http://www.antlr.org/wiki/display/ST/Expressions For iteration of lists/trees - recursively call the templates? cheers -- Torsten List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr

[il-antlr-interest: 19889] [antlr-interest] iterating trees and maps

2008-10-09 Thread Torsten Curdt
Hey there, Hope this is the right mailing list for stringtemplate questions. (Wasn't obvious from the site) I have some trouble figuring out how to output tree like structures and maps with stringtemplate. Could not find an example for it. Let's say I have Map map = new HashMap

[il-antlr-interest: 19886] [antlr-interest] How to reuse lexer object and parser object

2008-10-09 Thread Ronghui Yu
Hi, Jim, Sorry to bother you again. As I mentioned before, I use the same lexer and parser object for parsing different SQL statements. When using ANTLR3.0.1, everything works fine, but when upgrade to ANTLR3.1, I found that it is necessary to save the ctx->pParser->rec->state->tokenNames before c

[il-antlr-interest: 19888] Re: [antlr-interest] How to reuse lexer object and parser object

2008-10-09 Thread Ronghui Yu
Yes, this is the easiest way to make it work. It is not I who designed the architecture. But I think the reason may be the performance, the parser object contains over 1000 fields needed to be set, it may be much faster to reuse it by resetting some fields of it. On Thu, Oct 9, 2008 at 3:12 PM, Ga

[il-antlr-interest: 19887] Re: [antlr-interest] How to reuse lexer object and parser object

2008-10-09 Thread Gavin Lambert
At 19:59 9/10/2008, Ronghui Yu wrote: >As I mentioned before, I use the same lexer and parser object for >parsing different SQL statements. Is there some particular reason why you don't want to construct a new instance? List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscri