UnityScript.Parser.UnityScriptParser.start C# (CSharp) Method

start() public method

public start ( CompileUnit cu ) : void
cu CompileUnit
return void
        public void start(CompileUnit cu)
        {
            IToken token = null;
            Module container = CodeFactory.NewModule(this.getFilename());
            cu.get_Modules().Add(container);
            Block b = container.get_Globals();
            try
            {
                bool flag2;
            Label_0026:
                switch (this.LA(1))
                {
                    case 0x16:
                        this.import_directive(container);
                        goto Label_0026;

                    case 0x39:
                    case 0x3a:
                        this.pragma_directive(container);
                        goto Label_0026;

                    default:
                    {
                        bool flag = false;
                        if ((this.LA(1) == 0x63) && (this.LA(2) == 0x3b))
                        {
                            int num2 = this.mark();
                            flag = true;
                            base.inputState.guessing++;
                            try
                            {
                                this.match(0x63);
                                this.match(0x3b);
                                this.match(0x3b);
                            }
                            catch (RecognitionException)
                            {
                                flag = false;
                            }
                            this.rewind(num2);
                            base.inputState.guessing--;
                        }
                        if (flag)
                        {
                            this.script_or_assembly_attribute(container);
                            goto Label_0026;
                        }
                        break;
                    }
                }
            Label_0109:
                flag2 = false;
                if ((this.LA(1) == 0x63) && (this.LA(2) == 0x3b))
                {
                    int num3 = this.mark();
                    flag2 = true;
                    base.inputState.guessing++;
                    try
                    {
                        this.match(0x63);
                        this.match(0x3b);
                        this.match(0x3b);
                    }
                    catch (RecognitionException)
                    {
                        flag2 = false;
                    }
                    this.rewind(num3);
                    base.inputState.guessing--;
                }
                if (flag2)
                {
                    this.script_or_assembly_attribute(container);
                    goto Label_0109;
                }
                if ((this.LA(1) == 0x63) && (this.LA(2) == 0x3b))
                {
                    this.attributes();
                    this.module_member(container);
                    goto Label_0109;
                }
                if (tokenSet_0_.member(this.LA(1)) && tokenSet_1_.member(this.LA(2)))
                {
                    this.module_member(container);
                    goto Label_0109;
                }
                if (tokenSet_2_.member(this.LA(1)) && tokenSet_3_.member(this.LA(2)))
                {
                    this.compound_or_single_stmt(b);
                    goto Label_0109;
                }
                token = this.LT(1);
                this.match(1);
                if (base.inputState.guessing == 0)
                {
                    SetEndSourceLocation(container, token);
                }
            }
            catch (RecognitionException exception3)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception3);
                this.recover(exception3, tokenSet_4_);
            }
        }
UnityScriptParser