%{ #include "Cycript.tab.hh" typedef cy::parser::token tk; #define YY_EXTRA_TYPE CYParser * %} %option prefix="cy" %option bison-bridge %option bison-locations %option noyywrap %option yylineno %option nounput %option interactive %option reentrant Exponent [eE][+-]?[0-9]+ Escape \\['"\\bfnrtv]|\\0|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4} %% "&" return tk::Ampersand; "&&" return tk::AmpersandAmpersand; "&=" return tk::AmpersandEqual; "^" return tk::Carrot; "^=" return tk::CarrotEqual; "=" return tk::Equal; "==" return tk::EqualEqual; "===" return tk::EqualEqualEqual; "!" return tk::Exclamation; "!=" return tk::ExclamationEqual; "!==" return tk::ExclamationEqualEqual; "-" return tk::Hyphen; "-=" return tk::HyphenEqual; "--" return tk::HyphenHyphen; "->" return tk::HyphenRight; "<" return tk::Left; "<=" return tk::LeftEqual; "<<" return tk::LeftLeft; "<<=" return tk::LeftLeftEqual; "%" return tk::Percent; "%=" return tk::PercentEqual; "." return tk::Period; "|" return tk::Pipe; "|=" return tk::PipeEqual; "||" return tk::PipePipe; "+" return tk::Plus; "+=" return tk::PlusEqual; "++" return tk::PlusPlus; ">" return tk::Right; ">=" return tk::RightEqual; ">>" return tk::RightRight; ">>=" return tk::RightRightEqual; ">>>" return tk::RightRightRight; ">>>=" return tk::RightRightRightEqual; "/" return tk::Slash; "/=" return tk::SlashEqual; "*" return tk::Star; "*=" return tk::StarEqual; "~" return tk::Tilde; ":" return tk::Colon; "," return tk::Comma; "?" return tk::Question; ";" return tk::SemiColon; "(" return tk::OpenParen; ")" return tk::CloseParen; "{" return tk::OpenBrace; "}" return tk::CloseBrace; "[" return tk::OpenBracket; "]" return tk::CloseBracket; "break" return tk::Break; "case" return tk::Case; "catch" return tk::Catch; "continue" return tk::Continue; "default" return tk::Default; "delete" return tk::Delete; "do" return tk::Do; "else" return tk::Else; "false" return tk::False; "finally" return tk::Finally; "for" return tk::For; "function" return tk::Function; "if" return tk::If; "in" return tk::In; "instanceof" return tk::InstanceOf; "new" return tk::New; "null" return tk::Null; "return" return tk::Return; "switch" return tk::Switch; "this" return tk::This; "throw" return tk::Throw; "true" return tk::True; "try" return tk::Try; "typeof" return tk::TypeOf; "var" return tk::Var; "void" return tk::Void; "while" return tk::While; "with" return tk::With; [a-zA-Z$_][a-zA-Z$_0-9]* return tk::Identifier; (\.[0-9]+|(0|[1-9][0-9]*)(\.[0-9]*)?){Exponent}? return tk::NumericLiteral; 0[xX][0-9a-fA-F]+ return tk::NumericLiteral; 0[bB][0-1]+ return tk::NumericLiteral; \"([^"\\\n]|{Escape})*\" return tk::StringLiteral; '([^'\\\n]|{Escape})*' return tk::StringLiteral; [ \t\n] ; %% void CYParser::ScannerInit() { cylex_init(&scanner_); cyset_extra(this, scanner_); } void CYParser::ScannerDestroy() { cylex_destroy(scanner_); }