Hi,

I just use antlr for writing a parser for a small expression language.

In this language I have a function called 'LÄNGE' (the german word for length).
This also shows up in the resulting code for the lexer. However this is not 
ascii so python complains about it.
------
$ python Lexer.py
  File "Lexer.py", line 1414
SyntaxError: Non-ASCII character '\xc4' in file Lexer.py on line 1414, but no 
encoding declared; see http://www.python.org/peps/pep-0263.html for details
------
The solution is to add a line like 
-----
# coding: latin1
-----
as first or second line in the generated file.

Is there a way to set this from the grammar file?


Kind regards

René Liebscher


PS: One could think encoding it as 'L\u00c4NGE' in the grammar file, but this 
results in "L\u00c4NGE" in the python file, where it had to be u"L\u00c4NGE" to 
accept the \u.

-- 
Sensationsangebot nur bis 30.11: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/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