aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_LSL_tree.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-08 20:22:30 +1000
committerDavid Walter Seikel2012-01-08 20:22:30 +1000
commitaee5a20afb25260a8997d16f82cce0e71a41ebe1 (patch)
treeff9fbc9a4243dd44f9a3ac4e69215dfc0083aa8b /LuaSL/src/LuaSL_LSL_tree.h
parentApparently order of these ALSO sets precedence. shrugs (diff)
downloadSledjHamr-aee5a20afb25260a8997d16f82cce0e71a41ebe1.zip
SledjHamr-aee5a20afb25260a8997d16f82cce0e71a41ebe1.tar.gz
SledjHamr-aee5a20afb25260a8997d16f82cce0e71a41ebe1.tar.bz2
SledjHamr-aee5a20afb25260a8997d16f82cce0e71a41ebe1.tar.xz
Bite the bullet and get rid of my dreams to use enums, yacc insists on #defines.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h91
1 files changed, 2 insertions, 89 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index 0b2f125..257f18b 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -2,17 +2,15 @@
2#ifndef __EXPRESSION_H__ 2#ifndef __EXPRESSION_H__
3#define __EXPRESSION_H__ 3#define __EXPRESSION_H__
4 4
5//#define LUASL_USE_ENUM
6#define LUASL_DEBUG 5#define LUASL_DEBUG
7 6
8#ifndef LUASL_USE_ENUM
9#include "LuaSL_yaccer.tab.h"
10#endif
11 7
12#include <stddef.h> // So we can have NULL defined. 8#include <stddef.h> // So we can have NULL defined.
13#include <sys/types.h> 9#include <sys/types.h>
14#include <sys/stat.h> 10#include <sys/stat.h>
15#include <fcntl.h> 11#include <fcntl.h>
12
13#include "LuaSL_yaccer.tab.h"
16 14
17#define YYERRCODE 256 15#define YYERRCODE 256
18#define YYDEBUG 1 16#define YYDEBUG 1
@@ -41,92 +39,7 @@ typedef enum
41 LSL_CREATION = 32 39 LSL_CREATION = 32
42} LSL_Flags; 40} LSL_Flags;
43 41
44#ifdef LUASL_USE_ENUM
45typedef enum // In order of precedence, high to low.
46 // Left to right, unless oterwise stated.
47 // According to http://wiki.secondlife.com/wiki/Category:LSL_Operators
48{
49 LSL_COMMA = 257,
50 LSL_INCREMENT_PRE, // Right to left.
51 LSL_INCREMENT_POST, // Right to left.
52 LSL_DECREMENT_PRE, // Right to left.
53 LSL_DECREMENT_POST, // Right to left.
54 LSL_DOT, // Right to left.
55 LSL_ASSIGNMENT_PLAIN, // Right to left.
56 LSL_ASSIGNMENT_DIVIDE, // Right to left.
57 LSL_ASSIGNMENT_MODULO, // Right to left.
58 LSL_ASSIGNMENT_MULTIPLY, // Right to left.
59 LSL_ASSIGNMENT_SUBTRACT, // Right to left.
60 LSL_ASSIGNMENT_ADD, // Right to left.
61 LSL_ASSIGNMENT_CONCATENATE, // Right to left.
62 LSL_PARENTHESIS_OPEN, // Inner to outer.
63 LSL_PARENTHESIS_CLOSE, // Inner to outer.
64 LSL_BRACKET_OPEN, // Inner to outer.
65 LSL_BRACKET_CLOSE, // Inner to outer.
66 LSL_ANGLE_OPEN,
67 LSL_ANGLE_CLOSE,
68 LSL_TYPECAST, // Right to left.
69 LSL_BIT_NOT, // Right to left.
70 LSL_BOOL_NOT, // Right to left.
71 LSL_NEGATION, // Right to left.
72 LSL_DIVIDE,
73 LSL_MODULO,
74 LSL_MULTIPLY,
75 LSL_DOT_PRODUCT,
76 LSL_CROSS_PRODUCT,
77 LSL_SUBTRACT,
78 LSL_ADD,
79 LSL_CONCATENATE,
80 LSL_LEFT_SHIFT,
81 LSL_RIGHT_SHIFT,
82 LSL_LESS_THAN,
83 LSL_GREATER_THAN,
84 LSL_LESS_EQUAL,
85 LSL_GREATER_EQUAL,
86 LSL_EQUAL,
87 LSL_NOT_EQUAL,
88 LSL_BIT_AND,
89 LSL_BIT_XOR,
90 LSL_BIT_OR,
91 LSL_BOOL_OR,
92 LSL_BOOL_AND,
93
94 // The rest are not operater types.
95
96 LSL_SPACE,
97 LSL_COMMENT,
98 LSL_TYPE,
99 LSL_NAME,
100 LSL_IDENTIFIER,
101 LSL_FLOAT,
102 LSL_INTEGER,
103 LSL_STRING,
104 LSL_KEY,
105 LSL_VECTOR,
106 LSL_ROTATION,
107 LSL_LIST,
108 LSL_LABEL,
109 LSL_EXPRESSION,
110 LSL_DO,
111 LSL_FOR,
112 LSL_IF,
113 LSL_ELSE,
114 LSL_ELSEIF,
115 LSL_JUMP,
116 LSL_STATE_CHANGE,
117 LSL_WHILE,
118 LSL_RETURN,
119 LSL_STATEMENT,
120 LSL_BLOCK,
121 LSL_PARAMETER,
122 LSL_FUNCTION,
123 LSL_STATE,
124 LSL_SCRIPT,
125 LSL_UNKNOWN
126} LSL_Type;
127#else
128typedef int LSL_Type; 42typedef int LSL_Type;
129#endif
130 43
131typedef struct 44typedef struct
132{ 45{