diff options
Diffstat (limited to '')
| -rw-r--r-- | lua.lex | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/lua.lex b/lua.lex deleted file mode 100644 index 23a1d7b1..00000000 --- a/lua.lex +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 1 | %{ | ||
| 2 | |||
| 3 | char *rcs_lualex = "$Id: $"; | ||
| 4 | |||
| 5 | #include <stdlib.h> | ||
| 6 | #include <string.h> | ||
| 7 | |||
| 8 | #include "opcode.h" | ||
| 9 | #include "hash.h" | ||
| 10 | #include "inout.h" | ||
| 11 | #include "table.h" | ||
| 12 | #include "y.tab.h" | ||
| 13 | |||
| 14 | #undef input | ||
| 15 | #undef unput | ||
| 16 | |||
| 17 | static Input input; | ||
| 18 | static Unput unput; | ||
| 19 | |||
| 20 | void lua_setinput (Input fn) | ||
| 21 | { | ||
| 22 | input = fn; | ||
| 23 | } | ||
| 24 | |||
| 25 | void lua_setunput (Unput fn) | ||
| 26 | { | ||
| 27 | unput = fn; | ||
| 28 | } | ||
| 29 | |||
| 30 | char *lua_lasttext (void) | ||
| 31 | { | ||
| 32 | return yytext; | ||
| 33 | } | ||
| 34 | |||
| 35 | %} | ||
| 36 | |||
| 37 | |||
| 38 | %% | ||
| 39 | [ \t]* ; | ||
| 40 | ^"$debug" {yylval.vInt = 1; return DEBUG;} | ||
| 41 | ^"$nodebug" {yylval.vInt = 0; return DEBUG;} | ||
| 42 | \n lua_linenumber++; | ||
| 43 | "--".* ; | ||
| 44 | "local" return LOCAL; | ||
| 45 | "if" return IF; | ||
| 46 | "then" return THEN; | ||
| 47 | "else" return ELSE; | ||
| 48 | "elseif" return ELSEIF; | ||
| 49 | "while" return WHILE; | ||
| 50 | "do" return DO; | ||
| 51 | "repeat" return REPEAT; | ||
| 52 | "until" return UNTIL; | ||
| 53 | "function" { | ||
| 54 | yylval.vWord = lua_nfile-1; | ||
| 55 | return FUNCTION; | ||
| 56 | } | ||
| 57 | "end" return END; | ||
| 58 | "return" return RETURN; | ||
| 59 | "local" return LOCAL; | ||
| 60 | "nil" return NIL; | ||
| 61 | "and" return AND; | ||
| 62 | "or" return OR; | ||
| 63 | "not" return NOT; | ||
| 64 | "~=" return NE; | ||
| 65 | "<=" return LE; | ||
| 66 | ">=" return GE; | ||
| 67 | ".." return CONC; | ||
| 68 | \"[^\"]*\" | | ||
| 69 | \'[^\']*\' { | ||
| 70 | yylval.vWord = lua_findenclosedconstant (yytext); | ||
| 71 | return STRING; | ||
| 72 | } | ||
| 73 | [0-9]+("."[0-9]*)? | | ||
| 74 | ([0-9]+)?"."[0-9]+ | | ||
| 75 | [0-9]+("."[0-9]*)?[dDeEgG][+-]?[0-9]+ | | ||
| 76 | ([0-9]+)?"."[0-9]+[dDeEgG][+-]?[0-9]+ { | ||
| 77 | yylval.vFloat = atof(yytext); | ||
| 78 | return NUMBER; | ||
| 79 | } | ||
| 80 | [a-zA-Z_][a-zA-Z0-9_]* { | ||
| 81 | yylval.vWord = lua_findsymbol (yytext); | ||
| 82 | return NAME; | ||
| 83 | } | ||
| 84 | . return *yytext; | ||
| 85 | |||
