280281282283284285286287288289290
m = new JavaMethod(JavaMethod.PROTECTED, "enter" + name, type + " node", "void"); m.addComment(new JavaComment(ENTER_COMMENT)); m.addThrows("ParseException"); cls.addMethod(m); } /**
298299300301302303304305306307308
m = new JavaMethod(JavaMethod.PROTECTED, "exit" + name, type + " node", "Node"); m.addComment(new JavaComment(EXIT_COMMENT)); m.addThrows("ParseException"); m.addCode("return node;"); cls.addMethod(m); }
316317318319320321322323324325326
m = new JavaMethod(JavaMethod.PROTECTED, "child" + name, "Production node, Node child", "void"); m.addComment(new JavaComment(CHILD_COMMENT)); m.addThrows("ParseException"); m.addCode("node.addChild(child);"); cls.addMethod(m); }
215216217218219220221222223224225
method = new JavaMethod(JavaMethod.PROTECTED, "newTokenizer", "Reader in", "Tokenizer"); method.addThrows("ParserCreationException"); method.addComment(new JavaComment(FACTORY_COMMENT)); method.addCode("return new " + tokenizer.getClassName() + "(in);"); cls.addMethod(method); // Add init method cls.addMethod(initMethod);