in the snippet below, can "escape_character" be a variable?
it seems that this would not work because the "escape_character" is not
known until it is too late.
the alternate form below might work if the Antlr Lexer can use a variable in
the pattern match.
can the lexer apply the escape character as a post processing validation
step?
    i.e. accept anything within the quotes and then validate the sequence
after the ESCAPE clause?

Unicode_Identifier  =
        U Ampersand
        Double_Quote  ( Unicode_Identifier_Part )+ Double_Quote
        ( ESCAPE escape_character )?
        ;


Alternate form:

Unicode_Identifier  =
        U Ampersand
        ( ESCAPE escape_character )?
        Double_Quote  ( Unicode_Identifier_Part )+ Double_Quote
        ;


fragment
Unicode_Identifier_Part  = Unicode_Permitted_Identifier_Character  |
Unicode_Escape_Value ;

fragment
Unicode_Escape_Value  = Unicode_4_Digit_Escape_Value  |
Unicode_6_Digit_Escape_Value ;

fragment
Unicode_4_Digit_Escape_Value  = escape_character  Hexit  Hexit  Hexit  Hexit
;

fragment
Unicode_6_Digit_Escape_Value  = escape_character  Plus_Sign Hexit  Hexit
Hexit  Hexit  Hexit  Hexit ;

escape_character            = Back_Slash /*!! See the Syntax Rules*/; ;

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to