[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: note: JasminClass change



I think that

.super

by itself implying super_class = 0 is better. Either that or an explicit '.no_super'. You still need something that writes the super_class field (well, it's 0, so you don't _really_ need it if the data is initialized). Also, if the entire line is optional, then you don't get parse errors if you forget .super for a non-java.lang.Object class, which is bad.

Something like:

--- parser.cup  Tue Oct  9 16:57:25 2001
+++ new_parser.cup      Tue Apr 27 17:18:33 2004
@@ -209,6 +209,11 @@
         {:
             classFile.setSuperClass(name);
         :}
+    |
+    DSUPER SEP
+        {:
+            classFile.setSuperClass(0);
+        :}
   ;

// ---- Implements specification

If this sounds good, I'll go ahead and work on it. If someone else has experience with changing the Jasmin grammar (Feng?), advice on pitfalls is welcome. It looks like I need to generate a parser and then put it in parser.java.

Chris

Patrick LAM wrote:
Let's fix jasmin to make super optional.

pat