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
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
esting part
> | primitiveType ('[' ']')* '.' 'class'
> | 'void' '.' 'class'
> ;
>
> identifierSuffix
> : ('[' ']')+ '.' 'class'
> | ('[
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
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
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
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)
> 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
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
> My question is below:
> I have a grammar:
>
> expr:
> (operand) (OPER operand)*
> ;
> operand :
> ID|INT
> ;
> OPER:
> ('+'|'-'|'*'|'/')
> ;
> INT :
> ('0'..'9')+
> ;
> ID :
> ('a'..'z'|'A'..'Z'|'_')('
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')+
Петров Александр schrieb:
> Hello,
> why such grammar doesn't work properly:
> --
> expr :
> operand ((oper) operand)*
> ;
> //Correct operands
> operand :
> INT
> ;
> OPER:
> Hello,
Greetings!
> why such grammar doesn't work properly:
> ---
>--- expr:
> operand ((oper) operand)*
^^
I assume you mean the lexer rule OPER here?
> ;
> //Cor
Hello,
why such grammar doesn't work properly:
--
expr:
operand ((oper) operand)*
;
//Correct operands
operand :
INT
;
OPER: ('+'|'-'|'*'|'/')
;
INT :
14 matches
Mail list logo