示例#1
0
        void Compile(TextReader reader, ILGenerator generator)
        {
            // Instantiate a parser.
            var p = new Parser(Context, reader);

            // Parse the code.
            p.Parse();

            // Optimize it.
            p.Optimize();

            // Do the naiive .net compiler pass.
            // This compiler phase is "naiive" because it doesn't do any type checking,
            //   it just uses dynamic values and instance variables.
            var t = new NaiveDotNetTraverser(this, generator);

            t.BeginMethod();
            p.Pass(t);
            t.EndMethod(false);
        }
        void Compile(TextReader reader, ILGenerator generator)
        {
            // Instantiate a parser.
            var p = new Parser(Context, reader);

            // Parse the code.
            p.Parse();

            // Optimize it.
            p.Optimize();

            // Do the naiive .net compiler pass.
            // This compiler phase is "naiive" because it doesn't do any type checking,
            //   it just uses dynamic values and instance variables.
            var t = new NaiveDotNetTraverser(this, generator);

            t.BeginMethod();
            p.Pass(t);
            t.EndMethod(false);
        }