| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. | 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 #ifndef CSSTokenizer_h | 23 #ifndef CSSTokenizer_h |
| 24 #define CSSTokenizer_h | 24 #define CSSTokenizer_h |
| 25 | 25 |
| 26 #include "wtf/Noncopyable.h" | 26 #include "wtf/Noncopyable.h" |
| 27 #include "wtf/OwnPtr.h" | 27 #include "wtf/OwnPtr.h" |
| 28 #include "wtf/text/WTFString.h" | 28 #include "wtf/text/WTFString.h" |
| 29 | 29 |
| 30 namespace WebCore { | 30 namespace WebCore { |
| 31 | 31 |
| 32 class CSSParser; | 32 class BisonCSSParser; |
| 33 struct CSSParserLocation; | 33 struct CSSParserLocation; |
| 34 struct CSSParserString; | 34 struct CSSParserString; |
| 35 | 35 |
| 36 class CSSTokenizer { | 36 class CSSTokenizer { |
| 37 WTF_MAKE_NONCOPYABLE(CSSTokenizer); | 37 WTF_MAKE_NONCOPYABLE(CSSTokenizer); |
| 38 public: | 38 public: |
| 39 // FIXME: This should not be needed but there are still some ties between th
e 2 classes. | 39 // FIXME: This should not be needed but there are still some ties between th
e 2 classes. |
| 40 friend class CSSParser; | 40 friend class BisonCSSParser; |
| 41 | 41 |
| 42 CSSTokenizer(CSSParser& parser) | 42 CSSTokenizer(BisonCSSParser& parser) |
| 43 : m_parser(parser) | 43 : m_parser(parser) |
| 44 , m_parsedTextPrefixLength(0) | 44 , m_parsedTextPrefixLength(0) |
| 45 , m_parsedTextSuffixLength(0) | 45 , m_parsedTextSuffixLength(0) |
| 46 , m_parsingMode(NormalMode) | 46 , m_parsingMode(NormalMode) |
| 47 , m_is8BitSource(false) | 47 , m_is8BitSource(false) |
| 48 , m_length(0) | 48 , m_length(0) |
| 49 , m_token(0) | 49 , m_token(0) |
| 50 , m_lineNumber(0) | 50 , m_lineNumber(0) |
| 51 , m_tokenStartLineNumber(0) | 51 , m_tokenStartLineNumber(0) |
| 52 , m_internal(true) | 52 , m_internal(true) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 template <typename CharacterType> | 132 template <typename CharacterType> |
| 133 inline void detectAtToken(int, bool); | 133 inline void detectAtToken(int, bool); |
| 134 template <typename CharacterType> | 134 template <typename CharacterType> |
| 135 inline void detectSupportsToken(int); | 135 inline void detectSupportsToken(int); |
| 136 template <typename CharacterType> | 136 template <typename CharacterType> |
| 137 inline void detectCSSVariableDefinitionToken(int); | 137 inline void detectCSSVariableDefinitionToken(int); |
| 138 | 138 |
| 139 template <typename SourceCharacterType> | 139 template <typename SourceCharacterType> |
| 140 int realLex(void* yylval); | 140 int realLex(void* yylval); |
| 141 | 141 |
| 142 CSSParser& m_parser; | 142 BisonCSSParser& m_parser; |
| 143 | 143 |
| 144 size_t m_parsedTextPrefixLength; | 144 size_t m_parsedTextPrefixLength; |
| 145 size_t m_parsedTextSuffixLength; | 145 size_t m_parsedTextSuffixLength; |
| 146 | 146 |
| 147 enum ParsingMode { | 147 enum ParsingMode { |
| 148 NormalMode, | 148 NormalMode, |
| 149 MediaQueryMode, | 149 MediaQueryMode, |
| 150 SupportsMode, | 150 SupportsMode, |
| 151 NthChildMode | 151 NthChildMode |
| 152 }; | 152 }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 template <> | 189 template <> |
| 190 inline UChar* CSSTokenizer::tokenStart<UChar>() | 190 inline UChar* CSSTokenizer::tokenStart<UChar>() |
| 191 { | 191 { |
| 192 return m_tokenStart.ptr16; | 192 return m_tokenStart.ptr16; |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace WebCore | 195 } // namespace WebCore |
| 196 | 196 |
| 197 #endif // CSSTokenizer_h | 197 #endif // CSSTokenizer_h |
| OLD | NEW |