parser/htmlparser/src/nsHTMLTokenizer.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/htmlparser/src/nsHTMLTokenizer.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=2 et tw=78: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +
    1.11 +/**
    1.12 + * @file nsHTMLTokenizer.cpp
    1.13 + * This is an implementation of the nsITokenizer interface.
    1.14 + * This file contains the implementation of a tokenizer to tokenize an HTML
    1.15 + * document. It attempts to do so, making tradeoffs between compatibility with
    1.16 + * older parsers and the SGML specification. Note that most of the real
    1.17 + * "tokenization" takes place in nsHTMLTokens.cpp.
    1.18 + */
    1.19 +
    1.20 +#include "nsHTMLTokenizer.h"
    1.21 +#include "nsIParser.h"
    1.22 +#include "nsParserConstants.h"
    1.23 +
    1.24 +/************************************************************************
    1.25 +  And now for the main class -- nsHTMLTokenizer...
    1.26 + ************************************************************************/
    1.27 +
    1.28 +/**
    1.29 + * Satisfy the nsISupports interface.
    1.30 + */
    1.31 +NS_IMPL_ISUPPORTS(nsHTMLTokenizer, nsITokenizer)
    1.32 +
    1.33 +/**
    1.34 + * Default constructor
    1.35 + */
    1.36 +nsHTMLTokenizer::nsHTMLTokenizer()
    1.37 +{
    1.38 +  // TODO Assert about:blank-ness.
    1.39 +}
    1.40 +
    1.41 +nsresult
    1.42 +nsHTMLTokenizer::WillTokenize(bool aIsFinalChunk)
    1.43 +{
    1.44 +  return NS_OK;
    1.45 +}
    1.46 +
    1.47 +/**
    1.48 + * This method is repeatedly called by the tokenizer. 
    1.49 + * Each time, we determine the kind of token we're about to 
    1.50 + * read, and then we call the appropriate method to handle
    1.51 + * that token type.
    1.52 + *  
    1.53 + * @param  aScanner The source of our input.
    1.54 + * @param  aFlushTokens An OUT parameter to tell the caller whether it should
    1.55 + *                      process our queued tokens up to now (e.g., when we
    1.56 + *                      reach a <script>).
    1.57 + * @return Success or error
    1.58 + */
    1.59 +nsresult
    1.60 +nsHTMLTokenizer::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens)
    1.61 +{
    1.62 +  return kEOF;
    1.63 +}

mercurial