On 4/17/11 6:32 PM, "Jim Idle" <j...@temporal-wave.com> wrote:

Hi Jim,

Thanks to your point on
    http://markmail.org/message/izyhuzbooerfw4tu


I was able resolve DELIMITED IDENT rule with (as I am sure now) maximal
effectiveness. Great.

30 min for me have take to correctly find C analogs of macros, and make them
compile. Then next 90 minutes I have search how to force IDENT type of token
instead of DELIMITED.

Now rule works correctly.  All on LEXER level.  All looks effective.

Again, if you like this code, maybe add it to FAQ page for future
developers.


//----------------------------------------------------------------------
Next task is LITERAL :-)
So I will yet send letters here. Please be patience.


//----------------------------------------------------------------------
IDENT
    :    ( LETTER | '_' ) ( LETTER | '_' | DIGIT )*
    ;

DELIMITED        // delimited_identifier
@init
{
    $type = IDENT;
    int theStart = $start;
}
    :
    (    DQUOTE    { theStart = GETCHARINDEX(); }
            ( ~(DQUOTE) | DQUOTE DQUOTE )+
                { $start = theStart; EMIT(); }
        DQUOTE
    
    |    BQUOTE    { theStart = GETCHARINDEX(); }
            ( ~(BQUOTE) | BQUOTE BQUOTE )+
                { $start = theStart; EMIT(); }
        BQUOTE
    
        // valentina/oracle extension: [asasas '' " sd "]
    |    LBRACK    { theStart = GETCHARINDEX(); }
            ( ~(']') )+
                { $start = theStart; EMIT(); }
        RBRACK
    )            
    ;


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to