Esempio n. 1
0
 private void PerformIdentificationOnForCommand(ForCommandNode forCommand)
 {
     PerformIdentification(forCommand.Identifier);
     PerformIdentification(forCommand.Expression);
     PerformIdentification(forCommand.ExpressionTo);
     PerformIdentification(forCommand.Command);
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="forCommand"></param>

        private void PerformIdentificationOnForCommand(ForCommandNode forCommand)
        {
            SymbolTable.OpenScope();
            PerformIdentification(forCommand.Assign);
            PerformIdentification(forCommand.Expression);
            PerformIdentification(forCommand.Command);
            SymbolTable.CloseScope();
        }
Esempio n. 3
0
        private void GenerateCodeForForCommand(ForCommandNode forCommand)
        {
            Debugger.Write("Generating code for forCommand");
            GenerateCodeFor(forCommand.Expression);
            Address ifJumpAddress = code.NextAddress;

            code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            Address thenJumpAddress = code.NextAddress;

            code.AddInstruction(OpCode.JUMP, Register.CB, 0, 0);
            code.PatchInstructionToJumpHere(ifJumpAddress);
            code.PatchInstructionToJumpHere(thenJumpAddress);
        }
Esempio n. 4
0
        private void GenerateCodeForForCommand(ForCommandNode forCommand)
        {
            Debugger.Write("Generating code for the ForCommandNode");

            scopes.AddScope();
            GenerateCodeFor(forCommand.Assign);
            Address forJumpAddress = code.NextAddress;

            GenerateCodeFor(forCommand.Expression);
            Address commandJumpAddress = code.NextAddress;

            code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            GenerateCodeFor(forCommand.Command);
            code.AddInstruction(OpCode.JUMP, Register.CB, 0, forJumpAddress);
            code.PatchInstructionToJumpHere(commandJumpAddress);
            code.AddInstruction(OpCode.POP, 0, 0, scopes.GetLocalScopeSize());
            scopes.RemoveScope();
        }
Esempio n. 5
0
        private void GenerateCodeForForCommand(ForCommandNode forCommand)
        {
            scopes.AddScope();
            Debugger.WriteDebuggingInfo("Generating code for For command");
            GenerateCodeFor(forCommand.Expression);
            Address forJumpAddress = code.NextAddress;

            code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            code.PatchInstructionToJumpHere(forJumpAddress);
            GenerateCodeFor(forCommand.Identifier);
            Address idJumpAddress = code.NextAddress;

            code.PatchInstructionToJumpHere(idJumpAddress);
            //  code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            GenerateCodeFor(forCommand.ToExpression);
            Address toJumpAddress = code.NextAddress;

            code.PatchInstructionToJumpHere(toJumpAddress);
            // code.AddInstruction(OpCode.JUMPIF, Register.CB, FalseValue, 0);
            GenerateCodeFor(forCommand.BecomesExpression);
            Address becomesJumpAddress = code.NextAddress;

            code.PatchInstructionToJumpHere(becomesJumpAddress);
        }