file.addNamespace(n);
}
// Add file comment
str = file.toString() + "\n\n" + gen.getFileComment();
file.addComment(new VisualBasicComment(VisualBasicComment.SINGLELINE,
str));
// Add type comment
cls.addComment(new VisualBasicComment(TYPE_COMMENT));
// Add enumeration
cls.addEnumeration(enm);
enm.addComment(new VisualBasicComment(ENUM_COMMENT));
// Add constructor
constr = new VisualBasicConstructor("ByVal input As TextReader");
cls.addConstructor(constr);
constr.addComment(new VisualBasicComment(CONSTRUCTOR1_COMMENT));
constr.addCode("MyBase.New(input)");
constr.addCode("CreatePatterns()");
// Add constructor
constr = new VisualBasicConstructor("ByVal input As TextReader, " +
"ByVal analyzer As " +
analyzer.getClassName());
cls.addConstructor(constr);
constr.addComment(new VisualBasicComment(CONSTRUCTOR2_COMMENT));
constr.addCode("MyBase.New(input, analyzer)");
constr.addCode("CreatePatterns()");
// Add tokenizer factory method
method = new VisualBasicMethod(VisualBasicMethod.PROTECTED + VisualBasicMethod.OVERRIDES,
"NewTokenizer",
"ByVal input As TextReader",
"Tokenizer");
method.addComment(new VisualBasicComment(FACTORY_COMMENT));
method.addCode("Return New " + tokenizer.getClassName() + "(input);");
cls.addMethod(method);
// Add init method
cls.addMethod(initMethod);
initMethod.addComment(new VisualBasicComment(INIT_METHOD_COMMENT));
initMethod.addCode("Dim pattern As ProductionPattern");
initMethod.addCode("Dim alt As ProductionPatternAlternative");
}