15 #ifndef PAGESPEED_KERNEL_JS_JS_TOKENIZER_H_
16 #define PAGESPEED_KERNEL_JS_JS_TOKENIZER_H_
32 struct JsTokenizerPatterns;
113 kJsonOpenBraceStringLiteral,
141 bool TryConsumeComment(
143 bool TryConsumeIdentifierOrKeyword(
145 bool TryConsumeWhitespace(
146 bool allow_semicolon_insertion,
158 StringPiece* token_out);
161 void PushBlockHeader();
162 void PushExpression();
170 bool TryInsertLinebreakSemicolon();
174 static bool CanPreceedObjectLiteral(ParseState state);
176 const JsTokenizerPatterns* patterns_;
177 std::vector<ParseState> parse_stack_;
178 std::deque<std::pair<JsKeywords::Type, StringPiece> > lookahead_queue_;
199 const RE2 identifier_pattern;
200 const RE2 line_comment_pattern;
201 const RE2 numeric_literal_pattern;
202 const RE2 operator_pattern;
203 const RE2 regex_literal_pattern;
204 const RE2 string_literal_pattern;
205 const RE2 whitespace_pattern;
206 const RE2 line_continuation_pattern;
GoogleString ParseStackForTest() const
Return a string representing the current parse stack, for testing only.
JsTokenizer(const JsTokenizerPatterns *patterns, StringPiece input)
bool has_error() const
Definition: js_tokenizer.h:79
Type
Definition: js_keywords.h:33
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: js_tokenizer.h:194
Definition: js_tokenizer.h:62
JsKeywords::Type NextToken(StringPiece *token_out)