[antlr-interest] Oracle SQL Parser

Bart Kiers bkiers at gmail.com
Wed Jun 13 01:29:37 PDT 2012


On Wed, Jun 13, 2012 at 12:20 AM, Brown, Rick <RBROWN at allstate.com> wrote:

> ... 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. ...
>

I don't see anything wrong with the rule. The Comment rule has 3
alternatives:

Comment
  :  '--' ~('\n'|'\r')* '\r'? '\n' { $channel=HIDDEN;
}                         // alternative 1
  |  '//' ~('\n'|'\r')* '\r'? '\n' { $channel=HIDDEN;
}                         // alternative 2
  |  '/*' ( options {greedy=false;} : . )* '*/' { $channel=HIDDEN; }  //
alternative 3
  ;

Alternative 1 and 2 must end with a line break, and alternative 3 must end
with '*/'.

Could you tell how you came to the conclusion that there's a problem with
the rule? Do you have input that gets tokenized incorrectly? If so, could
you send it to the list as well?

Regards,

Bart.


More information about the antlr-interest mailing list