AjTalk.Compiler.Parser.CompileBlock C# (CSharp) Method

CompileBlock() public method

public CompileBlock ( ) : Block
return AjTalk.Language.Block
        public Block CompileBlock()
        {
            this.block = new Block(this.source, this.outer);
            this.CompileBlockArguments();
            this.CompileLocals();

            // TODO review why to use this.locals instead of this.block.CompileLocal directly
            foreach (string argname in this.arguments)
                this.block.CompileArgument(argname);

            foreach (string locname in this.locals)
                this.block.CompileLocal(locname);

            this.CompileBody();

            return this.block;
        }

Usage Example

Beispiel #1
0
 protected override object Evaluate(string text, Machine machine)
 {
     Parser parser = new Parser(text);
     Block block = parser.CompileBlock();
     Process process = new Process(block, null, machine);
     return process.Execute();
 }
All Usage Examples Of AjTalk.Compiler.Parser::CompileBlock