コード例 #1
0
ファイル: VmCompiler.cs プロジェクト: ajlopez/AjTalk
 public Block CompileBlock(string text)
 {
     ModelParser parser = new ModelParser(text);
     var expr = parser.ParseBlock();
     Block block = new Block(text);
     BytecodeCompiler compiler = new BytecodeCompiler(block);
     compiler.CompileExpression(expr);
     return block;
 }
コード例 #2
0
        public void CompileExpressions()
        {
            IList<ExpressionResult> results = ExpressionResult.LoadExpressionResults("Expressions.txt");

            foreach (var result in results)
            {
                ModelParser parser = new ModelParser(result.Text);
                Block block = new Block();
                BytecodeCompiler compiler = new BytecodeCompiler(block);
                compiler.CompileExpression(parser.ParseExpression());
                result.ValidateBlock(block);
            }
        }