}
public void assignTokenTypes() throws antlr.RecognitionException {
// ASSIGN TOKEN TYPES for all delegates (same walker)
//System.out.println("### assign types");
AssignTokenTypesWalker ttypesWalker = new AssignTokenTypesBehavior();
ttypesWalker.setASTNodeClass("org.antlr.tool.GrammarAST");
List<Grammar> grammars = delegateGrammarTreeRoot.getPostOrderedGrammarList();
for (int i = 0; grammars!=null && i < grammars.size(); i++) {
Grammar g = (Grammar)grammars.get(i);
try {
//System.out.println(" walking "+g.name);
ttypesWalker.grammar(g.getGrammarTree(), g);
}
catch (RecognitionException re) {
ErrorManager.error(ErrorManager.MSG_BAD_AST_STRUCTURE,
re);
}
}
// the walker has filled literals, tokens, and alias tables.
// now tell it to define them in the root grammar
ttypesWalker.defineTokens(delegateGrammarTreeRoot.grammar);
}