[antlr-interest] Re: SQL grammar tree construction problem

lgcraymer lgc at mail1.jpl.nasa.gov
Tue Nov 4 11:27:59 PST 2003


Gustav--

You cannot make a rule a root--that's what ANTLR is complaining about. 
 Rules may represent subtrees, so only nodes with token ids (TEXT or 
STRING, for example) can be followed with ^.

--Loring


--- In antlr-interest at yahoogroups.com, Gustav Boström <i93gusbo at h...> 
wrote:
> Hello!
> 
> I'm trying to use Lubos Vnuk's (Thanks for doing all the work!) SQL-
> grammar in order to do some 
> processing on SQL-statments. I would for example like to find out 
> which columns are affected by a DML-statement and which parameters 
> correspond to which columns.
> 
> I'm doing this is in Java , so I've changed the grammar slightly.
> I've removed the C++ actions or replaced them with Java versions.
> 
> My thought was to add AST-construction and then navigate the tree to 
> find out the stuff I need. This is where I run into problems.
> I tried to annotate the rules with ^ to construct my tree, but it 
> keeps giving me "unexpected token:^" when I try to dothis for 
example:
> sql_stmt : 
> 	  sql_data_stmt^ 
> ;
> 
> I've set the options to buildAST=true;
> I'm using version 2.7.2.
> 
> Any ideas on what can be wrong?
> 
> Cheers,
> 
> Gustav Boström


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list