public ClassDefinition GetContextFieldDeclaration()
 {
     Field field;
     Field field2;
     ParameterDeclaration declaration;
     MemberReferenceExpression expression;
     ReferenceExpression expression2;
     BinaryExpression expression3;
     ReferenceExpression expression4;
     ReferenceExpression expression5;
     MemberReferenceExpression expression6;
     BinaryExpression expression7;
     Block block;
     Constructor constructor;
     ClassDefinition definition;
     Type type = this._evaluationContext.GetType();
     Type type2 = this._evaluationContext.ScriptContainer.GetType();
     ClassDefinition definition1 = definition = new ClassDefinition(LexicalInfo.Empty);
     definition.set_Name("_");
     TypeMember[] memberArray1 = new TypeMember[3];
     Field field1 = field = new Field(LexicalInfo.Empty);
     field.set_Modifiers(40);
     field.set_Name("ScriptContainer");
     field.set_Type(TypeReference.Lift(type2));
     field.set_IsVolatile(false);
     memberArray1[0] = field;
     Field field3 = field2 = new Field(LexicalInfo.Empty);
     field2.set_Name("EvaluationContext");
     field2.set_Type(TypeReference.Lift(type));
     field2.set_IsVolatile(false);
     memberArray1[1] = field2;
     Constructor constructor1 = constructor = new Constructor(LexicalInfo.Empty);
     constructor.set_Name("constructor");
     ParameterDeclaration[] declarationArray1 = new ParameterDeclaration[1];
     ParameterDeclaration declaration1 = declaration = new ParameterDeclaration(LexicalInfo.Empty);
     declaration.set_Name("context");
     declaration.set_Type(TypeReference.Lift(type));
     declarationArray1[0] = declaration;
     constructor.set_Parameters(ParameterDeclarationCollection.FromArray(false, declarationArray1));
     Block block1 = block = new Block(LexicalInfo.Empty);
     Statement[] statementArray1 = new Statement[2];
     BinaryExpression expression1 = expression3 = new BinaryExpression(LexicalInfo.Empty);
     expression3.set_Operator(15);
     MemberReferenceExpression expression14 = expression = new MemberReferenceExpression(LexicalInfo.Empty);
     expression.set_Name("EvaluationContext");
     expression.set_Target(new SelfLiteralExpression(LexicalInfo.Empty));
     expression3.set_Left(expression);
     ReferenceExpression expression15 = expression2 = new ReferenceExpression(LexicalInfo.Empty);
     expression2.set_Name("context");
     expression3.set_Right(expression2);
     statementArray1[0] = Statement.Lift(expression3);
     BinaryExpression expression16 = expression7 = new BinaryExpression(LexicalInfo.Empty);
     expression7.set_Operator(15);
     ReferenceExpression expression17 = expression4 = new ReferenceExpression(LexicalInfo.Empty);
     expression4.set_Name("ScriptContainer");
     expression7.set_Left(expression4);
     MemberReferenceExpression expression18 = expression6 = new MemberReferenceExpression(LexicalInfo.Empty);
     expression6.set_Name("ScriptContainer");
     ReferenceExpression expression19 = expression5 = new ReferenceExpression(LexicalInfo.Empty);
     expression5.set_Name("context");
     expression6.set_Target(expression5);
     expression7.set_Right(expression6);
     statementArray1[1] = Statement.Lift(expression7);
     block.set_Statements(StatementCollection.FromArray(statementArray1));
     constructor.set_Body(block);
     memberArray1[2] = constructor;
     definition.set_Members(TypeMemberCollection.FromArray(memberArray1));
     return definition;
 }
        public TypeMember class_declaration(TypeDefinition parent)
        {
            TypeMember member = null;
            IToken token = null;
            IToken token2 = null;
            IToken token3 = null;
            try
            {
                TypeReference reference;
                ClassDefinition definition2;
                TypeReferenceCollection references;
                switch (this.LA(1))
                {
                    case 0x23:
                        token = this.LT(1);
                        this.match(0x23);
                        break;

                    case 8:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                this.match(8);
                token2 = this.LT(1);
                this.match(0x3b);
                switch (this.LA(1))
                {
                    case 14:
                        this.match(14);
                        reference = this.type_reference();
                        break;

                    case 0x17:
                    case 0x3d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                if (base.inputState.guessing == 0)
                {
                    ClassDefinition definition;
                    ClassDefinition definition1 = definition = new ClassDefinition(ToLexicalInfo(token2));
                    definition.set_Name(token2.getText());
                    member = definition2 = definition;
                    references = definition2.get_BaseTypes();
                    if (reference != null)
                    {
                        references.Add(reference);
                    }
                    if (token != null)
                    {
                        definition2.set_Modifiers(definition2.get_Modifiers() | 0x400);
                    }
                    this.FlushAttributes(definition2);
                    parent.get_Members().Add(definition2);
                }
                switch (this.LA(1))
                {
                    case 0x17:
                        this.match(0x17);
                        this.type_reference_list(references);
                        break;

                    case 0x3d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                if (base.inputState.guessing == 0)
                {
                    foreach (TypeReference reference2 in references)
                    {
                        if (reference2 == reference)
                        {
                            BaseTypeAnnotations.AnnotateExtends(reference2);
                        }
                        else
                        {
                            BaseTypeAnnotations.AnnotateImplements(reference2);
                        }
                    }
                }
                this.match(0x3d);
                while (true)
                {
                    TypeMemberModifiers modifiers;
                    TypeMember member2;
                    if (!tokenSet_29_.member(this.LA(1)))
                    {
                        break;
                    }
                    if (base.inputState.guessing == 0)
                    {
                        modifiers = 0;
                    }
                    switch (this.LA(1))
                    {
                        case 0x63:
                            this.attributes();
                            break;

                        case 8:
                        case 13:
                        case 0x10:
                        case 0x13:
                        case 0x19:
                        case 0x1b:
                        case 0x1f:
                        case 0x20:
                        case 0x21:
                        case 0x22:
                        case 0x23:
                        case 0x24:
                        case 0x26:
                        case 0x2d:
                        case 0x2e:
                            break;

                        default:
                            throw new NoViableAltException(this.LT(1), this.getFilename());
                    }
                    if (tokenSet_30_.member(this.LA(1)) && tokenSet_31_.member(this.LA(2)))
                    {
                        modifiers = this.member_modifiers();
                    }
                    else if (!tokenSet_26_.member(this.LA(1)) || !tokenSet_32_.member(this.LA(2)))
                    {
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                    }
                    int num = this.LA(1);
                    switch (num)
                    {
                        case 0x13:
                            member2 = this.function_member(definition2);
                            break;

                        case 0x2d:
                            member2 = this.field_member(definition2);
                            break;

                        case 13:
                            member2 = this.enum_declaration(definition2);
                            break;

                        case 8:
                        case 0x23:
                            member2 = this.class_declaration(definition2);
                            break;

                        default:
                            if (num != 0x19)
                            {
                                throw new NoViableAltException(this.LT(1), this.getFilename());
                            }
                            member2 = this.interface_declaration(definition2);
                            break;
                    }
                    if ((base.inputState.guessing == 0) && (member2 != null))
                    {
                        member2.set_Modifiers(member2.get_Modifiers() | modifiers);
                    }
                }
                token3 = this.LT(1);
                this.match(0x3e);
                if (base.inputState.guessing == 0)
                {
                    SetEndSourceLocation(definition2, token3);
                }
                while ((this.LA(1) == 0x4d) && tokenSet_33_.member(this.LA(2)))
                {
                    this.match(0x4d);
                }
                return member;
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_33_);
                return member;
            }
            return member;
        }