]>
Commit | Line | Data |
---|---|---|
e5332278 JF |
1 | %{ |
2 | #include "Cycript.tab.h" | |
3 | %} | |
4 | ||
5 | %option prefix="cy" | |
6 | %option bison-bridge | |
7 | %option bison-locations | |
8 | %option noyywrap | |
9 | %option yylineno | |
10 | %option nounput | |
11 | %option interactive | |
12 | ||
13 | delim [ \t] | |
14 | whitesp {delim}+ | |
15 | digit [0-9] | |
16 | number [-]?{digit}*[.]?{digit}+ | |
17 | ||
18 | %% | |
19 | ||
1dbba6cc JF |
20 | "&" return CYTokenAmpersand; |
21 | "&&" return CYTokenAmpersandAmpersand; | |
22 | "&=" return CYTokenAmpersandEqual; | |
23 | "^" return CYTokenCarrot; | |
24 | "^=" return CYTokenCarrotEqual; | |
25 | "=" return CYTokenEqual; | |
26 | "==" return CYTokenEqualEqual; | |
27 | "===" return CYTokenEqualEqualEqual; | |
28 | "!" return CYTokenExclamation; | |
29 | "!=" return CYTokenExclamationEqual; | |
30 | "!==" return CYTokenExclamationEqualEqual; | |
31 | "-" return CYTokenHyphen; | |
32 | "-=" return CYTokenHyphenEqual; | |
33 | "--" return CYTokenHyphenHyphen; | |
34 | "->" return CYTokenHyphenRight; | |
35 | "<" return CYTokenLeft; | |
36 | "<=" return CYTokenLeftEqual; | |
37 | "<<" return CYTokenLeftLeft; | |
38 | "<<=" return CYTokenLeftLeftEqual; | |
39 | "%" return CYTokenPercent; | |
40 | "%=" return CYTokenPercentEqual; | |
41 | "." return CYTokenPeriod; | |
42 | "|" return CYTokenPipe; | |
43 | "|=" return CYTokenPipeEqual; | |
44 | "||" return CYTokenPipePipe; | |
45 | "+" return CYTokenPlus; | |
46 | "+=" return CYTokenPlusEqual; | |
47 | "++" return CYTokenPlusPlus; | |
48 | ">" return CYTokenRight; | |
49 | ">=" return CYTokenRightEqual; | |
50 | ">>" return CYTokenRightRight; | |
51 | ">>=" return CYTokenRightRightEqual; | |
52 | ">>>" return CYTokenRightRightRight; | |
53 | ">>>=" return CYTokenRightRightRightEqual; | |
54 | "/" return CYTokenSlash; | |
55 | "/=" return CYTokenSlashEqual; | |
56 | "*" return CYTokenStar; | |
57 | "*=" return CYTokenStarEqual; | |
58 | "~" return CYTokenTilde; | |
e5332278 | 59 | |
1dbba6cc JF |
60 | ":" return CYTokenColon; |
61 | "," return CYTokenComma; | |
62 | "?" return CYTokenQuestion; | |
63 | ";" return CYTokenSemiColon; | |
64 | ||
65 | "(" return CYTokenOpenParen; | |
66 | ")" return CYTokenCloseParen; | |
67 | "{" return CYTokenOpenBrace; | |
68 | "}" return CYTokenCloseBrace; | |
69 | "[" return CYTokenOpenBracket; | |
70 | "]" return CYTokenCloseBracket; | |
71 | ||
72 | "break" return CYTokenBreak; | |
73 | "case" return CYTokenCase; | |
74 | "catch" return CYTokenCatch; | |
75 | "continue" return CYTokenContinue; | |
76 | "default" return CYTokenDefault; | |
77 | "delete" return CYTokenDelete; | |
78 | "do" return CYTokenDo; | |
79 | "else" return CYTokenElse; | |
80 | "false" return CYTokenFalse; | |
81 | "finally" return CYTokenFinally; | |
82 | "for" return CYTokenFor; | |
83 | "function" return CYTokenFunction; | |
84 | "if" return CYTokenIf; | |
85 | "in" return CYTokenIn; | |
86 | "instanceof" return CYTokenInstanceOf; | |
87 | "new" return CYTokenNew; | |
88 | "null" return CYTokenNull; | |
89 | "return" return CYTokenReturn; | |
90 | "switch" return CYTokenSwitch; | |
91 | "this" return CYTokenThis; | |
92 | "throw" return CYTokenThrow; | |
93 | "true" return CYTokenTrue; | |
94 | "try" return CYTokenTry; | |
95 | "typeof" return CYTokenTypeOf; | |
96 | "var" return CYTokenVar; | |
97 | "void" return CYTokenVoid; | |
98 | "while" return CYTokenWhile; | |
99 | "with" return CYTokenWith; | |
100 | ||
101 | [a-zA-Z$_][a-zA-Z$_0-9]* return CYTokenIdentifier; | |
102 | [0-9]+ return CYTokenNumber; | |
103 | ||
104 | [ \t\n] ; |