lexical analyzer class recognizes tokens as groups of characters separated by arbitrary amounts of whitespace also classifies tokens according to type
            // ---------------------------------------------------------------------
            //
            // Constructors
            //
            // ---------------------------------------------------------------------

            #region Constructors

            /// <summary>
            /// Constructor. Initializes the _htmlLexicalAnalayzer element with the given input string
            /// </summary>
            /// <param name="inputString">
            /// string to parsed into well-formed Html
            /// </param>
            private HtmlParser(string inputString)
            {
                // Create an output xml document
                _document = new XmlDocument();

                // initialize open tag stack
                _openedElements = new Stack <XmlElement>();

                _pendingInlineElements = new Stack <XmlElement>();

                // initialize lexical analyzer
                _htmlLexicalAnalyzer = new HtmlLexicalAnalyzer(inputString);

                // get first token from input, expecting text
                _htmlLexicalAnalyzer.GetNextContentToken();
            }
Пример #2
0
    // ---------------------------------------------------------------------
    //
    // Constructors
    //
    // ---------------------------------------------------------------------

    #region Constructors

    /// <summary>
    /// Constructor. Initializes the _htmlLexicalAnalayzer element with the given input string
    /// </summary>
    /// <param name="inputString">
    /// string to parsed into well-formed Html
    /// </param>
    private HtmlParser(string inputString)
    {
        // Create an output xml document
        _document = new XmlDocument();

        // initialize open tag stack
        _openedElements = new Stack<XmlElement>();

        _pendingInlineElements = new Stack<XmlElement>();

        // initialize lexical analyzer
        _htmlLexicalAnalyzer = new HtmlLexicalAnalyzer(inputString);

        // get first token from input, expecting text
        _htmlLexicalAnalyzer.GetNextContentToken();
    }
Пример #3
0
        private void Dispose(bool disposing)
        {
            if (!disposing)
            {
                isDisposing = true;

                if (this._htmlLexicalAnalyzer != null)
                {
                    this._htmlLexicalAnalyzer.Dispose();
                    this._htmlLexicalAnalyzer = null;
                }
            }
        }