[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help needed for sql grammar



Hi G.Naveena,

() around an alternative is a SableCC 2.x feature: it indicates an alternative
that is NOT used for parsing.  It simply serves to cause SableCC to generate
the node classes for such alternatives, so that a later compilation pass can
create such nodes and add them into the AST.  In my M.Sc. thesis, such alternatives
are called "hidden alternatives".

As of SableCC 3.x, such alternatives have been eliminated and replaced by  a new
"Abstract Syntax Tree" section.

Etienne


g naveena wrote:
hi,

   I am trying to write grammar for SQL.
   I went through OQL grammar which is given in the
site. i have some doubts in it
in the production like

expr = expr_restricted |

     {identifier} identifier |
     ({literal} literal ) |
     ({star} star ) |
     ({long_param} dollar long_literal ) |
     ({named_param} dollar identifier ) |

     ({select} select_x ) |
     ({nested} bracket_l query bracket_r) |


having_clause = (having expr) | {tmp} having expr_restricted ;

why only some of them are enclosed within the brackets
while others are not

what is the significance of the enclosing brackets
how does it change

thanks in advance

G.Naveena
System Designer
Centre for Good Governance
Hyderabad
India


________________________________________________________________________ Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com





--
Etienne M. Gagnon, Ph.D.             http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/