[antlr-interest] small bug in Python.g examples

Frank Wierzbicki fwierzbicki at gmail.com
Wed Oct 17 19:23:53 PDT 2007


Hi all,

I haven't posted here before -- My name is Frank Wierzbicki and I am
the lead of the Jython project.  We are looking at replacing Javacc
with Antlr in a future release.  While examining the Python.g grammar
in the examples I found a small bug that causes at least one valid
python file in Python 2.3 to choke.

Sorry if this is not the proper place for this, I didn't see an area
for the examples in the bug tracker.  The bug is in both the Java and
csparp Python.g grammars.  The Hex part of INT optionally adds 'l' |
'L' when this is already taken care of by LONGINT.  Here is a diff of
the fix:

--- Python.g	2007-08-13 18:33:04.000000000 -0400
+++ PythonFix.g	2007-10-17 22:01:44.000000000 -0400
@@ -490,7 +490,6 @@

 INT :   // Hex
         '0' ('x' | 'X') ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
-        ('l' | 'L')?
     |   // Octal
         '0' DIGITS*
     |   '1'..'9' DIGITS*

I can re-send as an attachment or create a bug in the tracker if needed.

Thanks!

-Frank Wierzbicki


More information about the antlr-interest mailing list