Commit 67a31cf8 authored by Administrator's avatar Administrator
Browse files

damn private methods

parent f6f1e3ff
...@@ -22,7 +22,7 @@ public class Compiler { ...@@ -22,7 +22,7 @@ public class Compiler {
} }
SourceString src = new SourceString(lines.toString()); SourceString src = new SourceString(lines.toString());
JavaParser parser=new JavaParser(); JavaParser parser=new JavaParser();
boolean ok = parser.parse(src); boolean ok = parser.parse(src,"Compilation");
if (ok) { if (ok) {
JavaSemantics sem = parser.semantics(); JavaSemantics sem = parser.semantics();
...@@ -40,11 +40,11 @@ public class Compiler { ...@@ -40,11 +40,11 @@ public class Compiler {
XMLElement.dump(null, sw, elem); XMLElement.dump(null, sw, elem);
//PrintWriter pw = new PrintWriter("debug.xml"); PrintWriter pw = new PrintWriter("debug.xml");
//String s = new String(out.toByteArray()); String s = new String(out.toByteArray());
//pw.print(s); pw.print(s);
//pw.flush(); pw.flush();
//pw.close(); pw.close();
......
...@@ -432,8 +432,13 @@ public class Generate ...@@ -432,8 +432,13 @@ public class Generate
out.line(" {"); out.line(" {");
out.line(" super.init(src);"); out.line(" super.init(src);");
out.line(" sem.init();"); out.line(" sem.init();");
out.line(" Method m = this.getClass().getMethod(nonterminal);"); out.line(" Method[] ms = this.getClass().getMethods();");
out.line(" boolean result = ((Boolean)m.invoke(this)).booleanValue();"); 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(" closeParser(result);");
out.line(" return result;"); out.line(" return result;");
out.line(" }"); 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