[antlr-interest] OT: Re: Oracle SQL Parser

Ivan Brezina ibre5041 at ibrezina.net
Wed Jun 13 03:27:04 PDT 2012


Quoting "Brown, Rick" <RBROWN at allstate.com>:

> I am trying to generate an Oracle SQL parser, and came across a grammar
> at http://www.antlr.org/grammar/1062280680642/MS_SQL_SELECT.html.  This
> seems to work well, except that I am having trouble getting it to
> properly recognize single-line comments that begin with a double dash
> ('--') or double-slash ('//').  Comments enclosed in /* */ pairs work
> fine.  I am no grammar expert, but the problem seems to be that the
> comment is not being ended at the end of a line; instead, it seems to
> consider everything that follows, the entire rest of the file, as part
> of the comment.  Do you think this may have something to do with the
> 'greedy' option?  If so, how would I rewrite the definition?
>

If you're really looking for Oracle SQL&#8194;parser, maybe you should start
with the "current"&#8194;one.

Look at Alexandre's project:
https://github.com/porcelli/plsql-parser

In the subdirectory tests, you'll find some fancy stuff.

Ivan




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the antlr-interest mailing list