protected virtual void ModelDirective()
        {
            this.AssertDirective("model");

            this.AcceptAndMoveNext();

            var endModelLocation = this.CurrentLocation;

            this.BaseTypeDirective("The 'model' keyword must be followed by a type name on the same line.", s =>
            {
                var symbols   = this.Language.TokenizeString(s);
                var modelType = this.clrTypeResolver.Resolve(symbols.ToList());

                if (modelType == null)
                {
                    CodeParserHelper.ThrowTypeNotFound(this.razorAssemblyProvider, s);
                }

                return(new ModelCodeGenerator(modelType, modelType.FullName));
            });

            if (this.modelStatementFound)
            {
                this.Context.OnError(endModelLocation, string.Format(CultureInfo.CurrentCulture, "Cannot have more than one @model statement."));
            }

            this.modelStatementFound = true;
            this.CheckForInheritsAndModelStatements();
        }
        protected virtual bool ModelTypeDirective()
        {
            this.AssertDirective(ModelTypeKeyword);

            this.Span.CodeGenerator        = SpanCodeGenerator.Null;
            this.Context.CurrentBlock.Type = BlockType.Directive;
            this.AcceptAndMoveNext();

            var endModelLocation = CurrentLocation;

            if (At(VBSymbolType.WhiteSpace))
            {
                Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None;
            }

            this.AcceptWhile(VBSymbolType.WhiteSpace);
            this.Output(SpanKind.MetaCode);

            if (this.modelStatementFound)
            {
                this.Context.OnError(endModelLocation, string.Format(CultureInfo.CurrentCulture, "Cannot have more than one @model statement."));
            }
            this.modelStatementFound = true;

            if (this.EndOfFile || At(VBSymbolType.WhiteSpace) || At(VBSymbolType.NewLine))
            {
                this.Context.OnError(endModelLocation, "The 'model' keyword must be followed by a type name on the same line.", ModelTypeKeyword);
            }

            AcceptUntil(VBSymbolType.NewLine);
            if (!Context.DesignTimeMode)
            {
                this.Optional(VBSymbolType.NewLine);
            }

            var baseType = string.Concat(Span.Symbols.Select(s => s.Content)).Trim();

            var modelType = this.clrTypeResolver.Resolve(this.Language.TokenizeString(baseType).ToList());

            if (modelType == null)
            {
                CodeParserHelper.ThrowTypeNotFound(baseType);
            }

            this.Span.CodeGenerator = new ModelCodeGenerator(modelType, modelType.FullName);

            this.CheckForInheritsAndModelStatements();

            this.Output(SpanKind.Code);

            return(false);
        }