[antlr-interest] DmlSQL2 converting to v3

Maciej Gawinecki mgawinecki at gmail.com
Mon Mar 9 13:43:35 PDT 2009


Hello,

I'm converting DmlSQL2 grammar [1] from v2 to v3 of ANTLR and adapting 
for Java parser.

1. How can I convert to following expression to v3:
   -----------------------------
   any_token : !
	. // {cout << tokenNames[LA(1)] << ' ' << LT(1)->getText() <<
   endl;}
   ;
   -----------------------------
   ?

2. What can I do to avoid receiving error

    DmlSQL2.g:285:25: syntax error: antlr: DmlSQL2.g:285:25: unexpected
    token: '\177'

    for the following rule:

   -----------------------------
    SIMPLE_LETTER :
	'a'..'z' | 'A'..'Z' // | '\177'..'\377'
    ;
   -----------------------------

3. When generating Lexer from the grammar I receive the following error:
    -------------------------------
    C:\workspace\momis\etc-test\sql\output\DmlSQL2Lexer.java:4078:
    unclosed
    string literal

    [21:34:09]             match("
    [21:34:09]
    -------------------------------
    and the tail of the lexer file is like it:
    -------------------------------
		break;
           	case 2 :
             	    //
	C:\\workspace\\momis\\etc-test\\sql\\DmlSQL2.g:232:33: '' ' ' ''
             	    {
             	    match('
    -------------------------------

    What can be the reason?

TIA,
Maciej


1. http://www.antlr.org/grammar/1057936474293/DmlSQL2.g


More information about the antlr-interest mailing list