On 03/21/2011 12:26 AM, Wojciech Tomasz Cichon wrote:
i have in my grammar rules:
stmt :
| ident '=' lexp SEMI - ^(SET ident lexp);
factor :
'-'? (NUMBER |ident )^
;
and
lexp : term (SIMOP^ lexp)?;
term : factor (OP^ term)?;
OP : '*' | '/' |
Hi all,
for a matter of convenience I didn't write here all the rules for white spaces
and so on, but I've them in order to skip white spaces, tab, \r, \n and so on.
It seems the lexer recognize as textLiteral the parameter names (i.e.:
VARIABLE and MESSAGE_).
Any suggestions?
Thank you all :)
hi,
i have prioblem with one rule from my grammar
factor
...
| ident '('( ident_arg (ident_arg2)*)? ')' - ^(CALL ident ^(PARAMS
(ident_arg ( ident_arg2 )* )?))
after i send line :
c = 2*a+ f(1,4);
i received error:
line 17:11 mismatched input '1' expecting ')'
it looks like it’s completely
Wojciech~
Not sure what the issue is; however, I might suggest that the rule
function_call : ident '(' (ident_arg ( ident_arg2 )* )? ')' SEMI -
^(CALL ident ^(PARAMS (ident_arg ( ident_arg2 )* )?));
is better written
function_call : function_ref '(' (arg (',' arg)*)? ')' SEMI - ^(CALL
Hi there,
I'm new to grammars and ANTLR(Works) and having a problem now. I
understand there is some disambiguity in my grammar, but due to lack of
documentation of the 'Ambiguous Path Visualization' in ANTLRWorks, I
don't understand what it is trying to tell me. Please have a look at
this
Hi Martin,
It's telling you that when when it recursively enters ruleExpression after
ruleUnOp, on encountering [ at the end of the recursive ruleExpression it
cannot decide if ruleSelector is part of the recursive invocation of
ruleExpression or of the invoking ruleExpression. Because of the
Take the 'literals' out of the parser and create real lexer tokens that
are declared before the other, more general tokens.
Using literals in the parser confuses you and will also make error
handling and tree walking more difficult.
Jim
-Original Message-
From:
The nested ^ are fine but without a subrule, the node will not have start
and stop indexes correctly updated. The main problem with this grammar is
that it has no structure and it looks like it is ambiguous. First remove
the 'literals' and make real tokens, then start with one of the simpler
Hello Jim,
don't want to bother you, but did you get my email dated
03/16/2011 - Re: ANTLR3 C generation? Only want to be sure
that you got it!
Thanks and greetings
Udo
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
looks like ruleunop should be one level higher in the expression tree. Are
you trying to type in a grammar straight from a spec by any chance? Specs
are rarely written in LL(k) form as they are more descriptions of a
language perhaps for programmers and so on, but not usually for parser
writers.
Hi All,
ANTLR grammar acts funny when it encounters a TOKEN in a String. How should
I make the ANTLR escape the letter found in the String is not a TOKEN.
Help will be appreciated.
Thanks
Hiten
Example
text_content.txt
funny boys are Tom Hardy Donald
serious guys are not funny either
grammar
Greetings!
On Mon, 2011-03-21 at 10:00 -0700, Hiten R wrote:
Hi All,
ANTLR grammar acts funny when it encounters a TOKEN in a String. How should
I make the ANTLR escape the letter found in the String is not a TOKEN.
Help will be appreciated.
Thanks
Hiten
Example
text_content.txt
Hi,
I would like to use the Strip tool to remove action code from my grammar. I
saw reference to this tool in antlr version 3.1.2. I currently use antlr
version 3.2. Can anyone help me find this tool / show how to use it from the
jar package for antlr-3.2 ? Or is this a separate entity that
13 matches
Mail list logo