public AspNetSpeculativeExpressionState(
     AspNetServerCommentState commentState,
     AspNetExpressionState expressionState)
 {
     this.CommentState    = commentState;
     this.ExpressionState = expressionState;
     Adopt(commentState);
     Adopt(expressionState);
 }
		public AspNetSpeculativeExpressionState (
			AspNetServerCommentState commentState,
			AspNetExpressionState expressionState)
		{
			this.CommentState = commentState;
			this.ExpressionState = expressionState;
			Adopt (commentState);
			Adopt (expressionState);
		}
Beispiel #3
0
 public AspNetAttributeValueState(
     AspNetServerCommentState commentState,
     AspNetExpressionState expressionState)
 {
     this.CommentState    = commentState;
     this.ExpressionState = expressionState;
     Adopt(commentState);
     Adopt(expressionState);
 }
		public AspNetAttributeValueState(
			AspNetServerCommentState commentState,
			AspNetExpressionState expressionState)
		{
			this.CommentState = commentState;
			this.ExpressionState = expressionState;
			Adopt (commentState);
			Adopt (expressionState);
		}
Beispiel #5
0
        public AspNetFreeState(
            HtmlTagState tagState,
            HtmlClosingTagState closingTagState,
            XmlCommentState commentState,
            XmlCDataState cDataState,
            XmlDocTypeState docTypeState,
            XmlProcessingInstructionState processingInstructionState,
            AspNetExpressionState expressionState,
            AspNetDirectiveState directiveState,
            AspNetServerCommentState serverCommentState
            )
            : base(tagState, closingTagState, commentState, cDataState, docTypeState, processingInstructionState)
        {
            this.expressionState    = expressionState;
            this.directiveState     = directiveState;
            this.serverCommentState = serverCommentState;

            Adopt(this.ExpressionState);
            Adopt(this.DirectiveState);
            Adopt(this.ServerCommentState);
        }
		public AspNetFreeState (
			HtmlTagState tagState,
			HtmlClosingTagState closingTagState,
			XmlCommentState commentState,
			XmlCDataState cDataState,
			XmlDocTypeState docTypeState,
		        XmlProcessingInstructionState processingInstructionState,
			AspNetExpressionState expressionState,
			AspNetDirectiveState directiveState,
			AspNetServerCommentState serverCommentState
			)
			: base (tagState, closingTagState, commentState, cDataState, docTypeState, processingInstructionState)
		{
			this.expressionState = expressionState;
			this.directiveState = directiveState;
			this.serverCommentState = serverCommentState;
			
			Adopt (this.ExpressionState);
			Adopt (this.DirectiveState);
			Adopt (this.ServerCommentState);
		}
Beispiel #7
0
        public override State PushChar(char c, IParseContext context, ref string rollback)
        {
            var maskedTag = (AttState)((context.StateTag & TagMask) >> XmlAttributeValueState.TagShift);

            switch (maskedTag)
            {
            case AttState.Incoming:
                if (c == '<')
                {
                    SetTag(context, AttState.Bracket);
                    return(null);
                }
                return(base.PushChar(c, context, ref rollback));

            case AttState.Bracket:
                if (c == '%')
                {
                    SetTag(context, AttState.Percent);
                    return(null);
                }
                rollback = "<";
                return(Parent);

            case AttState.Percent:
                if (c == '-')
                {
                    SetTag(context, AttState.PercentDash);
                    return(null);
                }
                if (c == '@')
                {
                    context.LogError("Invalid directive location");
                    rollback = "<%";
                    return(Parent);
                }
                AspNetExpressionState.AddExpressionNode(c, context);
                SetTag(context, AttState.Expression);
                return(null);

            case AttState.PercentDash:
                if (c == '-')
                {
                    context.Nodes.Push(new AspNetServerComment(context.LocationMinus(4)));
                    SetTag(context, AttState.Comment);
                    return(null);
                }
                context.LogError("Malformed server comment");
                rollback = "<%-";
                return(Parent);

            case AttState.Expression:
                if (c == '%')
                {
                    SetTag(context, AttState.EndPercent);
                }
                return(null);

            case AttState.EndPercent:
                if (c == '>')
                {
                    //TODO: attach nodes
                    var n = context.Nodes.Pop();
                    n.End(context.Location);
                    SetTag(context, AttState.Incoming);
                    //ensure attribute get closed if value is unquoted
                    var baseState = (context.StateTag & XmlAttributeValueState.TagMask);
                    if (baseState == FREE || baseState == UNQUOTED)
                    {
                        var att = (XAttribute)context.Nodes.Peek();
                        att.Value = "";
                        return(Parent);
                    }
                    return(null);
                }
                SetTag(context, AttState.Expression);
                return(null);

            case AttState.Comment:
                if (c == '-')
                {
                    SetTag(context, AttState.EndDash);
                }
                return(null);

            case AttState.EndDash:
                if (c == '-')
                {
                    SetTag(context, AttState.EndDashDash);
                }
                else
                {
                    SetTag(context, AttState.Comment);
                }
                return(null);

            case AttState.EndDashDash:
                if (c == '%')
                {
                    SetTag(context, AttState.EndDashDashPercent);
                }
                else if (c != '-')
                {
                    SetTag(context, AttState.Comment);
                }
                return(null);

            case AttState.EndDashDashPercent:
                if (c == '>')
                {
                    //TODO: attach nodes
                    var n = context.Nodes.Pop();
                    n.End(context.Location);
                    SetTag(context, AttState.Incoming);
                    return(null);
                }
                SetTag(context, AttState.Comment);
                return(null);

            default:
                return(base.PushChar(c, context, ref rollback));
            }
        }