public static void CheckAllAttributeExpressions(Grammar g) { foreach (ActionAST act in g.namedActions.Values) { AttributeChecks checker = new AttributeChecks(g, null, null, act, act.Token); checker.ExamineAction(); } foreach (Rule r in g.rules.Values) { foreach (ActionAST a in r.namedActions.Values) { AttributeChecks checker = new AttributeChecks(g, r, null, a, a.Token); checker.ExamineAction(); } for (int i = 1; i <= r.numberOfAlts; i++) { Alternative alt = r.alt[i]; foreach (ActionAST a in alt.actions) { AttributeChecks checker = new AttributeChecks(g, r, alt, a, a.Token); checker.ExamineAction(); } } foreach (GrammarAST e in r.exceptions) { ActionAST a = (ActionAST)e.GetChild(1); AttributeChecks checker = new AttributeChecks(g, r, null, a, a.Token); checker.ExamineAction(); } if (r.finallyAction != null) { AttributeChecks checker = new AttributeChecks(g, r, null, r.finallyAction, r.finallyAction.Token); checker.ExamineAction(); } } }