* @return a copybook instance containing the parse tree for the definition
*/
public static Copybook parse(String name, Reader reader)
{
Copybook document = null;
Lexer lexer = null;
try {
String preProcessed = CobolPreprocessor.preProcess(reader);
StringReader sr = new StringReader(preProcessed);
PushbackReader pbr = new PushbackReader(sr, 1000);
if (debug) {
lexer = new DebugLexer(pbr);
} else {
lexer = new Lexer(pbr);
}
Parser parser = new Parser(lexer);
Start ast = parser.parse();
CopybookAnalyzer copyBookAnalyzer = new CopybookAnalyzer(name, parser);