[antlr-interest] Bison-> Antlr 3 help

Mike Aubury antlr at aubit.com
Fri Oct 20 09:00:49 PDT 2006


Cheer for that..
The idea with the 'CLOSE' 'SESSION' - was that I was (wrong) thinking it would 
do 'words' with strings (rather than single characters) in the quotes - I can 
see I'll need to do that with some whitespace in there...

Basically - the 
        close_session:
                        CLOSE_SESSION

comes from a lex token ("CLOSE SESSION" {... return CLOSE_SESSION;}
(ok - its not quite that simple - but you get the idea - remember I'm trying 
to port from bison/lex here)

>
> add_column_clause_ss :
>       table_element_ss
>       (BEFORE identifier)?
>       ;

The language is very verbose - that particular bit is part of the SQL ALTER 
statement - so at that point, BEFORE couldn't be an identifier - if 
the 'lexer' saw the word 'BEFORE' i'd want it as a 'reserved word', rather 
than the identifier..
In fact - if it can match to a reserved word at any point in the grammer - I'd 
want it to select that and not an 'ID' - is there any simple way to do that ? 



-- 
Mike Aubury



More information about the antlr-interest mailing list