AjTalk.Compilers.Vm.BytecodeCompiler.Visit C# (CSharp) Метод

Visit() публичный Метод

public Visit ( FreeBlockExpression block ) : void
block AjTalk.Model.FreeBlockExpression
Результат void
        public override void Visit(FreeBlockExpression block)
        {
            if (block.ParameterNames != null)
                foreach (var parname in block.ParameterNames)
                    this.block.CompileArgument(parname);

            if (block.LocalVariables != null)
                foreach (var locname in block.LocalVariables)
                    this.block.CompileLocal(locname);

            this.Visit(block.Body);
        }

Same methods

BytecodeCompiler::Visit ( ArrayExpression expression ) : void
BytecodeCompiler::Visit ( BlockExpression expression ) : void
BytecodeCompiler::Visit ( ClassModel @class ) : void
BytecodeCompiler::Visit ( ClassVariableExpression expression ) : void
BytecodeCompiler::Visit ( CodeModel model ) : void
BytecodeCompiler::Visit ( ConstantExpression expression ) : void
BytecodeCompiler::Visit ( DynamicArrayExpression expression ) : void
BytecodeCompiler::Visit ( FluentMessageExpression expression ) : void
BytecodeCompiler::Visit ( IEnumerable expressions ) : void
BytecodeCompiler::Visit ( InstanceVariableExpression expression ) : void
BytecodeCompiler::Visit ( MessageExpression expression ) : void
BytecodeCompiler::Visit ( MethodModel method ) : void
BytecodeCompiler::Visit ( PrimitiveExpression expression ) : void
BytecodeCompiler::Visit ( ReturnExpression expression ) : void
BytecodeCompiler::Visit ( SelfExpression expression ) : void
BytecodeCompiler::Visit ( SetExpression expression ) : void
BytecodeCompiler::Visit ( SymbolExpression expression ) : void
BytecodeCompiler::Visit ( VariableExpression expression ) : void

Usage Example

Пример #1
0
        public override void Visit(BlockExpression expression)
        {
            Block newblock = new Block(null, this.block);

            // TODO Review is the copy of argument and local names is needed
            foreach (var parname in this.block.ParameterNames)
                newblock.CompileArgument(parname);

            foreach (var locname in this.block.LocalNames)
                newblock.CompileLocal(locname);

            if (expression.ParameterNames != null)
                foreach (var parname in expression.ParameterNames)
                    newblock.CompileArgument(parname);

            if (expression.LocalVariables != null)
                foreach (var locname in expression.LocalVariables)
                    newblock.CompileLocal(locname);

            var compiler = new BytecodeCompiler(newblock);
            compiler.Visit(expression.Body);
            this.block.CompileGetBlock(newblock);
        }