[antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

David-Sarah Hopwood david-sarah at jacaranda.org
Fri Oct 16 23:27:06 PDT 2009


Jim Idle wrote:
[...]
> Change the ranges to:
> 
> ID: ‘a’..’k’ | ‘l’..’t’ …

I doubt that will work. The generated code sometimes uses character
literals, sometimes string literals, and sometimes Unicode code point
values. The code can't be compiled as EBCDIC because the code point
values are not EBCDIC codes.

It would be easier to hack the C target so that it avoids character
literals, and uses only \x escapes in string literals.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com



More information about the antlr-interest mailing list