public ThreeAddressInstructionControl(List <Variable> ScopeVariables, Variable selectedVariable)
 {
     InitializeComponent();
     ThreeAddressInstruction =
         new ThreeAddressInstruction {
         InstructionType = Enums.InstructionType.ThreeAddress
     };
     SelectetVariable = selectedVariable;
     LocalVariables   = ScopeVariables;
     ThreeAddressInstruction.Operator = "+";
 }
示例#2
0
        private void SetString(Assignment assignment)
        {
            AssignmentString = assignment.Variable;



            AssignmentString += "=";
            if (assignment.Instruction.InstructionType == Enums.InstructionType.SingleAddress)
            {
                SingleInstruction instruction = (SingleInstruction)assignment.Instruction;
                if (instruction == null)
                {
                    return;
                }
                ParseInstruction(instruction.Instruction);
            }

            else if (Assignment.Instruction.InstructionType == Enums.InstructionType.ThreeAddress)
            {
                ThreeAddressInstruction instruction = (ThreeAddressInstruction)assignment.Instruction;
                if (instruction == null)
                {
                    return;
                }
                ParseInstruction(instruction.LeftInstruction);

                AssignmentString += instruction.Operator;

                ParseInstruction(instruction.RightInstruction);
            }



            AssignmentStringLable.Text  = AssignmentString;
            Assignment.AssignmentString = AssignmentString;
        }