public void AddAction(Action act) { Action lasta = null, a = firstAction; while (a != null && act.typ >= a.typ) {lasta = a; a = a.next;} // collecting classes at the beginning gives better performance act.next = a; if (a==firstAction) firstAction = act; else lasta.next = act; }
void NewTransition(State from, State to, int typ, int sym, int tc) { Target t = new Target(to); Action a = new Action(typ, sym, tc); a.target = t; from.AddAction(a); if (typ == Node.clas) { curSy.tokenKind = Symbol.classToken; } }