2 #include "Cycript.tab.hh"
3 typedef cy::parser::token tk;
8 %option bison-locations
17 number [-]?{digit}*[.]?{digit}+
21 "&" return tk::Ampersand;
22 "&&" return tk::AmpersandAmpersand;
23 "&=" return tk::AmpersandEqual;
24 "^" return tk::Carrot;
25 "^=" return tk::CarrotEqual;
27 "==" return tk::EqualEqual;
28 "===" return tk::EqualEqualEqual;
29 "!" return tk::Exclamation;
30 "!=" return tk::ExclamationEqual;
31 "!==" return tk::ExclamationEqualEqual;
32 "-" return tk::Hyphen;
33 "-=" return tk::HyphenEqual;
34 "--" return tk::HyphenHyphen;
35 "->" return tk::HyphenRight;
37 "<=" return tk::LeftEqual;
38 "<<" return tk::LeftLeft;
39 "<<=" return tk::LeftLeftEqual;
40 "%" return tk::Percent;
41 "%=" return tk::PercentEqual;
42 "." return tk::Period;
44 "|=" return tk::PipeEqual;
45 "||" return tk::PipePipe;
47 "+=" return tk::PlusEqual;
48 "++" return tk::PlusPlus;
50 ">=" return tk::RightEqual;
51 ">>" return tk::RightRight;
52 ">>=" return tk::RightRightEqual;
53 ">>>" return tk::RightRightRight;
54 ">>>=" return tk::RightRightRightEqual;
56 "/=" return tk::SlashEqual;
58 "*=" return tk::StarEqual;
63 "?" return tk::Question;
64 ";" return tk::SemiColon;
66 "(" return tk::OpenParen;
67 ")" return tk::CloseParen;
68 "{" return tk::OpenBrace;
69 "}" return tk::CloseBrace;
70 "[" return tk::OpenBracket;
71 "]" return tk::CloseBracket;
73 "break" return tk::Break;
74 "case" return tk::Case;
75 "catch" return tk::Catch;
76 "continue" return tk::Continue;
77 "default" return tk::Default;
78 "delete" return tk::Delete;
80 "else" return tk::Else;
81 "false" return tk::False;
82 "finally" return tk::Finally;
84 "function" return tk::Function;
87 "instanceof" return tk::InstanceOf;
89 "null" return tk::Null;
90 "return" return tk::Return;
91 "switch" return tk::Switch;
92 "this" return tk::This;
93 "throw" return tk::Throw;
94 "true" return tk::True;
96 "typeof" return tk::TypeOf;
98 "void" return tk::Void;
99 "while" return tk::While;
100 "with" return tk::With;
102 [a-zA-Z$_][a-zA-Z$_0-9]* return tk::Identifier;
103 [0-9]+ return tk::NumericLiteral;