[il-antlr-interest: 20600] Re: [antlr-interest] Write comments to templates

2008-11-22 Thread Jared Bunting
Not sure if it will meet your needs or not, but you might want to look at the rewrite functionality. It should allow you to use your source file as a starting point, and replace code in it with your template output. By ignoring comments in your parser, I would think the rewrite would simply leave

[il-antlr-interest: 20599] Re: [antlr-interest] how can i return a string including a regular express?

2008-11-22 Thread Jim Idle
On Sat, 2008-11-22 at 20:31 -0600, Su Zhang wrote: > HI everyone, > > the problem is, I want to return a string which includes a regular > express, like i1=id1'(' i2=id1 ( ',' i3=id1)* ')', on the left of > equals are label variables which are not included in the return > string, and I use the m

[il-antlr-interest: 20598] [antlr-interest] how can i return a string including a regular express?

2008-11-22 Thread Su Zhang
esting part > | primitiveType ('[' ']')* '.' 'class' > | 'void' '.' 'class' > ; > > identifierSuffix > : ('[' ']')+ '.' 'class' > | ('[

[il-antlr-interest: 20597] Re: [antlr-interest] Why waiting timeout? why cannot find symbol?

2008-11-22 Thread Gavin Lambert
At 13:25 23/11/2008, Su Zhang wrote: >thank you for your reply, yet i still have some problems, why the >return rule timeTuple cannot be regarded as a string? just part of >my grammar below, and with error information > >validity returns [String v] >: ValidityHeader NotBefore tb= time

[il-antlr-interest: 20596] Re: [antlr-interest] Why waiting timeout? why cannot find symbol?

2008-11-22 Thread Gavin Lambert
At 06:36 23/11/2008, Su Zhang wrote: >I meet two very strange problems when debugging my program,the >first one is "timeout waiting connect remote parser", Are you compiling the grammar with -debug so it includes the debug code, and running it before you select Debug Remote? (If your target l

[il-antlr-interest: 20595] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread Gavin Lambert
At 05:26 23/11/2008, Johannes Luber wrote: >but there can be problems as '+' used in to different rules will >create two distinct token types which will cause a >MismatchedTokenTypeException later. Actually normally it won't create separate token types, if you're just using '+' on its own o

[il-antlr-interest: 20594] [antlr-interest] Write comments to templates

2008-11-22 Thread Chris Sekszczynska
Hi all, after a longer search, I don't found a good way to write comments from the source file to template output. My workflow is the following: Lexer (which puts comments into the hidden channel) -> parser (which creates an AST) -> walker (which writes output using StringTemplate)

[il-antlr-interest: 20593] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread Петров Александр
> but there can be problems as '+' used in to different rules will create > two distinct token types which will cause a MismatchedTokenTypeException > later. This is exactly what happens with my grammar. Thank you very much. 2008/11/22 Johannes Luber <[EMAIL PROTECTED]>: > Петров Александр schrie

[il-antlr-interest: 20592] [antlr-interest] Why waiting timeout? why cannot find symbol?

2008-11-22 Thread Su Zhang
Hi all, I meet two very strange problems when debugging my program,the first one is "timeout waiting connect remote parser", the other is cannot find symbol [11:17:54] symbol : variable b64 [11:17:54] location: class assignment6Parser [11:17:54] b64=i.getText(); is anybody have solut

[il-antlr-interest: 20591] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread John B. Brodie
> My question is below: > I have a grammar: > > expr: > (operand) (OPER operand)* > ; > operand : > ID|INT > ; > OPER: > ('+'|'-'|'*'|'/') > ; > INT :    > ('0'..'9')+ > ; > ID  : > ('a'..'z'|'A'..'Z'|'_')('

[il-antlr-interest: 20590] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread Петров Александр
Sorry for many misprints. I experiment with grammar and post intermediate variant. My question is below: I have a grammar: expr: (operand) (OPER operand)* ; operand : ID|INT ; OPER: ('+'|'-'|'*'|'/') ; INT : ('0'..'9')+

[il-antlr-interest: 20589] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread Johannes Luber
Петров Александр schrieb: > Hello, > why such grammar doesn't work properly: > -- > expr : > operand ((oper) operand)* > ; > //Correct operands > operand : > INT > ; > OPER:

[il-antlr-interest: 20588] Re: [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread John B. Brodie
> Hello, Greetings! > why such grammar doesn't work properly: > --- >--- expr: >         operand ((oper) operand)* ^^ I assume you mean the lexer rule OPER here? >         ; > //Cor

[il-antlr-interest: 20587] [antlr-interest] Lexer rule with alternatives (Newbie question)

2008-11-22 Thread Петров Александр
Hello, why such grammar doesn't work properly: -- expr: operand ((oper) operand)* ; //Correct operands operand : INT ; OPER: ('+'|'-'|'*'|'/') ; INT :