300301302303304305306307308309310
"exit" + name, type + " node", "Node"); m.addComment(new JavaComment(EXIT_COMMENT)); m.addThrows("ParseException"); m.addCode("return node;"); cls.addMethod(m); } /** * Adds an add child method to this file.
318319320321322323324325326327328
"child" + name, "Production node, Node child", "void"); m.addComment(new JavaComment(CHILD_COMMENT)); m.addThrows("ParseException"); m.addCode("node.addChild(child);"); cls.addMethod(m); } /** * Returns the class name for this analyzer.
216217218219220221222223224225226
"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); initMethod.addComment(new JavaComment(INIT_METHOD_COMMENT));