diff options
author | David Walter Seikel | 2012-01-17 12:42:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-17 12:42:13 +1000 |
commit | 9e9bcb3454c7cb7b8050874f392cf4734ae8c9fe (patch) | |
tree | a82bc788afa9cba4c1ddf7d325b34374d502118f | |
parent | Merge the compiler into the test harness. Remove excess files. (diff) | |
download | SledjHamr-9e9bcb3454c7cb7b8050874f392cf4734ae8c9fe.zip SledjHamr-9e9bcb3454c7cb7b8050874f392cf4734ae8c9fe.tar.gz SledjHamr-9e9bcb3454c7cb7b8050874f392cf4734ae8c9fe.tar.bz2 SledjHamr-9e9bcb3454c7cb7b8050874f392cf4734ae8c9fe.tar.xz |
Remove old btyacc file to.
-rw-r--r-- | LuaSL/src/LuaSL_yaccer.y | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/LuaSL/src/LuaSL_yaccer.y b/LuaSL/src/LuaSL_yaccer.y deleted file mode 100644 index 2176065..0000000 --- a/LuaSL/src/LuaSL_yaccer.y +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | %{ | ||
2 | |||
3 | #include "LuaSL_LSL_tree.h" | ||
4 | |||
5 | //extern char *yytext; | ||
6 | //#define YYDEBUG_LEXER_TEXT yytext | ||
7 | |||
8 | %} | ||
9 | |||
10 | %define api.pure | ||
11 | |||
12 | |||
13 | %token <value.spaceValue> LSL_SPACE /* Never actually emitted, but we need it in the token table. */ | ||
14 | %token <value.commentValue> LSL_COMMENT /* Never actually emitted, but we need it in the token table. */ | ||
15 | %token <value.commentValue> LSL_COMMENT_LINE /* Never actually emitted, but we need it in the token table. */ | ||
16 | %token <value.unknownValue> LSL_UNKNOWN /* Never actually emitted, but we need it in the token table. */ | ||
17 | |||
18 | %token <value.variableValue> LSL_IDENTIFIER | ||
19 | |||
20 | %type <value.expressionValue> expr | ||
21 | %left LSL_BOOL_AND | ||
22 | %left LSL_BOOL_OR | ||
23 | %left LSL_BIT_AND LSL_BIT_XOR LSL_BIT_OR | ||
24 | %left LSL_EQUAL LSL_NOT_EQUAL | ||
25 | %left LSL_LESS_THAN LSL_GREATER_THAN LSL_LESS_EQUAL LSL_GREATER_EQUAL | ||
26 | %left LSL_LEFT_SHIFT LSL_RIGHT_SHIFT | ||
27 | %left LSL_SUBTRACT LSL_ADD | ||
28 | %left LSL_DIVIDE LSL_MODULO LSL_MULTIPLY | ||
29 | %right LSL_BIT_NOT LSL_BOOL_NOT LSL_NEGATION | ||
30 | %left LSL_ANGLE_OPEN LSL_ANGLE_CLOSE | ||
31 | %token LSL_BRACKET_OPEN LSL_BRACKET_CLOSE | ||
32 | %token LSL_PARENTHESIS_OPEN LSL_PARENTHESIS_CLOSE LSL_EXPRESSION | ||
33 | %right LSL_ASSIGNMENT_ADD LSL_ASSIGNMENT_SUBTRACT LSL_ASSIGNMENT_MULTIPLY LSL_ASSIGNMENT_MODULO LSL_ASSIGNMENT_DIVIDE LSL_ASSIGNMENT_PLAIN | ||
34 | %right LSL_DOT | ||
35 | %right LSL_DECREMENT_PRE LSL_INCREMENT_PRE | ||
36 | %token LSL_COMMA | ||
37 | |||
38 | %token <value.floatValue> LSL_FLOAT | ||
39 | %token <value.integerValue> LSL_INTEGER | ||
40 | |||
41 | %nonassoc LSL_TYPE_FLOAT LSL_TYPE_INTEGER LSL_TYPE_KEY LSL_TYPE_LIST LSL_TYPE_ROTATION LSL_TYPE_STRING LSL_TYPE_VECTOR | ||
42 | |||
43 | %nonassoc LSL_DO LSL_FOR LSL_ELSE LSL_IF LSL_JUMP LSL_RETURN LSL_STATE_CHANGE LSL_WHILE | ||
44 | |||
45 | %nonassoc LSL_LABEL | ||
46 | |||
47 | %nonassoc LSL_BLOCK_OPEN LSL_BLOCK_CLOSE | ||
48 | |||
49 | %type <value.statementValue> statement | ||
50 | %nonassoc LSL_STATEMENT | ||
51 | |||
52 | %type <value.scriptValue> script | ||
53 | |||
54 | %% | ||
55 | |||
56 | input : | ||
57 | expr { ((LuaSL_yyparseParam*)data)->ast = addOperation(&yylval, LSL_EXPRESSION, $1, $1); } | ||
58 | | statement { ((LuaSL_yyparseParam*)data)->ast = addStatement($1, ((LuaSL_yyparseParam*)data)->ast); } | ||
59 | | script | ||
60 | ; | ||
61 | |||
62 | expr : | ||
63 | expr LSL_BOOL_AND expr { $$ = addOperation(&yylval, LSL_BOOL_AND, $1, $3); } | ||
64 | | expr LSL_BOOL_OR expr { $$ = addOperation(&yylval, LSL_BOOL_OR, $1, $3); } | ||
65 | | expr LSL_BIT_OR expr { $$ = addOperation(&yylval, LSL_BIT_OR, $1, $3); } | ||
66 | | expr LSL_BIT_XOR expr { $$ = addOperation(&yylval, LSL_BIT_XOR, $1, $3); } | ||
67 | | expr LSL_BIT_AND expr { $$ = addOperation(&yylval, LSL_BIT_AND, $1, $3); } | ||
68 | | expr LSL_NOT_EQUAL expr { $$ = addOperation(&yylval, LSL_NOT_EQUAL, $1, $3); } | ||
69 | | expr LSL_EQUAL expr { $$ = addOperation(&yylval, LSL_EQUAL, $1, $3); } | ||
70 | | expr LSL_GREATER_EQUAL expr { $$ = addOperation(&yylval, LSL_GREATER_EQUAL, $1, $3); } | ||
71 | | expr LSL_LESS_EQUAL expr { $$ = addOperation(&yylval, LSL_LESS_EQUAL, $1, $3); } | ||
72 | | expr LSL_GREATER_THAN expr { $$ = addOperation(&yylval, LSL_GREATER_THAN, $1, $3); } | ||
73 | | expr LSL_LESS_THAN expr { $$ = addOperation(&yylval, LSL_LESS_THAN, $1, $3); } | ||
74 | | expr LSL_RIGHT_SHIFT expr { $$ = addOperation(&yylval, LSL_RIGHT_SHIFT, $1, $3); } | ||
75 | | expr LSL_LEFT_SHIFT expr { $$ = addOperation(&yylval, LSL_LEFT_SHIFT, $1, $3); } | ||
76 | | expr LSL_ADD expr { $$ = addOperation(&yylval, LSL_ADD, $1, $3); } | ||
77 | | expr LSL_SUBTRACT expr { $$ = addOperation(&yylval, LSL_SUBTRACT, $1, $3); } | ||
78 | | expr LSL_MULTIPLY expr { $$ = addOperation(&yylval, LSL_MULTIPLY, $1, $3); } | ||
79 | | expr LSL_MODULO expr { $$ = addOperation(&yylval, LSL_MODULO, $1, $3); } | ||
80 | | expr LSL_DIVIDE expr { $$ = addOperation(&yylval, LSL_DIVIDE, $1, $3); } | ||
81 | | LSL_BIT_NOT expr { $$ = addOperation(&yylval, LSL_BIT_NOT, NULL, $2); } | ||
82 | | LSL_BOOL_NOT expr { $$ = addOperation(&yylval, LSL_BOOL_NOT, NULL, $2); } | ||
83 | | LSL_SUBTRACT expr { $$ = addOperation(&yylval, LSL_NEGATION, NULL, $2); } %prec LSL_NEGATION | ||
84 | | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = addParenthesis(&yylval, $2); } | ||
85 | | LSL_INTEGER { $$ = addInteger(&yylval, $1); } | ||
86 | ; | ||
87 | |||
88 | statement : expr LSL_STATEMENT { $$ = createStatement(LSL_EXPRESSION, $1); YYVALID; } | ||
89 | ; | ||
90 | |||
91 | script : script LSL_STATEMENT statement | ||
92 | |||
93 | %% | ||
94 | |||