AddAction() public method

public AddAction ( Action act ) : void
act Action
return void
Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        static void NewTransition(State from, State to, int typ, int sym, int tc)
        {
            if (to == firstState)
            {
                Parser.SemErr("token must not start with an iteration");
            }
            Target t = new Target(to);
            Action a = new Action(typ, sym, tc); a.target = t;

            from.AddAction(a);
        }
Ejemplo n.º 3
0
        void NewTransition(State from, State to, int typ, int sym, int tc)
        {
            if (to == firstState)
            {
                parser.SemErr("token must not start with an iteration");
            }
            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;
            }
        }
Ejemplo n.º 4
0
        static void SplitActions(State state, Action a, Action b)
        {
            Action   c;
            BitArray seta, setb, setc;

            seta = a.Symbols();
            setb = b.Symbols();
            if (Sets.Equals(seta, setb))
            {
                a.AddTargets(b);
                state.DetachAction(b);
            }
            else if (Sets.Includes(seta, setb))
            {
                setc = (BitArray)seta.Clone();
                Sets.Subtract(setc, setb);
                b.AddTargets(a);
                a.ShiftWith(setc);
            }
            else if (Sets.Includes(setb, seta))
            {
                setc = (BitArray)setb.Clone();
                Sets.Subtract(setc, seta);
                a.AddTargets(b);
                b.ShiftWith(setc);
            }
            else
            {
                setc = (BitArray)seta.Clone();
                setc.And(setb);
                Sets.Subtract(seta, setc);
                Sets.Subtract(setb, setc);
                a.ShiftWith(seta);
                b.ShiftWith(setb);
                c = new Action(0, 0, Node.normalTrans); // typ and sym are set in ShiftWith
                c.AddTargets(a);
                c.AddTargets(b);
                c.ShiftWith(setc);
                state.AddAction(c);
            }
        }
Ejemplo n.º 5
0
 void SplitActions(State state, Action a, Action b)
 {
     Action c; CharSet seta, setb, setc;
     seta = a.Symbols(tab); setb = b.Symbols(tab);
     if (seta.Equals(setb)) {
     a.AddTargets(b);
     state.DetachAction(b);
     } else if (seta.Includes(setb)) {
     setc = seta.Clone(); setc.Subtract(setb);
     b.AddTargets(a);
     a.ShiftWith(setc, tab);
     } else if (setb.Includes(seta)) {
     setc = setb.Clone(); setc.Subtract(seta);
     a.AddTargets(b);
     b.ShiftWith(setc, tab);
     } else {
     setc = seta.Clone(); setc.And(setb);
     seta.Subtract(setc);
     setb.Subtract(setc);
     a.ShiftWith(seta, tab);
     b.ShiftWith(setb, tab);
     c = new Action(0, 0, Node.normalTrans);  // typ and sym are set in ShiftWith
     c.AddTargets(a);
     c.AddTargets(b);
     c.ShiftWith(setc, tab);
     state.AddAction(c);
     }
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
Archivo: DFA.cs Proyecto: SealedSun/prx
	void NewTransition(State from, State to, int typ, int sym, int tc) {
		if (to == firstState) parser.SemErr("token must not start with an iteration");
		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;
	}
Ejemplo n.º 8
0
	static void NewTransition(State from, State to, int typ, int sym, int tc) {
		if (to == firstState) Parser.SemErr("token must not start with an iteration");
		Target t = new Target(to);
		Action a = new Action(typ, sym, tc); a.target = t;
		from.AddAction(a);
	}