private void collectRules() {
rules = new ArrayList<LiRule>();
List<LiSymbolRef> rightPart = new ArrayList<LiSymbolRef>(32);
for(AstGrammarPart clause : tree.getRoot().getGrammar()) {
if(clause instanceof AstNonTerm) {
AstNonTerm nonterm = (AstNonTerm) clause;
LiSymbol left = symbolsMap.get(nonterm.getName().getName());
if(left == null) {
continue; /* error is already reported */
}
for(AstRule right : nonterm.getRules()) {
createRule(left, right, rightPart);
}
}
}
}