#define YY_EXTRA_TYPE CYDriver *
#define F(value, highlight) do { \
#define YY_EXTRA_TYPE CYDriver *
#define F(value, highlight) do { \
#define I(type, Type, value, highlight) do { \
yylval->semantic_.type ## _ = A CY ## Type; \
#define I(type, Type, value, highlight) do { \
yylval->semantic_.type ## _ = A CY ## Type; \
yyextra->last_ = false; \
F(tk::NewLine, hi::Nothing); \
}
yyextra->last_ = false; \
F(tk::NewLine, hi::Nothing); \
}
#define L yylloc->step(); R
#define H(value, highlight) do { \
#define L yylloc->step(); R
#define H(value, highlight) do { \
UnicodeStart {IdentifierMore}|{UnicodeIDStart}
UnicodePart {IdentifierMore}|\xe2\x80[\x8c\x8d]|{UnicodeIDContinue}
UnicodeStart {IdentifierMore}|{UnicodeIDStart}
UnicodePart {IdentifierMore}|\xe2\x80[\x8c\x8d]|{UnicodeIDContinue}
-UnicodeFail {U2}|{U3}|{U3}{U0}|{U4}|{U4}{U0}|{U4}{U0}{U0}|{UN}|{U0}
-UnicodeScrap {UnicodePart}*{UnicodeFail}?
+UnicodeScrap {U2}|{U3}{U0}{0,1}|{U4}{U0}{0,2}|{UN}|{U0}
+UnicodeError ({U2}|{U3}{U0}{0,1}|{U4}{U0}{0,2}){UE}|{UN}|{U0}
IdentifierScrap {IdentifierPart}*{IdentifierFail}?
RegularExpressionBackslashSequence \\{NoneTerminatorCharacter}
IdentifierScrap {IdentifierPart}*{IdentifierFail}?
RegularExpressionBackslashSequence \\{NoneTerminatorCharacter}
<RegularExpression>{
\/{UnicodePart}* R CYLexBufferUnits(yytext, yyleng); CYLexBufferEnd(literal, RegEx, tk::RegularExpressionLiteral, hi::Constant);
<RegularExpression>{
\/{UnicodePart}* R CYLexBufferUnits(yytext, yyleng); CYLexBufferEnd(literal, RegEx, tk::RegularExpressionLiteral, hi::Constant);
- \\{UnicodeFail}? R E("invalid escape")
+ \\ R E("invalid escape")
+
+ (\\|{RegExCharacter}+)?{LineTerminatorSequence} R E("invalid newline");
+ (\\|{RegExCharacter}+)?{UnicodeScrap} R E("invalid character");
"["{RegularExpressionClassChars}"]" R CYLexBufferUnits(yytext, yyleng);
"["{RegularExpressionClassChars}\\? R E("invalid class");
"["{RegularExpressionClassChars}"]" R CYLexBufferUnits(yytext, yyleng);
"["{RegularExpressionClassChars}\\? R E("invalid class");
-#![^\n]* L M
-\/\/[^\n]* L M
+ /* XXX: maybe fold LineTerminatorSequence into these definitions */
+#!{NoneTerminatorCharacter}* L M
+\/\/{NoneTerminatorCharacter}* L M
+(#!|\/\/){NoneTerminatorCharacter}*{UnicodeError} L E("invalid character");
\/\* L yy_push_state(MultiLine, yyscanner);
<MultiLine>{
\**\*\/ R yy_pop_state(yyscanner); M N
\/\* L yy_push_state(MultiLine, yyscanner);
<MultiLine>{
\**\*\/ R yy_pop_state(yyscanner); M N
"=" L F(tk::Equal, hi::Operator);
"==" L F(tk::EqualEqual, hi::Operator);
"===" L F(tk::EqualEqualEqual, hi::Operator);
"=" L F(tk::Equal, hi::Operator);
"==" L F(tk::EqualEqual, hi::Operator);
"===" L F(tk::EqualEqualEqual, hi::Operator);
"!" L F(tk::Exclamation, hi::Operator);
"!=" L F(tk::ExclamationEqual, hi::Operator);
"!==" L F(tk::ExclamationEqualEqual, hi::Operator);
"-" L F(tk::Hyphen, hi::Operator);
"-=" L F(tk::HyphenEqual, hi::Operator);
"!" L F(tk::Exclamation, hi::Operator);
"!=" L F(tk::ExclamationEqual, hi::Operator);
"!==" L F(tk::ExclamationEqualEqual, hi::Operator);
"-" L F(tk::Hyphen, hi::Operator);
"-=" L F(tk::HyphenEqual, hi::Operator);
"->" L F(tk::HyphenRight, hi::Operator);
"<" L F(tk::Left, hi::Operator);
"<=" L F(tk::LeftEqual, hi::Operator);
"->" L F(tk::HyphenRight, hi::Operator);
"<" L F(tk::Left, hi::Operator);
"<=" L F(tk::LeftEqual, hi::Operator);
"||" L F(tk::PipePipe, hi::Operator);
"+" L F(tk::Plus, hi::Operator);
"+=" L F(tk::PlusEqual, hi::Operator);
"||" L F(tk::PipePipe, hi::Operator);
"+" L F(tk::Plus, hi::Operator);
"+=" L F(tk::PlusEqual, hi::Operator);
">" L F(tk::Right, hi::Operator);
">=" L F(tk::RightEqual, hi::Operator);
">>" L F(tk::RightRight, hi::Operator);
">" L F(tk::Right, hi::Operator);
">=" L F(tk::RightEqual, hi::Operator);
">>" L F(tk::RightRight, hi::Operator);
"*=" L F(tk::StarEqual, hi::Operator);
"~" L F(tk::Tilde, hi::Operator);
"*=" L F(tk::StarEqual, hi::Operator);
"~" L F(tk::Tilde, hi::Operator);
-<Div,DivOrTemplateTail>"/" L F(tk::Slash, hi::Operator);
-<Div,DivOrTemplateTail>"/=" L F(tk::SlashEqual, hi::Operator);
+"/" L F(tk::Slash, hi::Operator);
+"/=" L F(tk::SlashEqual, hi::Operator);
":" L F(tk::Colon, hi::Structure);
"," L F(tk::Comma, hi::Structure);
":" L F(tk::Colon, hi::Structure);
"," L F(tk::Comma, hi::Structure);
"(" L F(tk::OpenParen, hi::Structure);
")" L F(tk::CloseParen, hi::Structure);
"(" L F(tk::OpenParen, hi::Structure);
")" L F(tk::CloseParen, hi::Structure);
-"{" L yyextra->template_.push(false); F(yyextra->newline_ ? tk::OpenBrace_ : tk::OpenBrace, hi::Structure);
-<Div,RegExp>"}" L S(template_); F(tk::CloseBrace, hi::Structure);
+"{" L yyextra->template_.push(false); F(tk::OpenBrace, hi::Structure);
+<Div>"}" L S(template_); F(tk::CloseBrace, hi::Structure);
"[" L F(tk::OpenBracket, hi::Structure);
"]" L F(tk::CloseBracket, hi::Structure);
"[" L F(tk::OpenBracket, hi::Structure);
"]" L F(tk::CloseBracket, hi::Structure);
"enum" L /*FFF*/ F(tk::_enum_, hi::Meta);
"export" L /*FFK*/ F(tk::_export_, hi::Meta);
"extends" L /*FFK*/ F(tk::_extends_, hi::Meta);
"enum" L /*FFF*/ F(tk::_enum_, hi::Meta);
"export" L /*FFK*/ F(tk::_export_, hi::Meta);
"extends" L /*FFK*/ F(tk::_extends_, hi::Meta);
"false" L /*LLL*/ F(tk::_false_, hi::Constant);
"final" L /*FII*/ F(tk::_final_, hi::Meta);
"finally" L /*KKK*/ F(tk::_finally_, hi::Control);
"false" L /*LLL*/ F(tk::_false_, hi::Constant);
"final" L /*FII*/ F(tk::_final_, hi::Meta);
"finally" L /*KKK*/ F(tk::_finally_, hi::Control);
"if" L /*KKK*/ F(tk::_if_, hi::Control);
"implements" L /*FSS*/ F(tk::_implements_, hi::Meta);
"import" L /*FFK*/ F(tk::_import_, hi::Meta);
"if" L /*KKK*/ F(tk::_if_, hi::Control);
"implements" L /*FSS*/ F(tk::_implements_, hi::Meta);
"import" L /*FFK*/ F(tk::_import_, hi::Meta);
-"in" L /*KKK*/ F(yyextra->in_.top() ? tk::_in__ : tk::_in_, hi::Operator);
+"in" L /*KKK*/ F(tk::_in_, hi::Operator);
+"Infinity" L /*III*/ F(tk::_Infinity_, hi::Constant);
"instanceof" L /*KKK*/ F(tk::_instanceof_, hi::Operator);
"int" L /*FII*/ F(tk::_int_, hi::Type);
"interface" L /*FSS*/ F(tk::_interface_, hi::Meta);
"instanceof" L /*KKK*/ F(tk::_instanceof_, hi::Operator);
"int" L /*FII*/ F(tk::_int_, hi::Type);
"interface" L /*FSS*/ F(tk::_interface_, hi::Meta);
"protected" L /*FSS*/ F(tk::_protected_, hi::Meta);
"prototype" L /*III*/ F(tk::_prototype_, hi::Special);
"public" L /*FSS*/ F(tk::_public_, hi::Meta);
"protected" L /*FSS*/ F(tk::_protected_, hi::Meta);
"prototype" L /*III*/ F(tk::_prototype_, hi::Special);
"public" L /*FSS*/ F(tk::_public_, hi::Meta);
"set" L /*III*/ F(tk::_set_, hi::Meta);
"short" L /*FII*/ F(tk::_short_, hi::Type);
"static" L /*FS?*/ F(tk::_static_, hi::Meta);
"set" L /*III*/ F(tk::_set_, hi::Meta);
"short" L /*FII*/ F(tk::_short_, hi::Type);
"static" L /*FS?*/ F(tk::_static_, hi::Meta);
"switch" L /*KKK*/ F(tk::_switch_, hi::Control);
"synchronized" L /*FII*/ F(tk::_synchronized_, hi::Meta);
"switch" L /*KKK*/ F(tk::_switch_, hi::Control);
"synchronized" L /*FII*/ F(tk::_synchronized_, hi::Meta);
"this" L /*KKK*/ F(tk::_this_, hi::Constant);
"throw" L /*KKK*/ F(tk::_throw_, hi::Control);
"throws" L /*FII*/ F(tk::_throws_, hi::Meta);
"this" L /*KKK*/ F(tk::_this_, hi::Constant);
"throw" L /*KKK*/ F(tk::_throw_, hi::Control);
"throws" L /*FII*/ F(tk::_throws_, hi::Meta);
"volatile" L /*FII*/ F(tk::_volatile_, hi::Meta);
"while" L /*KKK*/ F(tk::_while_, hi::Control);
"with" L /*KKK*/ F(tk::_with_, hi::Control);
"volatile" L /*FII*/ F(tk::_volatile_, hi::Meta);
"while" L /*KKK*/ F(tk::_while_, hi::Control);
"with" L /*KKK*/ F(tk::_with_, hi::Control);
"auto" L F(tk::_auto_, hi::Meta);
"each" L F(tk::_each_, hi::Control);
"auto" L F(tk::_auto_, hi::Meta);
"each" L F(tk::_each_, hi::Control);
<LegacySingleString,StrictSingleString>{
\' R CYLexBufferEnd(string, String, tk::StringLiteral, hi::Constant);
{SingleCharacter}+ R CYLexBufferUnits(yytext, yyleng);
<LegacySingleString,StrictSingleString>{
\' R CYLexBufferEnd(string, String, tk::StringLiteral, hi::Constant);
{SingleCharacter}+ R CYLexBufferUnits(yytext, yyleng);
- {SingleCharacter}*{UnicodeFail} R E("invalid character");
- {LineTerminatorSequence} R E("invalid newline");
+ {SingleCharacter}*{LineTerminatorSequence} R E("invalid newline");
+ {SingleCharacter}*{UnicodeScrap} R E("invalid character");
}
\" L CYLexBufferStart(LegacyDoubleString);
<LegacyDoubleString,StrictDoubleString>{
\" R CYLexBufferEnd(string, String, tk::StringLiteral, hi::Constant);
{DoubleCharacter}+ R CYLexBufferUnits(yytext, yyleng);
}
\" L CYLexBufferStart(LegacyDoubleString);
<LegacyDoubleString,StrictDoubleString>{
\" R CYLexBufferEnd(string, String, tk::StringLiteral, hi::Constant);
{DoubleCharacter}+ R CYLexBufferUnits(yytext, yyleng);
- {DoubleCharacter}*{UnicodeFail} R E("invalid character");
- {LineTerminatorSequence} R E("invalid newline");
+ {DoubleCharacter}*{LineTerminatorSequence} R E("invalid newline");
+ {DoubleCharacter}*{UnicodeScrap} R E("invalid character");
<StrictAccentString>{
"`" R CYLexBufferEnd(string, String, yyextra->tail_ ? tk::TemplateTail : tk::NoSubstitutionTemplate, hi::Constant);
<StrictAccentString>{
"`" R CYLexBufferEnd(string, String, yyextra->tail_ ? tk::TemplateTail : tk::NoSubstitutionTemplate, hi::Constant);
"$" R CYLexBufferUnit('$');
{PlateCharacter}+ R CYLexBufferUnits(yytext, yyleng);
"$" R CYLexBufferUnit('$');
{PlateCharacter}+ R CYLexBufferUnits(yytext, yyleng);
- {PlateCharacter}*{UnicodeFail} R E("invalid character");
- {LineTerminatorSequence} R E("invalid newline");
+ {PlateCharacter}*{LineTerminatorSequence} R E("invalid newline");
+ {PlateCharacter}*{UnicodeScrap} R E("invalid character");
- \\{LineTerminatorSequence} yylloc->end.lines();
- \\(.|{NotLineTerminator}) R CYLexBufferUnits(yytext + 1, yyleng - 1);
+ \\{LineTerminatorSequence} yylloc->end.Lines();
+ \\{NoneTerminatorCharacter} R CYLexBufferUnits(yytext + 1, yyleng - 1);
+ \\{UnicodeScrap} R E("invalid character");
void CYDriver::ScannerInit() {
cylex_init(&scanner_);
cyset_extra(this, scanner_);
void CYDriver::ScannerInit() {
cylex_init(&scanner_);
cyset_extra(this, scanner_);
void CYDriver::SetCondition(Condition condition) {
struct yyguts_t *yyg(reinterpret_cast<struct yyguts_t *>(scanner_));
switch (condition) {
void CYDriver::SetCondition(Condition condition) {
struct yyguts_t *yyg(reinterpret_cast<struct yyguts_t *>(scanner_));
switch (condition) {
@begin E4X
case XMLContentCondition:
yy_push_state(XMLContent, scanner_);
@begin E4X
case XMLContentCondition:
yy_push_state(XMLContent, scanner_);