Commit 67a31cf8 authored by Dr. Michael Petter's avatar Dr. Michael Petter

damn private methods

parent f6f1e3ff
......@@ -22,7 +22,7 @@ public class Compiler {
}
SourceString src = new SourceString(lines.toString());
JavaParser parser=new JavaParser();
boolean ok = parser.parse(src);
boolean ok = parser.parse(src,"Compilation");
if (ok) {
JavaSemantics sem = parser.semantics();
......@@ -40,11 +40,11 @@ public class Compiler {
XMLElement.dump(null, sw, elem);
//PrintWriter pw = new PrintWriter("debug.xml");
//String s = new String(out.toByteArray());
//pw.print(s);
//pw.flush();
//pw.close();
PrintWriter pw = new PrintWriter("debug.xml");
String s = new String(out.toByteArray());
pw.print(s);
pw.flush();
pw.close();
......
......@@ -432,8 +432,13 @@ public class Generate
out.line(" {");
out.line(" super.init(src);");
out.line(" sem.init();");
out.line(" Method m = this.getClass().getMethod(nonterminal);");
out.line(" boolean result = ((Boolean)m.invoke(this)).booleanValue();");
out.line(" Method[] ms = this.getClass().getMethods();");
out.line(" boolean result = false;");
out.line(" for (Method m :ms ){");
out.line(" if (!m.getName().equals(nonterminal)) continue;");
out.line(" result = ((Boolean)m.invoke(this)).booleanValue();");
out.line(" }");
out.line(" closeParser(result);");
out.line(" return result;");
out.line(" }");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment