[antlr-interest] I got the parseing, now how do I do somethin
g useful ?
Ney, Richard
richard.ney at aspect.com
Thu Feb 27 11:17:50 PST 2003
Try putting # in front like this rule
alias
: i:IDENT
{
#i.setType(SqlTokenTypes.ALIAS);
}
-Richard
-----Original Message-----
From: uiorean <uiorean at cluj.astral.ro> [mailto:uiorean at cluj.astral.ro]
Sent: Thursday, February 27, 2003 10:16 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] I got the parseing, now how do I do something
useful ?
I wrote a lexer and a parser. Now my problem is how do I get the
parsed tokens stored (for further processing) ?
My parser looks like:
entry: (
(insrd dest COMA source)
|(insdest dest)
)*;
where I have
protected insrd: ADD_
|ADC_
|SUB_
;
protected source: REG
|DOP
|PORT
|LDB
|DST
;
protected dest: REG;
and so on...
i would like to do something like:
entry: (
(i:insrd d:dest COMA s:source
{somefunction(i.getText(), i.getType(), d.getText(), d.getType());})
|(i1:insdest d1:dest
{somefunction(i.getText(), i1.getType(), d1.getText(), d1.getType());})
)*;
but this does not work. I don't think I really need to build a tree
for this, there must be an easyer way.
I am new to this mather so any suggestion is appreciated.
L. Uiorean
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list