[antlr-interest] Fwd: c# 2.0 grammar help

James Briant jab.antlr at species.org
Thu Dec 28 11:13:16 PST 2006


I'm trying to create a grammar for C# 2.0 by following the spec. I'm stuck
on the lexer! I'm not sure how best to handle the different character types.
This is what I have done:


LETTER_CHARACTER
    :    c=. { IsUnicodeLetterChar( c ) }?
    |    u=UNICODE_ESCAPE_SEQUENCE { IsUnicodeLetterChar( u ) }?
    ;

COMBINING_CHARACTER
    :    c=. {    IsUnicodeCombiningCharacter(c) }?
   |    u=UNICODE_ESCAPE_SEQUENCE { IsUnicodeCombiningCharacter( u ) }?
    ;


Will the {}? term successfully filter out the different types of character
or is there a much better way of doing this? Any help greatly appreciated.
The full lexer grammar that I have so far is attached.

Thanks!

James Briant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061228/d6fe5739/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: csharp2.g
Type: application/octet-stream
Size: 10690 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20061228/d6fe5739/attachment.obj 


More information about the antlr-interest mailing list