Exemplo n.º 1
0
        /// <summary>
        /// Parser for MidText
        /// </summary>
        /// <returns>Parsed MidText</returns>
        public MidText ParseMidText()
        {
            MidText midText = new MidText();

            //Skip > token
            NextToken(">", "> TextChar* <", '>');

            //Parse text
            midText.SetText(ParseTextChars());

            //Skip < token
            NextToken("<", "> TextChar* <", '<');

            return(midText);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parser for TextTail
        /// </summary>
        /// <returns>Parsed TextTail</returns>
        public TextTail ParseTextTail()
        {
            TextTail textTail = null;

            //Skip > token
            NextToken(">", "> embedding tailsymbol", '>');

            //Parse text first to make type determination possible
            String parsedText = ParseTextChars();

            //Determine TextTail type
            if (EmbeddingTokenStream.HasNext() && EmbeddingTokenStream.Peek(1).GetValue().ToString() == "\"")
            {   //PostTextTail
                //Set PostText
                PostText postText = new PostText();
                postText.SetText(parsedText);

                //Create PostTextTail and fill it
                PostTextTail postTextTail = new PostTextTail();
                postTextTail.SetPostText(postText);

                //Skip Closing "
                NextToken("\"", "\"", '\"');

                textTail = postTextTail;
            }
            else
            {   //MidTextTail
                //Skip closing < tag of PreText
                NextToken("<", "< closing PreText", '<');

                //Set MidText
                MidText midText = new MidText();
                midText.SetText(parsedText);

                //Create MidTextTail object and fill it
                MidTextTail midTextTail = new MidTextTail();
                midTextTail.SetMidText(midText);
                midTextTail.SetEmbed(ParseEmbed());
                midTextTail.SetTextTail(ParseTextTail());

                textTail = midTextTail;
            }

            return(textTail);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Parser for TextTail
        /// </summary>
        /// <returns>Parsed TextTail</returns>
        public TextTail ParseTextTail()
        {
            TextTail textTail = null;

            //Skip > token
            NextToken(">", "> embedding tailsymbol", '>');

            //Parse text first to make type determination possible
            String parsedText = ParseTextChars();

            //Determine TextTail type
            if (EmbeddingTokenStream.HasNext() && EmbeddingTokenStream.Peek(1).GetValue().ToString() == "\"")
            {   //PostTextTail

                //Set PostText
                PostText postText = new PostText();
                postText.SetText(parsedText);

                //Create PostTextTail and fill it
                PostTextTail postTextTail = new PostTextTail();
                postTextTail.SetPostText(postText);

                //Skip Closing "
                NextToken("\"", "\"", '\"');

                textTail = postTextTail;
            }
            else
            {   //MidTextTail

                //Skip closing < tag of PreText
                NextToken("<", "< closing PreText", '<');

                //Set MidText
                MidText midText = new MidText();
                midText.SetText(parsedText);

                //Create MidTextTail object and fill it
                MidTextTail midTextTail = new MidTextTail();
                midTextTail.SetMidText(midText);
                midTextTail.SetEmbed(ParseEmbed());
                midTextTail.SetTextTail(ParseTextTail());

                textTail = midTextTail;
            }

            return textTail;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Parser for MidText
        /// </summary>
        /// <returns>Parsed MidText</returns>
        public MidText ParseMidText()
        {
            MidText midText = new MidText();

            //Skip > token
            NextToken(">", "> TextChar* <", '>');

            //Parse text
            midText.SetText(ParseTextChars());

            //Skip < token
            NextToken("<", "> TextChar* <", '<');

            return midText;
        }