[antlr-interest] '–versus '-'

ian eyberg ian at telematter.com
Tue Jan 13 11:31:51 PST 2009


> hi everyone,
> 
>   just ran across a problem which I hope
> someone knows the answer to.
> 
> I thought I was trying to parse out a '-'
> but on closer examination I need to parse
> out a '–'.
> 
> looking that up one is called a en dash and the latter
> is an em dash.
> 
> I tried to throw it into a lexer and a parser rule
> to no avail -- do I need to separate this into hex
> somehow? How do you guys deal with these?
> 
> Thanks,
> 
> -Ian

awesome! got it!

hex escaped like so:

EMDASH  : '\u2013'

it would've helped to know that I was using a 'en dash' rather than a 'em dash'
they look exactly the same to me in the shell/vim -- guess I need to update my
character sets!

Thanks,
-Ian


More information about the antlr-interest mailing list