Zeal.Compiler.Parser.ZealCpuDriver.Parse C# (CSharp) Method

Parse() public method

public Parse ( ) : void
return void
        public void Parse()
        {
            _rootTree = _parser.root();

            ParseTreeWalker walker = new ParseTreeWalker();
            walker.Walk(new ParseCpuPass(this), _rootTree);

            if (Errors.Count > 0)
            {
                throw new CompilerErrorException();
            }

            resolveLabels();
            verifyBranchLength();

            if (Errors.Count > 0)
            {
                throw new CompilerErrorException();
            }
        }

Usage Example

Example #1
0
        public void CartridgeNameExceptsAStringLiteral(string invalidCartridgeName)
        {
            const string inputTemplate = @"
            header
            {{
            CartridgeName = {0}
            }}

            vectors
            {{

            }}

            procedure Main
            {{
            sei
            clc
            xce
            }}
            ";
            string input = String.Format(inputTemplate, invalidCartridgeName);

            ZealCpuDriver driver = new ZealCpuDriver(input.ToMemoryStream());
            Assert.Throws<CompilerErrorException>(() => driver.Parse());
        }
All Usage Examples Of Zeal.Compiler.Parser.ZealCpuDriver::Parse