/// <summary> /// Creates a new BranchInstruction. /// </summary> public override Node ExitBranch(Production node) { ArrayList values = GetChildValues(node); BranchInstruction i = new BranchInstruction(); switch (node[0].Id) { case (int)PicoConstants.BEQ: i.Type = BranchTypes.Beq; break; case (int)PicoConstants.BGT: i.Type = BranchTypes.Bgt; break; } i.Address = Assembler.NextInstructionAddress; i.Argument1 = (Argument)values[0]; i.Argument2 = (Argument)values[1]; i.Argument3 = (Argument)values[2]; i.Line = node.StartLine; i.Column = node.StartColumn; i.Assembler = Assembler; Assembler.Instructions.Add(i); return(node); }
/// <summary> /// Creates a new BranchInstruction. /// </summary> public override Node ExitBranch(Production node) { ArrayList values = GetChildValues(node); BranchInstruction i = new BranchInstruction(); switch (node[0].Id) { case (int)PicoConstants.BEQ: i.Type = BranchTypes.Beq; break; case (int)PicoConstants.BGT: i.Type = BranchTypes.Bgt; break; } i.Address = Assembler.NextInstructionAddress; i.Argument1 = (Argument)values[0]; i.Argument2 = (Argument)values[1]; i.Argument3 = (Argument)values[2]; i.Line = node.StartLine; i.Column = node.StartColumn; i.Assembler = Assembler; Assembler.Instructions.Add(i); return node; }