[antlr-interest] Problem parsing double quotes
Mike Arace
mikearace at hotmail.com
Wed Apr 16 23:39:29 PDT 2008
Hi Antlr List,
I am working on a grammar that seems to have run into a snag. It seems as if the Antlr lexer or parser is eating my doulble quotes and adjacent characters.
I initialize the parser in the following manner:
WontonParser parser = new WontonParser(new CommonTokenStream(new WontonLexer(new CaseInsensitiveStringStream(command))));
where CaseInsensitiveStringStream is merely the Java version shown in the FAQ. (http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782)
When "command" is the following:
-- string below --
replace trigger on table addresses after insert as
rs = database.query("select id from addresses");
while (rs.next()) {
database.execute("insert into times (address_id) values ('" + rs.getData(0) +"') ");
}
endtrigger
-- string above --
the lexer seems to receive it correctly. As the CommonTokenStream is initialized, however, it turns this into:
-- string below --
replace trigger on table addresses after insert as
rs = database.query(elect id from addresseswhile (rs.next()) database.execute(nsert into times (address_id) values ('" + rs.getData(0) +"')
endtrigger
-- string above --
Does anyone have any idea as to what can be happening?
Best Regards,
Mike
_________________________________________________________________
More immediate than e-mail? Get instant access with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080417/5911077c/attachment.html
More information about the antlr-interest
mailing list