[antlr-interest] Translating two queries

C.M.Du duchuming at yahoo.com
Thu Feb 14 08:30:03 PST 2002


Hello all,

I need to translate a query into another form of
query. For example, I need to translate query (1)
to query (2) in the following.
 
(1)
select { ... }
where {country: {name: N}} in db .


(2)
select { ... }
where {country: C} in db,
      {name: N} in C .


I already built an AST for query 1, which includes two
imaginary tokens ("bindCond" and "pattern")

(AST 1)
     where
       |
       bindCond -- db
           |
          pattern
             |
            country
               |
              pattern
                 |
                name -- N

I have difficulties to translate query (1) into query
(2), which means I have to translate (AST 1) 
into (AST 2). 

(AST 2)
     where
       |
      bindCond ------------db--------bindCond -- C
          |                              |
         pattern                        pattern
            |                              |
           country -- C                   name -- N


Can anyone give me a help or advice? Thank you in
advance.

Chuming

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

 

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



More information about the antlr-interest mailing list