[antlr-interest] error in my rule...
Vaida Morkute
vaida_morkute at hotmail.com
Wed Dec 11 01:16:20 PST 2002
Hello,
Could you help me to understand what is wrong in my rule:
query!
:SELECT! a:selection_list
{## = #([QUERY, "query"], #(SELECT, a));}
(WHERE! b:where_list
{## = #([QUERY, "query"], #(SELECT, a),#(WHERE, b));})?
;
As output I want to get an AST of the form:
#(QUERY #(SELECT a) #(WHERE b)), where
QUERY is imaginary note and WHERE is optional.
How could I rewrite this rule?
After the compilation I get the following errors:
BandParser.java:63: cannot resolve symbol
symbol : variable tmp1_AST
location: class band.BandParser
query_AST = (AST)astFactory.make( (new
ASTArray(2)).add(astFactory.create(QUERY,"query")).add((AST)a
stFactory.make( (new ASTArray(2)).add(tmp1_AST).add(a_AST))));
^
BandParser.java:75: cannot resolve symbol
symbol : variable tmp2_AST
location: class band.BandParser
query_AST = (AST)astFactory.make( (new
ASTArray(3)).add(astFactory.create(QUERY,"query")).add((AST)astFactory.make(
(new ASTArray(2)).add(SELECT).add(a_AST))).add((AST)astFactory.make( (new
ASTArray(2)).add(tmp2_AST).add(b_AST))));
^
BandParser.java:75: add(antlr.collections.AST) in
antlr.collections.impl.ASTArray cannot be applied to (int)
query_AST = (AST)astFactory.make( (new
ASTArray(3)).add(astFactory.create(QUERY,"query")).add((AST)astFactory.make(
(new ASTArray(2)).add(SELECT).add(a_AST))).add((AST)astFactory.make( (new
ASTArray(2)).add(tmp2_AST).add(b_AST))));
^
I am stuck at this place :( ... I would appreciate your help very much,
Vaida :)
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list