Access to line text in ANTLR 2
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   js_manger
Posted On:   Wednesday, December 27, 2006 06:03 PM

Hi, I'm working with a SQL-like language: statement: selectClause fromClause whereClause ... whereClause: WHERE property relationalOp property | WHERE property in (property(, property)*) The where clause should now be extended to allow subqueries: whereClause: WHERE property in (statement) I would like to keep the text of the subquery statement, and then when the tree is walked, to create the subquery statement by invoking the higher level code that manages both the parser and the tree walker and other complex stuff (reparsing the subquery along the way). So, I'm wondering if there is a way from the parser to a   More>>

Hi,


I'm working with a SQL-like language:

			
statement: selectClause fromClause whereClause


...

			
whereClause: WHERE property relationalOp property

| WHERE property in (property(, property)*)


The where clause should now be extended to allow subqueries:

			
whereClause: WHERE property in (statement)


I would like to keep the text of the subquery statement, and then when the tree is walked, to create the subquery statement by invoking the higher level code that manages both the parser and the tree walker and other complex stuff (reparsing the subquery along the way). So, I'm wondering if there is a way from the parser to access the original statement text in the place corresponding to the subquery? Thanks for any help.    <<Less

Re: Access to line text in ANTLR 2

Posted By:   js_manger  
Posted On:   Friday, December 29, 2006 02:56 PM

I found the solution to this at

http://compilers.iecc.com/comparch/article/06-05-059
About | Sitemap | Contact