diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/lscript/lscript_compile/indra.l | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/lscript/lscript_compile/indra.l')
-rw-r--r-- | linden/indra/lscript/lscript_compile/indra.l | 834 |
1 files changed, 834 insertions, 0 deletions
diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l new file mode 100644 index 0000000..1290018 --- /dev/null +++ b/linden/indra/lscript/lscript_compile/indra.l | |||
@@ -0,0 +1,834 @@ | |||
1 | D [-]?[0-9] | ||
2 | N [0-9] | ||
3 | L [a-zA-Z_] | ||
4 | H [a-fA-F0-9] | ||
5 | E [Ee][+-]?{D}+ | ||
6 | FS (f|F) | ||
7 | %e 8000 | ||
8 | %n 4000 | ||
9 | %p 5000 | ||
10 | |||
11 | %{ | ||
12 | #include <stdio.h> | ||
13 | #include "stdtypes.h" | ||
14 | #include "llmath.h" | ||
15 | #include "lscript_tree.h" | ||
16 | #include "lscript_typecheck.h" | ||
17 | #include "lscript_resource.h" | ||
18 | #include "llfile.h" | ||
19 | #if LL_WINDOWS | ||
20 | #include "ytab.h" | ||
21 | #else | ||
22 | #include "indra.y.h" | ||
23 | #endif | ||
24 | #include "lltimer.h" | ||
25 | #include "indra_constants.h" | ||
26 | #include "llagentconstants.h" | ||
27 | #include "lllslconstants.h" | ||
28 | #include "lluuid.h" | ||
29 | #include "llassetstorage.h" | ||
30 | #include "llpartdata.h" | ||
31 | #include "llvehicleparams.h" | ||
32 | #include "llpermissionsflags.h" | ||
33 | #include "llfollowcamparams.h" | ||
34 | #include "llparcelflags.h" | ||
35 | #include "llregionflags.h" | ||
36 | #include "lscript_http.h" | ||
37 | |||
38 | void count(); | ||
39 | void comment(); | ||
40 | void parse_string(); | ||
41 | |||
42 | #define YYLMAX 16384 | ||
43 | #define YY_NEVER_INTERACTIVE 1 /* stops flex from calling isatty() */ | ||
44 | |||
45 | #if defined(__cplusplus) | ||
46 | extern "C" { int yylex( void ); } | ||
47 | extern "C" { int yyparse( void ); } | ||
48 | extern "C" { int yyerror(const char *fmt, ...); } | ||
49 | #endif | ||
50 | |||
51 | %} | ||
52 | |||
53 | %% | ||
54 | "//" { gInternalLine++; gInternalColumn = 0; comment(); } | ||
55 | |||
56 | "integer" { count(); return(INTEGER); } | ||
57 | "float" { count(); return(FLOAT_TYPE); } | ||
58 | "string" { count(); return(STRING); } | ||
59 | "key" { count(); return(LLKEY); } | ||
60 | "vector" { count(); return(VECTOR); } | ||
61 | "quaternion" { count(); return(QUATERNION); } | ||
62 | "rotation" { count(); return(QUATERNION); } | ||
63 | "list" { count(); return(LIST); } | ||
64 | |||
65 | "default" { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(STATE_DEFAULT); } | ||
66 | "state" { count(); return(STATE); } | ||
67 | "event" { count(); return(EVENT); } | ||
68 | "jump" { count(); return(JUMP); } | ||
69 | "return" { count(); return(RETURN); } | ||
70 | "if" { count(); return(IF); } | ||
71 | "else" { count(); return(ELSE); } | ||
72 | "for" { count(); return(FOR); } | ||
73 | "do" { count(); return(DO); } | ||
74 | "while" { count(); return(WHILE); } | ||
75 | |||
76 | "state_entry" { count(); return(STATE_ENTRY); } | ||
77 | "state_exit" { count(); return(STATE_EXIT); } | ||
78 | "touch_start" { count(); return(TOUCH_START); } | ||
79 | "touch" { count(); return(TOUCH); } | ||
80 | "touch_end" { count(); return(TOUCH_END); } | ||
81 | "collision_start" { count(); return(COLLISION_START); } | ||
82 | "collision" { count(); return(COLLISION); } | ||
83 | "collision_end" { count(); return(COLLISION_END); } | ||
84 | "land_collision_start" { count(); return(LAND_COLLISION_START); } | ||
85 | "land_collision" { count(); return(LAND_COLLISION); } | ||
86 | "land_collision_end" { count(); return(LAND_COLLISION_END); } | ||
87 | "timer" { count(); return(TIMER); } | ||
88 | "listen" { count(); return(CHAT); } | ||
89 | "sensor" { count(); return(SENSOR); } | ||
90 | "no_sensor" { count(); return(NO_SENSOR); } | ||
91 | "control" { count(); return(CONTROL); } | ||
92 | "print" { count(); return(PRINT); } | ||
93 | "at_target" { count(); return(AT_TARGET); } | ||
94 | "not_at_target" { count(); return(NOT_AT_TARGET); } | ||
95 | "at_rot_target" { count(); return(AT_ROT_TARGET); } | ||
96 | "not_at_rot_target" { count(); return(NOT_AT_ROT_TARGET); } | ||
97 | "money" { count(); return(MONEY); } | ||
98 | "email" { count(); return(EMAIL); } | ||
99 | "run_time_permissions" { count(); return(RUN_TIME_PERMISSIONS); } | ||
100 | "changed" { count(); return(INVENTORY); } | ||
101 | "attach" { count(); return(ATTACH); } | ||
102 | "dataserver" { count(); return(DATASERVER); } | ||
103 | "moving_start" { count(); return(MOVING_START); } | ||
104 | "moving_end" { count(); return(MOVING_END); } | ||
105 | "link_message" { count(); return(LINK_MESSAGE); } | ||
106 | "on_rez" { count(); return(REZ); } | ||
107 | "object_rez" { count(); return(OBJECT_REZ); } | ||
108 | "remote_data" { count(); return(REMOTE_DATA); } | ||
109 | "http_response" { count(); return(HTTP_RESPONSE); } | ||
110 | "." { count(); return(PERIOD); } | ||
111 | |||
112 | |||
113 | 0[xX]{H}+ { count(); yylval.ival = strtoul(yytext, NULL, 0); return(INTEGER_CONSTANT); } | ||
114 | {D}+ { count(); yylval.ival = strtoul(yytext, NULL, 10); return(INTEGER_CONSTANT); } | ||
115 | "TRUE" { count(); yylval.ival = 1; return(INTEGER_TRUE); } | ||
116 | "FALSE" { count(); yylval.ival = 0; return(INTEGER_FALSE); } | ||
117 | "STATUS_PHYSICS" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } | ||
118 | "STATUS_ROTATE_X" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } | ||
119 | "STATUS_ROTATE_Y" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } | ||
120 | "STATUS_ROTATE_Z" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } | ||
121 | "STATUS_PHANTOM" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } | ||
122 | "STATUS_SANDBOX" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } | ||
123 | "STATUS_BLOCK_GRAB" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } | ||
124 | "STATUS_DIE_AT_EDGE" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } | ||
125 | "STATUS_RETURN_AT_EDGE" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } | ||
126 | "STATUS_CAST_SHADOWS" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } | ||
127 | |||
128 | "AGENT_FLYING" { count(); yylval.ival = AGENT_FLYING; return(INTEGER_CONSTANT); } | ||
129 | "AGENT_ATTACHMENTS" { count(); yylval.ival = AGENT_ATTACHMENTS; return(INTEGER_CONSTANT); } | ||
130 | "AGENT_SCRIPTED" { count(); yylval.ival = AGENT_SCRIPTED; return(INTEGER_CONSTANT); } | ||
131 | "AGENT_MOUSELOOK" { count(); yylval.ival = AGENT_MOUSELOOK; return(INTEGER_CONSTANT); } | ||
132 | "AGENT_SITTING" { count(); yylval.ival = AGENT_SITTING; return(INTEGER_CONSTANT); } | ||
133 | "AGENT_ON_OBJECT" { count(); yylval.ival = AGENT_ON_OBJECT; return(INTEGER_CONSTANT); } | ||
134 | "AGENT_AWAY" { count(); yylval.ival = AGENT_AWAY; return(INTEGER_CONSTANT); } | ||
135 | "AGENT_WALKING" { count(); yylval.ival = AGENT_WALKING; return(INTEGER_CONSTANT); } | ||
136 | "AGENT_IN_AIR" { count(); yylval.ival = AGENT_IN_AIR; return(INTEGER_CONSTANT); } | ||
137 | "AGENT_TYPING" { count(); yylval.ival = AGENT_TYPING; return(INTEGER_CONSTANT); } | ||
138 | "AGENT_CROUCHING" { count(); yylval.ival = AGENT_CROUCHING; return(INTEGER_CONSTANT); } | ||
139 | "AGENT_BUSY" { count(); yylval.ival = AGENT_BUSY; return(INTEGER_CONSTANT); } | ||
140 | "AGENT_ALWAYS_RUN" { count(); yylval.ival = AGENT_ALWAYS_RUN; return(INTEGER_CONSTANT); } | ||
141 | |||
142 | "CAMERA_PITCH" { count(); yylval.ival = FOLLOWCAM_PITCH; return(INTEGER_CONSTANT); } | ||
143 | "CAMERA_FOCUS_OFFSET" { count(); yylval.ival = FOLLOWCAM_FOCUS_OFFSET; return (INTEGER_CONSTANT); } | ||
144 | "CAMERA_POSITION_LAG" { count(); yylval.ival = FOLLOWCAM_POSITION_LAG; return (INTEGER_CONSTANT); } | ||
145 | "CAMERA_FOCUS_LAG" { count(); yylval.ival = FOLLOWCAM_FOCUS_LAG; return (INTEGER_CONSTANT); } | ||
146 | "CAMERA_DISTANCE" { count(); yylval.ival = FOLLOWCAM_DISTANCE; return (INTEGER_CONSTANT); } | ||
147 | "CAMERA_BEHINDNESS_ANGLE" { count(); yylval.ival = FOLLOWCAM_BEHINDNESS_ANGLE; return (INTEGER_CONSTANT); } | ||
148 | "CAMERA_BEHINDNESS_LAG" { count(); yylval.ival = FOLLOWCAM_BEHINDNESS_LAG; return (INTEGER_CONSTANT); } | ||
149 | "CAMERA_POSITION_THRESHOLD" { count(); yylval.ival = FOLLOWCAM_POSITION_THRESHOLD; return (INTEGER_CONSTANT); } | ||
150 | "CAMERA_FOCUS_THRESHOLD" { count(); yylval.ival = FOLLOWCAM_FOCUS_THRESHOLD; return (INTEGER_CONSTANT); } | ||
151 | "CAMERA_ACTIVE" { count(); yylval.ival = FOLLOWCAM_ACTIVE; return (INTEGER_CONSTANT); } | ||
152 | "CAMERA_POSITION" { count(); yylval.ival = FOLLOWCAM_POSITION; return (INTEGER_CONSTANT); } | ||
153 | "CAMERA_FOCUS" { count(); yylval.ival = FOLLOWCAM_FOCUS; return (INTEGER_CONSTANT); } | ||
154 | "CAMERA_POSITION_LOCKED" { count(); yylval.ival = FOLLOWCAM_POSITION_LOCKED; return (INTEGER_CONSTANT); } | ||
155 | "CAMERA_FOCUS_LOCKED" { count(); yylval.ival = FOLLOWCAM_FOCUS_LOCKED; return (INTEGER_CONSTANT); } | ||
156 | |||
157 | "ANIM_ON" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } | ||
158 | "LOOP" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } | ||
159 | "REVERSE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } | ||
160 | "PING_PONG" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } | ||
161 | "SMOOTH" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } | ||
162 | "ROTATE" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } | ||
163 | "SCALE" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } | ||
164 | |||
165 | "ALL_SIDES" { count(); yylval.ival = LSL_ALL_SIDES; return(INTEGER_CONSTANT); } | ||
166 | "LINK_ROOT" { count(); yylval.ival = LSL_LINK_ROOT; return(INTEGER_CONSTANT); } | ||
167 | "LINK_SET" { count(); yylval.ival = LSL_LINK_SET; return(INTEGER_CONSTANT); } | ||
168 | "LINK_ALL_OTHERS" { count(); yylval.ival = LSL_LINK_ALL_OTHERS; return(INTEGER_CONSTANT); } | ||
169 | "LINK_ALL_CHILDREN" { count(); yylval.ival = LSL_LINK_ALL_CHILDREN; return(INTEGER_CONSTANT); } | ||
170 | "LINK_THIS" { count(); yylval.ival = LSL_LINK_THIS; return(INTEGER_CONSTANT); } | ||
171 | |||
172 | "AGENT" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } | ||
173 | "ACTIVE" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } | ||
174 | "PASSIVE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } | ||
175 | "SCRIPTED" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } | ||
176 | |||
177 | "CONTROL_FWD" { count(); yylval.ival = AGENT_CONTROL_AT_POS; return(INTEGER_CONSTANT); } | ||
178 | "CONTROL_BACK" { count(); yylval.ival = AGENT_CONTROL_AT_NEG; return(INTEGER_CONSTANT); } | ||
179 | "CONTROL_LEFT" { count(); yylval.ival = AGENT_CONTROL_LEFT_POS; return(INTEGER_CONSTANT); } | ||
180 | "CONTROL_RIGHT" { count(); yylval.ival = AGENT_CONTROL_LEFT_NEG; return(INTEGER_CONSTANT); } | ||
181 | "CONTROL_ROT_LEFT" { count(); yylval.ival = AGENT_CONTROL_YAW_POS; return(INTEGER_CONSTANT); } | ||
182 | "CONTROL_ROT_RIGHT" { count(); yylval.ival = AGENT_CONTROL_YAW_NEG; return(INTEGER_CONSTANT); } | ||
183 | "CONTROL_UP" { count(); yylval.ival = AGENT_CONTROL_UP_POS; return(INTEGER_CONSTANT); } | ||
184 | "CONTROL_DOWN" { count(); yylval.ival = AGENT_CONTROL_UP_NEG; return(INTEGER_CONSTANT); } | ||
185 | "CONTROL_LBUTTON" { count(); yylval.ival = AGENT_CONTROL_LBUTTON_DOWN; return(INTEGER_CONSTANT); } | ||
186 | "CONTROL_ML_LBUTTON" { count(); yylval.ival = AGENT_CONTROL_ML_LBUTTON_DOWN; return(INTEGER_CONSTANT); } | ||
187 | |||
188 | "PERMISSION_DEBIT" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_DEBIT]; return(INTEGER_CONSTANT); } | ||
189 | "PERMISSION_TAKE_CONTROLS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS]; return(INTEGER_CONSTANT); } | ||
190 | "PERMISSION_REMAP_CONTROLS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_REMAP_CONTROLS]; return(INTEGER_CONSTANT); } | ||
191 | "PERMISSION_TRIGGER_ANIMATION" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION]; return(INTEGER_CONSTANT); } | ||
192 | "PERMISSION_ATTACH" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]; return(INTEGER_CONSTANT); } | ||
193 | "PERMISSION_RELEASE_OWNERSHIP" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_RELEASE_OWNERSHIP]; return(INTEGER_CONSTANT); } | ||
194 | "PERMISSION_CHANGE_LINKS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CHANGE_LINKS]; return(INTEGER_CONSTANT); } | ||
195 | "PERMISSION_CHANGE_JOINTS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CHANGE_JOINTS]; return(INTEGER_CONSTANT); } | ||
196 | "PERMISSION_CHANGE_PERMISSIONS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CHANGE_PERMISSIONS]; return(INTEGER_CONSTANT); } | ||
197 | "PERMISSION_TRACK_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRACK_CAMERA]; return(INTEGER_CONSTANT); } | ||
198 | "PERMISSION_CONTROL_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CONTROL_CAMERA]; return(INTEGER_CONSTANT); } | ||
199 | |||
200 | "INVENTORY_TEXTURE" { count(); yylval.ival = LLAssetType::AT_TEXTURE; return(INTEGER_CONSTANT); } | ||
201 | "INVENTORY_SOUND" { count(); yylval.ival = LLAssetType::AT_SOUND; return(INTEGER_CONSTANT); } | ||
202 | "INVENTORY_OBJECT" { count(); yylval.ival = LLAssetType::AT_OBJECT; return(INTEGER_CONSTANT); } | ||
203 | "INVENTORY_SCRIPT" { count(); yylval.ival = LLAssetType::AT_LSL_TEXT; return(INTEGER_CONSTANT); } | ||
204 | "INVENTORY_LANDMARK" { count(); yylval.ival = LLAssetType::AT_LANDMARK; return(INTEGER_CONSTANT); } | ||
205 | "INVENTORY_CLOTHING" { count(); yylval.ival = LLAssetType::AT_CLOTHING; return(INTEGER_CONSTANT); } | ||
206 | "INVENTORY_NOTECARD" { count(); yylval.ival = LLAssetType::AT_NOTECARD; return(INTEGER_CONSTANT); } | ||
207 | "INVENTORY_BODYPART" { count(); yylval.ival = LLAssetType::AT_BODYPART; return(INTEGER_CONSTANT); } | ||
208 | "INVENTORY_ANIMATION" { count(); yylval.ival = LLAssetType::AT_ANIMATION; return(INTEGER_CONSTANT); } | ||
209 | "INVENTORY_GESTURE" { count(); yylval.ival = LLAssetType::AT_GESTURE; return(INTEGER_CONSTANT); } | ||
210 | "INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } | ||
211 | "INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } | ||
212 | |||
213 | "CHANGED_INVENTORY" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } | ||
214 | "CHANGED_COLOR" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } | ||
215 | "CHANGED_SHAPE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } | ||
216 | "CHANGED_SCALE" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } | ||
217 | "CHANGED_TEXTURE" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } | ||
218 | "CHANGED_LINK" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } | ||
219 | "CHANGED_ALLOWED_DROP" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } | ||
220 | "CHANGED_OWNER" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } | ||
221 | "CHANGED_REGION" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } | ||
222 | "CHANGED_TELEPORT" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } | ||
223 | |||
224 | "TYPE_INTEGER" { count(); yylval.ival = LST_INTEGER; return(INTEGER_CONSTANT); } | ||
225 | "TYPE_FLOAT" { count(); yylval.ival = LST_FLOATINGPOINT; return(INTEGER_CONSTANT); } | ||
226 | "TYPE_STRING" { count(); yylval.ival = LST_STRING; return(INTEGER_CONSTANT); } | ||
227 | "TYPE_KEY" { count(); yylval.ival = LST_KEY; return(INTEGER_CONSTANT); } | ||
228 | "TYPE_VECTOR" { count(); yylval.ival = LST_VECTOR; return(INTEGER_CONSTANT); } | ||
229 | "TYPE_ROTATION" { count(); yylval.ival = LST_QUATERNION; return(INTEGER_CONSTANT); } | ||
230 | "TYPE_INVALID" { count(); yylval.ival = LST_NULL; return(INTEGER_CONSTANT); } | ||
231 | |||
232 | "NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); } | ||
233 | "EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); } | ||
234 | |||
235 | "PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); } | ||
236 | "TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); } | ||
237 | "PI_BY_TWO" { count(); yylval.fval = F_PI_BY_TWO; return(FP_CONSTANT); } | ||
238 | "DEG_TO_RAD" { count(); yylval.fval = DEG_TO_RAD; return(FP_CONSTANT); } | ||
239 | "RAD_TO_DEG" { count(); yylval.fval = RAD_TO_DEG; return(FP_CONSTANT); } | ||
240 | "SQRT2" { count(); yylval.fval = F_SQRT2; return(FP_CONSTANT); } | ||
241 | |||
242 | "DEBUG_CHANNEL" { count(); yylval.ival = CHAT_CHANNEL_DEBUG; return(INTEGER_CONSTANT); } | ||
243 | "PUBLIC_CHANNEL" { count(); yylval.ival = 0; return(INTEGER_CONSTANT); } | ||
244 | |||
245 | "ZERO_VECTOR" { count(); return(ZERO_VECTOR); } | ||
246 | "ZERO_ROTATION" { count(); return(ZERO_ROTATION); } | ||
247 | |||
248 | "ATTACH_CHEST" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); } | ||
249 | "ATTACH_HEAD" { count(); yylval.ival = 2; return(INTEGER_CONSTANT); } | ||
250 | "ATTACH_LSHOULDER" { count(); yylval.ival = 3; return(INTEGER_CONSTANT); } | ||
251 | "ATTACH_RSHOULDER" { count(); yylval.ival = 4; return(INTEGER_CONSTANT); } | ||
252 | "ATTACH_LHAND" { count(); yylval.ival = 5; return(INTEGER_CONSTANT); } | ||
253 | "ATTACH_RHAND" { count(); yylval.ival = 6; return(INTEGER_CONSTANT); } | ||
254 | "ATTACH_LFOOT" { count(); yylval.ival = 7; return(INTEGER_CONSTANT); } | ||
255 | "ATTACH_RFOOT" { count(); yylval.ival = 8; return(INTEGER_CONSTANT); } | ||
256 | "ATTACH_BACK" { count(); yylval.ival = 9; return(INTEGER_CONSTANT); } | ||
257 | "ATTACH_PELVIS" { count(); yylval.ival = 10; return(INTEGER_CONSTANT); } | ||
258 | "ATTACH_MOUTH" { count(); yylval.ival = 11; return(INTEGER_CONSTANT); } | ||
259 | "ATTACH_CHIN" { count(); yylval.ival = 12; return(INTEGER_CONSTANT); } | ||
260 | "ATTACH_LEAR" { count(); yylval.ival = 13; return(INTEGER_CONSTANT); } | ||
261 | "ATTACH_REAR" { count(); yylval.ival = 14; return(INTEGER_CONSTANT); } | ||
262 | "ATTACH_LEYE" { count(); yylval.ival = 15; return(INTEGER_CONSTANT); } | ||
263 | "ATTACH_REYE" { count(); yylval.ival = 16; return(INTEGER_CONSTANT); } | ||
264 | "ATTACH_NOSE" { count(); yylval.ival = 17; return(INTEGER_CONSTANT); } | ||
265 | "ATTACH_RUARM" { count(); yylval.ival = 18; return(INTEGER_CONSTANT); } | ||
266 | "ATTACH_RLARM" { count(); yylval.ival = 19; return(INTEGER_CONSTANT); } | ||
267 | "ATTACH_LUARM" { count(); yylval.ival = 20; return(INTEGER_CONSTANT); } | ||
268 | "ATTACH_LLARM" { count(); yylval.ival = 21; return(INTEGER_CONSTANT); } | ||
269 | "ATTACH_RHIP" { count(); yylval.ival = 22; return(INTEGER_CONSTANT); } | ||
270 | "ATTACH_RULEG" { count(); yylval.ival = 23; return(INTEGER_CONSTANT); } | ||
271 | "ATTACH_RLLEG" { count(); yylval.ival = 24; return(INTEGER_CONSTANT); } | ||
272 | "ATTACH_LHIP" { count(); yylval.ival = 25; return(INTEGER_CONSTANT); } | ||
273 | "ATTACH_LULEG" { count(); yylval.ival = 26; return(INTEGER_CONSTANT); } | ||
274 | "ATTACH_LLLEG" { count(); yylval.ival = 27; return(INTEGER_CONSTANT); } | ||
275 | "ATTACH_BELLY" { count(); yylval.ival = 28; return(INTEGER_CONSTANT); } | ||
276 | "ATTACH_RPEC" { count(); yylval.ival = 29; return(INTEGER_CONSTANT); } | ||
277 | "ATTACH_LPEC" { count(); yylval.ival = 30; return(INTEGER_CONSTANT); } | ||
278 | "ATTACH_HUD_CENTER_2" { count(); yylval.ival = 31; return(INTEGER_CONSTANT); } | ||
279 | "ATTACH_HUD_TOP_RIGHT" { count(); yylval.ival = 32; return(INTEGER_CONSTANT); } | ||
280 | "ATTACH_HUD_TOP_CENTER" { count(); yylval.ival = 33; return(INTEGER_CONSTANT); } | ||
281 | "ATTACH_HUD_TOP_LEFT" { count(); yylval.ival = 34; return(INTEGER_CONSTANT); } | ||
282 | "ATTACH_HUD_CENTER_1" { count(); yylval.ival = 35; return(INTEGER_CONSTANT); } | ||
283 | "ATTACH_HUD_BOTTOM_LEFT" { count(); yylval.ival = 36; return(INTEGER_CONSTANT); } | ||
284 | "ATTACH_HUD_BOTTOM" { count(); yylval.ival = 37; return(INTEGER_CONSTANT); } | ||
285 | "ATTACH_HUD_BOTTOM_RIGHT" { count(); yylval.ival = 38; return(INTEGER_CONSTANT); } | ||
286 | |||
287 | "LAND_LEVEL" { count(); yylval.ival = E_LANDBRUSH_LEVEL; return(INTEGER_CONSTANT); } | ||
288 | "LAND_RAISE" { count(); yylval.ival = E_LANDBRUSH_RAISE; return(INTEGER_CONSTANT); } | ||
289 | "LAND_LOWER" { count(); yylval.ival = E_LANDBRUSH_LOWER; return(INTEGER_CONSTANT); } | ||
290 | "LAND_SMOOTH" { count(); yylval.ival = E_LANDBRUSH_SMOOTH; return(INTEGER_CONSTANT); } | ||
291 | "LAND_NOISE" { count(); yylval.ival = E_LANDBRUSH_NOISE; return(INTEGER_CONSTANT); } | ||
292 | "LAND_REVERT" { count(); yylval.ival = E_LANDBRUSH_REVERT; return(INTEGER_CONSTANT); } | ||
293 | |||
294 | "LAND_SMALL_BRUSH" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); } | ||
295 | "LAND_MEDIUM_BRUSH" { count(); yylval.ival = 2; return(INTEGER_CONSTANT); } | ||
296 | "LAND_LARGE_BRUSH" { count(); yylval.ival = 3; return(INTEGER_CONSTANT); } | ||
297 | |||
298 | "DATA_ONLINE" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); } | ||
299 | "DATA_NAME" { count(); yylval.ival = 2; return(INTEGER_CONSTANT); } | ||
300 | "DATA_BORN" { count(); yylval.ival = 3; return(INTEGER_CONSTANT); } | ||
301 | "DATA_RATING" { count(); yylval.ival = 4; return(INTEGER_CONSTANT); } | ||
302 | "DATA_SIM_POS" { count(); yylval.ival = 5; return(INTEGER_CONSTANT); } | ||
303 | "DATA_SIM_STATUS" { count(); yylval.ival = 6; return(INTEGER_CONSTANT); } | ||
304 | "DATA_SIM_RATING" { count(); yylval.ival = 7; return(INTEGER_CONSTANT); } | ||
305 | "DATA_PAYINFO" { count(); yylval.ival = 8; return(INTEGER_CONSTANT); } | ||
306 | |||
307 | "PAYMENT_INFO_ON_FILE" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); } | ||
308 | "PAYMENT_INFO_USED" { count(); yylval.ival = 2; return(INTEGER_CONSTANT); } | ||
309 | |||
310 | "REMOTE_DATA_CHANNEL" { count(); yylval.ival = LSL_REMOTE_DATA_CHANNEL; return(INTEGER_CONSTANT); } | ||
311 | "REMOTE_DATA_REQUEST" { count(); yylval.ival = LSL_REMOTE_DATA_REQUEST; return(INTEGER_CONSTANT); } | ||
312 | "REMOTE_DATA_REPLY" { count(); yylval.ival = LSL_REMOTE_DATA_REPLY; return(INTEGER_CONSTANT); } | ||
313 | |||
314 | |||
315 | "PSYS_PART_FLAGS" { count(); yylval.ival = LLPS_PART_FLAGS; return(INTEGER_CONSTANT); } | ||
316 | "PSYS_PART_START_COLOR" { count(); yylval.ival = LLPS_PART_START_COLOR; return (INTEGER_CONSTANT); } | ||
317 | "PSYS_PART_START_ALPHA" { count(); yylval.ival = LLPS_PART_START_ALPHA; return (INTEGER_CONSTANT); } | ||
318 | "PSYS_PART_START_SCALE" { count(); yylval.ival = LLPS_PART_START_SCALE; return (INTEGER_CONSTANT); } | ||
319 | "PSYS_PART_END_COLOR" { count(); yylval.ival = LLPS_PART_END_COLOR; return (INTEGER_CONSTANT); } | ||
320 | "PSYS_PART_END_ALPHA" { count(); yylval.ival = LLPS_PART_END_ALPHA; return (INTEGER_CONSTANT); } | ||
321 | "PSYS_PART_END_SCALE" { count(); yylval.ival = LLPS_PART_END_SCALE; return (INTEGER_CONSTANT); } | ||
322 | "PSYS_PART_MAX_AGE" { count(); yylval.ival = LLPS_PART_MAX_AGE; return (INTEGER_CONSTANT); } | ||
323 | |||
324 | |||
325 | "PSYS_PART_WIND_MASK" { count(); yylval.ival = LLPartData::LL_PART_WIND_MASK; return(INTEGER_CONSTANT); } | ||
326 | "PSYS_PART_INTERP_COLOR_MASK" { count(); yylval.ival = LLPartData::LL_PART_INTERP_COLOR_MASK; return(INTEGER_CONSTANT); } | ||
327 | "PSYS_PART_INTERP_SCALE_MASK" { count(); yylval.ival = LLPartData::LL_PART_INTERP_SCALE_MASK; return(INTEGER_CONSTANT); } | ||
328 | "PSYS_PART_BOUNCE_MASK" { count(); yylval.ival = LLPartData::LL_PART_BOUNCE_MASK; return(INTEGER_CONSTANT); } | ||
329 | "PSYS_PART_FOLLOW_SRC_MASK" { count(); yylval.ival = LLPartData::LL_PART_FOLLOW_SRC_MASK; return(INTEGER_CONSTANT); } | ||
330 | "PSYS_PART_FOLLOW_VELOCITY_MASK" { count(); yylval.ival = LLPartData::LL_PART_FOLLOW_VELOCITY_MASK; return(INTEGER_CONSTANT); } | ||
331 | "PSYS_PART_TARGET_POS_MASK" { count(); yylval.ival = LLPartData::LL_PART_TARGET_POS_MASK; return(INTEGER_CONSTANT); } | ||
332 | "PSYS_PART_EMISSIVE_MASK" { count(); yylval.ival = LLPartData::LL_PART_EMISSIVE_MASK; return(INTEGER_CONSTANT); } | ||
333 | "PSYS_PART_TARGET_LINEAR_MASK" { count(); yylval.ival = LLPartData::LL_PART_TARGET_LINEAR_MASK; return(INTEGER_CONSTANT); } | ||
334 | |||
335 | |||
336 | "PSYS_SRC_MAX_AGE" { count(); yylval.ival = LLPS_SRC_MAX_AGE; return(INTEGER_CONSTANT); } | ||
337 | "PSYS_SRC_PATTERN" { count(); yylval.ival = LLPS_SRC_PATTERN; return(INTEGER_CONSTANT); } | ||
338 | "PSYS_SRC_INNERANGLE" { count(); yylval.ival = LLPS_SRC_INNERANGLE; return(INTEGER_CONSTANT); } | ||
339 | "PSYS_SRC_OUTERANGLE" { count(); yylval.ival = LLPS_SRC_OUTERANGLE; return(INTEGER_CONSTANT); } | ||
340 | "PSYS_SRC_ANGLE_BEGIN" { count(); yylval.ival = LLPS_SRC_ANGLE_BEGIN; return(INTEGER_CONSTANT); } | ||
341 | "PSYS_SRC_ANGLE_END" { count(); yylval.ival = LLPS_SRC_ANGLE_END; return(INTEGER_CONSTANT); } | ||
342 | "PSYS_SRC_BURST_RATE" { count(); yylval.ival = LLPS_SRC_BURST_RATE; return(INTEGER_CONSTANT); } | ||
343 | "PSYS_SRC_BURST_PART_COUNT" { count(); yylval.ival = LLPS_SRC_BURST_PART_COUNT; return(INTEGER_CONSTANT); } | ||
344 | "PSYS_SRC_BURST_RADIUS" { count(); yylval.ival = LLPS_SRC_BURST_RADIUS; return(INTEGER_CONSTANT); } | ||
345 | "PSYS_SRC_BURST_SPEED_MIN" { count(); yylval.ival = LLPS_SRC_BURST_SPEED_MIN; return(INTEGER_CONSTANT); } | ||
346 | "PSYS_SRC_BURST_SPEED_MAX" { count(); yylval.ival = LLPS_SRC_BURST_SPEED_MAX; return(INTEGER_CONSTANT); } | ||
347 | "PSYS_SRC_ACCEL" { count(); yylval.ival = LLPS_SRC_ACCEL; return(INTEGER_CONSTANT); } | ||
348 | "PSYS_SRC_TEXTURE" { count(); yylval.ival = LLPS_SRC_TEXTURE; return(INTEGER_CONSTANT); } | ||
349 | "PSYS_SRC_TARGET_KEY" { count(); yylval.ival = LLPS_SRC_TARGET_UUID; return(INTEGER_CONSTANT); } | ||
350 | "PSYS_SRC_OMEGA" { count(); yylval.ival = LLPS_SRC_OMEGA; return(INTEGER_CONSTANT); } | ||
351 | |||
352 | "PSYS_SRC_OBJ_REL_MASK" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_OBJ_REL_MASK; return(INTEGER_CONSTANT); } | ||
353 | |||
354 | "PSYS_SRC_PATTERN_DROP" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_PATTERN_DROP; return(INTEGER_CONSTANT); } | ||
355 | "PSYS_SRC_PATTERN_EXPLODE" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_PATTERN_EXPLODE; return(INTEGER_CONSTANT); } | ||
356 | "PSYS_SRC_PATTERN_ANGLE" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE; return(INTEGER_CONSTANT); } | ||
357 | "PSYS_SRC_PATTERN_ANGLE_CONE" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE; return(INTEGER_CONSTANT); } | ||
358 | "PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY" { count(); yylval.ival = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY; return(INTEGER_CONSTANT); } | ||
359 | |||
360 | |||
361 | "VEHICLE_TYPE_NONE" { count(); yylval.ival = VEHICLE_TYPE_NONE; return(INTEGER_CONSTANT); } | ||
362 | "VEHICLE_TYPE_SLED" { count(); yylval.ival = VEHICLE_TYPE_SLED; return(INTEGER_CONSTANT); } | ||
363 | "VEHICLE_TYPE_CAR" { count(); yylval.ival = VEHICLE_TYPE_CAR; return(INTEGER_CONSTANT); } | ||
364 | "VEHICLE_TYPE_BOAT" { count(); yylval.ival = VEHICLE_TYPE_BOAT; return(INTEGER_CONSTANT); } | ||
365 | "VEHICLE_TYPE_AIRPLANE" { count(); yylval.ival = VEHICLE_TYPE_AIRPLANE; return(INTEGER_CONSTANT); } | ||
366 | "VEHICLE_TYPE_BALLOON" { count(); yylval.ival = VEHICLE_TYPE_BALLOON; return(INTEGER_CONSTANT); } | ||
367 | |||
368 | "VEHICLE_REFERENCE_FRAME" { count(); yylval.ival = VEHICLE_REFERENCE_FRAME; return(INTEGER_CONSTANT); } | ||
369 | "VEHICLE_LINEAR_FRICTION_TIMESCALE" { count(); yylval.ival = VEHICLE_LINEAR_FRICTION_TIMESCALE; return(INTEGER_CONSTANT); } | ||
370 | "VEHICLE_ANGULAR_FRICTION_TIMESCALE" { count(); yylval.ival = VEHICLE_ANGULAR_FRICTION_TIMESCALE; return(INTEGER_CONSTANT); } | ||
371 | "VEHICLE_LINEAR_MOTOR_DIRECTION" { count(); yylval.ival = VEHICLE_LINEAR_MOTOR_DIRECTION; return(INTEGER_CONSTANT); } | ||
372 | "VEHICLE_ANGULAR_MOTOR_DIRECTION" { count(); yylval.ival = VEHICLE_ANGULAR_MOTOR_DIRECTION; return(INTEGER_CONSTANT); } | ||
373 | "VEHICLE_LINEAR_MOTOR_OFFSET" { count(); yylval.ival = VEHICLE_LINEAR_MOTOR_OFFSET; return(INTEGER_CONSTANT); } | ||
374 | |||
375 | |||
376 | |||
377 | "VEHICLE_HOVER_HEIGHT" { count(); yylval.ival = VEHICLE_HOVER_HEIGHT; return(INTEGER_CONSTANT); } | ||
378 | "VEHICLE_HOVER_EFFICIENCY" { count(); yylval.ival = VEHICLE_HOVER_EFFICIENCY; return(INTEGER_CONSTANT); } | ||
379 | "VEHICLE_HOVER_TIMESCALE" { count(); yylval.ival = VEHICLE_HOVER_TIMESCALE; return(INTEGER_CONSTANT); } | ||
380 | "VEHICLE_BUOYANCY" { count(); yylval.ival = VEHICLE_BUOYANCY; return(INTEGER_CONSTANT); } | ||
381 | |||
382 | "VEHICLE_LINEAR_DEFLECTION_EFFICIENCY" { count(); yylval.ival = VEHICLE_LINEAR_DEFLECTION_EFFICIENCY; return(INTEGER_CONSTANT); } | ||
383 | "VEHICLE_LINEAR_DEFLECTION_TIMESCALE" { count(); yylval.ival = VEHICLE_LINEAR_DEFLECTION_TIMESCALE; return(INTEGER_CONSTANT); } | ||
384 | "VEHICLE_LINEAR_MOTOR_TIMESCALE" { count(); yylval.ival = VEHICLE_LINEAR_MOTOR_TIMESCALE; return(INTEGER_CONSTANT); } | ||
385 | "VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE" { count(); yylval.ival = VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE; return(INTEGER_CONSTANT); } | ||
386 | |||
387 | "VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY" { count(); yylval.ival = VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY; return(INTEGER_CONSTANT); } | ||
388 | "VEHICLE_ANGULAR_DEFLECTION_TIMESCALE" { count(); yylval.ival = VEHICLE_ANGULAR_DEFLECTION_TIMESCALE; return(INTEGER_CONSTANT); } | ||
389 | "VEHICLE_ANGULAR_MOTOR_TIMESCALE" { count(); yylval.ival = VEHICLE_ANGULAR_MOTOR_TIMESCALE; return(INTEGER_CONSTANT); } | ||
390 | "VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE" { count(); yylval.ival = VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE; return(INTEGER_CONSTANT); } | ||
391 | |||
392 | "VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY" { count(); yylval.ival = VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY; return(INTEGER_CONSTANT); } | ||
393 | "VEHICLE_VERTICAL_ATTRACTION_TIMESCALE" { count(); yylval.ival = VEHICLE_VERTICAL_ATTRACTION_TIMESCALE; return(INTEGER_CONSTANT); } | ||
394 | |||
395 | "VEHICLE_BANKING_EFFICIENCY" { count(); yylval.ival = VEHICLE_BANKING_EFFICIENCY; return(INTEGER_CONSTANT); } | ||
396 | "VEHICLE_BANKING_MIX" { count(); yylval.ival = VEHICLE_BANKING_MIX; return(INTEGER_CONSTANT); } | ||
397 | "VEHICLE_BANKING_TIMESCALE" { count(); yylval.ival = VEHICLE_BANKING_TIMESCALE; return(INTEGER_CONSTANT); } | ||
398 | |||
399 | "VEHICLE_FLAG_NO_FLY_UP" { count(); yylval.ival = VEHICLE_FLAG_NO_DEFLECTION_UP; return(INTEGER_CONSTANT); } | ||
400 | "VEHICLE_FLAG_NO_DEFLECTION_UP" { count(); yylval.ival = VEHICLE_FLAG_NO_DEFLECTION_UP; return(INTEGER_CONSTANT); } | ||
401 | "VEHICLE_FLAG_LIMIT_ROLL_ONLY" { count(); yylval.ival = VEHICLE_FLAG_LIMIT_ROLL_ONLY; return(INTEGER_CONSTANT); } | ||
402 | "VEHICLE_FLAG_HOVER_WATER_ONLY" { count(); yylval.ival = VEHICLE_FLAG_HOVER_WATER_ONLY; return(INTEGER_CONSTANT); } | ||
403 | "VEHICLE_FLAG_HOVER_TERRAIN_ONLY" { count(); yylval.ival = VEHICLE_FLAG_HOVER_TERRAIN_ONLY; return(INTEGER_CONSTANT); } | ||
404 | "VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT" { count(); yylval.ival = VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT; return(INTEGER_CONSTANT); } | ||
405 | "VEHICLE_FLAG_HOVER_UP_ONLY" { count(); yylval.ival = VEHICLE_FLAG_HOVER_UP_ONLY; return(INTEGER_CONSTANT); } | ||
406 | "VEHICLE_FLAG_LIMIT_MOTOR_UP" { count(); yylval.ival = VEHICLE_FLAG_LIMIT_MOTOR_UP; return(INTEGER_CONSTANT); } | ||
407 | "VEHICLE_FLAG_MOUSELOOK_STEER" { count(); yylval.ival = VEHICLE_FLAG_MOUSELOOK_STEER; return(INTEGER_CONSTANT); } | ||
408 | "VEHICLE_FLAG_MOUSELOOK_BANK" { count(); yylval.ival = VEHICLE_FLAG_MOUSELOOK_BANK; return(INTEGER_CONSTANT); } | ||
409 | "VEHICLE_FLAG_CAMERA_DECOUPLED" { count(); yylval.ival = VEHICLE_FLAG_CAMERA_DECOUPLED; return(INTEGER_CONSTANT); } | ||
410 | |||
411 | |||
412 | |||
413 | "PRIM_TYPE" { count(); yylval.ival = LSL_PRIM_TYPE; return(INTEGER_CONSTANT); } | ||
414 | "PRIM_MATERIAL" { count(); yylval.ival = LSL_PRIM_MATERIAL; return(INTEGER_CONSTANT); } | ||
415 | "PRIM_PHYSICS" { count(); yylval.ival = LSL_PRIM_PHYSICS; return(INTEGER_CONSTANT); } | ||
416 | "PRIM_FLEXIBLE" { count(); yylval.ival = LSL_PRIM_FLEXIBLE; return(INTEGER_CONSTANT); } | ||
417 | "PRIM_POINT_LIGHT" { count(); yylval.ival = LSL_PRIM_POINT_LIGHT; return(INTEGER_CONSTANT); } | ||
418 | "PRIM_TEMP_ON_REZ" { count(); yylval.ival = LSL_PRIM_TEMP_ON_REZ; return(INTEGER_CONSTANT); } | ||
419 | "PRIM_PHANTOM" { count(); yylval.ival = LSL_PRIM_PHANTOM; return(INTEGER_CONSTANT); } | ||
420 | "PRIM_CAST_SHADOWS" { count(); yylval.ival = LSL_PRIM_CAST_SHADOWS; return(INTEGER_CONSTANT); } | ||
421 | "PRIM_POSITION" { count(); yylval.ival = LSL_PRIM_POSITION; return(INTEGER_CONSTANT); } | ||
422 | "PRIM_SIZE" { count(); yylval.ival = LSL_PRIM_SIZE; return(INTEGER_CONSTANT); } | ||
423 | "PRIM_ROTATION" { count(); yylval.ival = LSL_PRIM_ROTATION; return(INTEGER_CONSTANT); } | ||
424 | "PRIM_TEXTURE" { count(); yylval.ival = LSL_PRIM_TEXTURE; return(INTEGER_CONSTANT); } | ||
425 | "PRIM_COLOR" { count(); yylval.ival = LSL_PRIM_COLOR; return(INTEGER_CONSTANT); } | ||
426 | "PRIM_BUMP_SHINY" { count(); yylval.ival = LSL_PRIM_BUMP_SHINY; return(INTEGER_CONSTANT); } | ||
427 | "PRIM_FULLBRIGHT" { count(); yylval.ival = LSL_PRIM_FULLBRIGHT; return(INTEGER_CONSTANT); } | ||
428 | "PRIM_TEXGEN" { count(); yylval.ival = LSL_PRIM_TEXGEN; return(INTEGER_CONSTANT); } | ||
429 | |||
430 | "PRIM_TYPE_BOX" { count(); yylval.ival = LSL_PRIM_TYPE_BOX; return(INTEGER_CONSTANT); } | ||
431 | "PRIM_TYPE_CYLINDER" { count(); yylval.ival = LSL_PRIM_TYPE_CYLINDER; return(INTEGER_CONSTANT); } | ||
432 | "PRIM_TYPE_PRISM" { count(); yylval.ival = LSL_PRIM_TYPE_PRISM; return(INTEGER_CONSTANT); } | ||
433 | "PRIM_TYPE_SPHERE" { count(); yylval.ival = LSL_PRIM_TYPE_SPHERE; return(INTEGER_CONSTANT); } | ||
434 | "PRIM_TYPE_TORUS" { count(); yylval.ival = LSL_PRIM_TYPE_TORUS; return(INTEGER_CONSTANT); } | ||
435 | "PRIM_TYPE_TUBE" { count(); yylval.ival = LSL_PRIM_TYPE_TUBE; return(INTEGER_CONSTANT); } | ||
436 | "PRIM_TYPE_RING" { count(); yylval.ival = LSL_PRIM_TYPE_RING; return(INTEGER_CONSTANT); } | ||
437 | |||
438 | "PRIM_HOLE_DEFAULT" { count(); yylval.ival = LSL_PRIM_HOLE_DEFAULT; return(INTEGER_CONSTANT); } | ||
439 | "PRIM_HOLE_CIRCLE" { count(); yylval.ival = LSL_PRIM_HOLE_CIRCLE; return(INTEGER_CONSTANT); } | ||
440 | "PRIM_HOLE_SQUARE" { count(); yylval.ival = LSL_PRIM_HOLE_SQUARE; return(INTEGER_CONSTANT); } | ||
441 | "PRIM_HOLE_TRIANGLE" { count(); yylval.ival = LSL_PRIM_HOLE_TRIANGLE; return(INTEGER_CONSTANT); } | ||
442 | |||
443 | "PRIM_MATERIAL_STONE" { count(); yylval.ival = LSL_PRIM_MATERIAL_STONE; return(INTEGER_CONSTANT); } | ||
444 | "PRIM_MATERIAL_METAL" { count(); yylval.ival = LSL_PRIM_MATERIAL_METAL; return(INTEGER_CONSTANT); } | ||
445 | "PRIM_MATERIAL_GLASS" { count(); yylval.ival = LSL_PRIM_MATERIAL_GLASS; return(INTEGER_CONSTANT); } | ||
446 | "PRIM_MATERIAL_WOOD" { count(); yylval.ival = LSL_PRIM_MATERIAL_WOOD; return(INTEGER_CONSTANT); } | ||
447 | "PRIM_MATERIAL_FLESH" { count(); yylval.ival = LSL_PRIM_MATERIAL_FLESH; return(INTEGER_CONSTANT); } | ||
448 | "PRIM_MATERIAL_PLASTIC" { count(); yylval.ival = LSL_PRIM_MATERIAL_PLASTIC; return(INTEGER_CONSTANT); } | ||
449 | "PRIM_MATERIAL_RUBBER" { count(); yylval.ival = LSL_PRIM_MATERIAL_RUBBER; return(INTEGER_CONSTANT); } | ||
450 | "PRIM_MATERIAL_LIGHT" { count(); yylval.ival = LSL_PRIM_MATERIAL_LIGHT; return(INTEGER_CONSTANT); } | ||
451 | |||
452 | "PRIM_SHINY_NONE" { count(); yylval.ival = LSL_PRIM_SHINY_NONE; return(INTEGER_CONSTANT); } | ||
453 | "PRIM_SHINY_LOW" { count(); yylval.ival = LSL_PRIM_SHINY_LOW; return(INTEGER_CONSTANT); } | ||
454 | "PRIM_SHINY_MEDIUM" { count(); yylval.ival = LSL_PRIM_SHINY_MEDIUM; return(INTEGER_CONSTANT); } | ||
455 | "PRIM_SHINY_HIGH" { count(); yylval.ival = LSL_PRIM_SHINY_HIGH; return(INTEGER_CONSTANT); } | ||
456 | |||
457 | "PRIM_BUMP_NONE" { count(); yylval.ival = LSL_PRIM_BUMP_NONE; return(INTEGER_CONSTANT); } | ||
458 | "PRIM_BUMP_BRIGHT" { count(); yylval.ival = LSL_PRIM_BUMP_BRIGHT; return(INTEGER_CONSTANT); } | ||
459 | "PRIM_BUMP_DARK" { count(); yylval.ival = LSL_PRIM_BUMP_DARK; return(INTEGER_CONSTANT); } | ||
460 | "PRIM_BUMP_WOOD" { count(); yylval.ival = LSL_PRIM_BUMP_WOOD; return(INTEGER_CONSTANT); } | ||
461 | "PRIM_BUMP_BARK" { count(); yylval.ival = LSL_PRIM_BUMP_BARK; return(INTEGER_CONSTANT); } | ||
462 | "PRIM_BUMP_BRICKS" { count(); yylval.ival = LSL_PRIM_BUMP_BRICKS; return(INTEGER_CONSTANT); } | ||
463 | "PRIM_BUMP_CHECKER" { count(); yylval.ival = LSL_PRIM_BUMP_CHECKER; return(INTEGER_CONSTANT); } | ||
464 | "PRIM_BUMP_CONCRETE" { count(); yylval.ival = LSL_PRIM_BUMP_CONCRETE; return(INTEGER_CONSTANT); } | ||
465 | "PRIM_BUMP_TILE" { count(); yylval.ival = LSL_PRIM_BUMP_TILE; return(INTEGER_CONSTANT); } | ||
466 | "PRIM_BUMP_STONE" { count(); yylval.ival = LSL_PRIM_BUMP_STONE; return(INTEGER_CONSTANT); } | ||
467 | "PRIM_BUMP_DISKS" { count(); yylval.ival = LSL_PRIM_BUMP_DISKS; return(INTEGER_CONSTANT); } | ||
468 | "PRIM_BUMP_GRAVEL" { count(); yylval.ival = LSL_PRIM_BUMP_GRAVEL; return(INTEGER_CONSTANT); } | ||
469 | "PRIM_BUMP_BLOBS" { count(); yylval.ival = LSL_PRIM_BUMP_BLOBS; return(INTEGER_CONSTANT); } | ||
470 | "PRIM_BUMP_SIDING" { count(); yylval.ival = LSL_PRIM_BUMP_SIDING; return(INTEGER_CONSTANT); } | ||
471 | "PRIM_BUMP_LARGETILE" { count(); yylval.ival = LSL_PRIM_BUMP_LARGETILE; return(INTEGER_CONSTANT); } | ||
472 | "PRIM_BUMP_STUCCO" { count(); yylval.ival = LSL_PRIM_BUMP_STUCCO; return(INTEGER_CONSTANT); } | ||
473 | "PRIM_BUMP_SUCTION" { count(); yylval.ival = LSL_PRIM_BUMP_SUCTION; return(INTEGER_CONSTANT); } | ||
474 | "PRIM_BUMP_WEAVE" { count(); yylval.ival = LSL_PRIM_BUMP_WEAVE; return(INTEGER_CONSTANT); } | ||
475 | |||
476 | "PRIM_TEXGEN_DEFAULT" { count(); yylval.ival = LSL_PRIM_TEXGEN_DEFAULT; return(INTEGER_CONSTANT); } | ||
477 | "PRIM_TEXGEN_PLANAR" { count(); yylval.ival = LSL_PRIM_TEXGEN_PLANAR; return(INTEGER_CONSTANT); } | ||
478 | |||
479 | "MASK_BASE" { count(); yylval.ival = 0; return(INTEGER_CONSTANT); } | ||
480 | "MASK_OWNER" { count(); yylval.ival = 1; return(INTEGER_CONSTANT); } | ||
481 | "MASK_GROUP" { count(); yylval.ival = 2; return(INTEGER_CONSTANT); } | ||
482 | "MASK_EVERYONE" { count(); yylval.ival = 3; return(INTEGER_CONSTANT); } | ||
483 | "MASK_NEXT" { count(); yylval.ival = 4; return(INTEGER_CONSTANT); } | ||
484 | |||
485 | "PERM_TRANSFER" { count(); yylval.ival = PERM_TRANSFER; return(INTEGER_CONSTANT); } | ||
486 | "PERM_MODIFY" { count(); yylval.ival = PERM_MODIFY; return(INTEGER_CONSTANT); } | ||
487 | "PERM_COPY" { count(); yylval.ival = PERM_COPY; return(INTEGER_CONSTANT); } | ||
488 | "PERM_MOVE" { count(); yylval.ival = PERM_MOVE; return(INTEGER_CONSTANT); } | ||
489 | "PERM_ALL" { count(); yylval.ival = PERM_ALL; return(INTEGER_CONSTANT); } | ||
490 | |||
491 | "PARCEL_MEDIA_COMMAND_STOP" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_STOP; return(INTEGER_CONSTANT); } | ||
492 | "PARCEL_MEDIA_COMMAND_PAUSE" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_PAUSE; return(INTEGER_CONSTANT); } | ||
493 | "PARCEL_MEDIA_COMMAND_PLAY" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_PLAY; return(INTEGER_CONSTANT); } | ||
494 | "PARCEL_MEDIA_COMMAND_LOOP" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_LOOP; return(INTEGER_CONSTANT); } | ||
495 | "PARCEL_MEDIA_COMMAND_TEXTURE" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_TEXTURE; return(INTEGER_CONSTANT); } | ||
496 | "PARCEL_MEDIA_COMMAND_URL" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_URL; return(INTEGER_CONSTANT); } | ||
497 | "PARCEL_MEDIA_COMMAND_TIME" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_TIME; return(INTEGER_CONSTANT); } | ||
498 | "PARCEL_MEDIA_COMMAND_AGENT" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_AGENT; return(INTEGER_CONSTANT); } | ||
499 | "PARCEL_MEDIA_COMMAND_UNLOAD" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_UNLOAD; return(INTEGER_CONSTANT); } | ||
500 | "PARCEL_MEDIA_COMMAND_AUTO_ALIGN" { count(); yylval.ival = PARCEL_MEDIA_COMMAND_AUTO_ALIGN; return(INTEGER_CONSTANT); } | ||
501 | |||
502 | "LIST_STAT_MAX" { count(); yylval.ival = LIST_STAT_MAX; return(INTEGER_CONSTANT); } | ||
503 | "LIST_STAT_MIN" { count(); yylval.ival = LIST_STAT_MIN; return(INTEGER_CONSTANT); } | ||
504 | "LIST_STAT_MEAN" { count(); yylval.ival = LIST_STAT_MEAN; return(INTEGER_CONSTANT); } | ||
505 | "LIST_STAT_MEDIAN" { count(); yylval.ival = LIST_STAT_MEDIAN; return(INTEGER_CONSTANT); } | ||
506 | "LIST_STAT_STD_DEV" { count(); yylval.ival = LIST_STAT_STD_DEV; return(INTEGER_CONSTANT); } | ||
507 | "LIST_STAT_SUM" { count(); yylval.ival = LIST_STAT_SUM; return(INTEGER_CONSTANT); } | ||
508 | "LIST_STAT_SUM_SQUARES" { count(); yylval.ival = LIST_STAT_SUM_SQUARES; return(INTEGER_CONSTANT); } | ||
509 | "LIST_STAT_NUM_COUNT" { count(); yylval.ival = LIST_STAT_NUM_COUNT; return(INTEGER_CONSTANT); } | ||
510 | "LIST_STAT_GEOMETRIC_MEAN" { count(); yylval.ival = LIST_STAT_GEO_MEAN; return(INTEGER_CONSTANT); } | ||
511 | "LIST_STAT_RANGE" { count(); yylval.ival = LIST_STAT_RANGE; return(INTEGER_CONSTANT); } | ||
512 | |||
513 | "PAY_HIDE" { count(); yylval.ival = PAY_PRICE_HIDE; return(INTEGER_CONSTANT); } | ||
514 | "PAY_DEFAULT" { count(); yylval.ival = PAY_PRICE_DEFAULT; return(INTEGER_CONSTANT); } | ||
515 | |||
516 | "PARCEL_FLAG_ALLOW_FLY" { count(); yylval.ival = PF_ALLOW_FLY; return(INTEGER_CONSTANT); } | ||
517 | "PARCEL_FLAG_ALLOW_GROUP_SCRIPTS" { count(); yylval.ival = PF_ALLOW_GROUP_SCRIPTS; return(INTEGER_CONSTANT); } | ||
518 | "PARCEL_FLAG_ALLOW_SCRIPTS" { count(); yylval.ival = PF_ALLOW_OTHER_SCRIPTS; return(INTEGER_CONSTANT); } | ||
519 | "PARCEL_FLAG_ALLOW_LANDMARK" { count(); yylval.ival = PF_ALLOW_LANDMARK; return(INTEGER_CONSTANT); } | ||
520 | "PARCEL_FLAG_ALLOW_TERRAFORM" { count(); yylval.ival = PF_ALLOW_TERRAFORM; return(INTEGER_CONSTANT); } | ||
521 | "PARCEL_FLAG_ALLOW_DAMAGE" { count(); yylval.ival = PF_ALLOW_DAMAGE; return(INTEGER_CONSTANT); } | ||
522 | "PARCEL_FLAG_ALLOW_CREATE_OBJECTS" { count(); yylval.ival = PF_CREATE_OBJECTS; return(INTEGER_CONSTANT); } | ||
523 | "PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS" { count(); yylval.ival = PF_CREATE_GROUP_OBJECTS; return(INTEGER_CONSTANT); } | ||
524 | "PARCEL_FLAG_USE_ACCESS_GROUP" { count(); yylval.ival = PF_USE_ACCESS_GROUP; return(INTEGER_CONSTANT); } | ||
525 | "PARCEL_FLAG_USE_ACCESS_LIST" { count(); yylval.ival = PF_USE_ACCESS_LIST; return(INTEGER_CONSTANT); } | ||
526 | "PARCEL_FLAG_USE_BAN_LIST" { count(); yylval.ival = PF_USE_BAN_LIST; return(INTEGER_CONSTANT); } | ||
527 | "PARCEL_FLAG_USE_LAND_PASS_LIST" { count(); yylval.ival = PF_USE_PASS_LIST; return(INTEGER_CONSTANT); } | ||
528 | "PARCEL_FLAG_LOCAL_SOUND_ONLY" { count(); yylval.ival = PF_SOUND_LOCAL; return(INTEGER_CONSTANT); } | ||
529 | "PARCEL_FLAG_RESTRICT_PUSHOBJECT" { count(); yylval.ival = PF_RESTRICT_PUSHOBJECT; return(INTEGER_CONSTANT); } | ||
530 | "PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY" { count(); yylval.ival = PF_ALLOW_GROUP_OBJECT_ENTRY; return(INTEGER_CONSTANT); } | ||
531 | "PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY" { count(); yylval.ival = PF_ALLOW_ALL_OBJECT_ENTRY; return(INTEGER_CONSTANT); } | ||
532 | |||
533 | "REGION_FLAG_ALLOW_DAMAGE" { count(); yylval.ival = REGION_FLAGS_ALLOW_DAMAGE; return(INTEGER_CONSTANT); } | ||
534 | "REGION_FLAG_FIXED_SUN" { count(); yylval.ival = REGION_FLAGS_SUN_FIXED; return(INTEGER_CONSTANT); } | ||
535 | "REGION_FLAG_BLOCK_TERRAFORM" { count(); yylval.ival = REGION_FLAGS_BLOCK_TERRAFORM; return(INTEGER_CONSTANT); } | ||
536 | "REGION_FLAG_SANDBOX" { count(); yylval.ival = REGION_FLAGS_SANDBOX; return(INTEGER_CONSTANT); } | ||
537 | "REGION_FLAG_DISABLE_COLLISIONS" { count(); yylval.ival = REGION_FLAGS_SKIP_COLLISIONS; return(INTEGER_CONSTANT); } | ||
538 | "REGION_FLAG_DISABLE_PHYSICS" { count(); yylval.ival = REGION_FLAGS_SKIP_PHYSICS; return(INTEGER_CONSTANT); } | ||
539 | "REGION_FLAG_BLOCK_FLY" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLY; return(INTEGER_CONSTANT); } | ||
540 | "REGION_FLAG_ALLOW_DIRECT_TELEPORT" { count(); yylval.ival = REGION_FLAGS_ALLOW_DIRECT_TELEPORT; return(INTEGER_CONSTANT); } | ||
541 | "REGION_FLAG_RESTRICT_PUSHOBJECT" { count(); yylval.ival = REGION_FLAGS_RESTRICT_PUSHOBJECT; return(INTEGER_CONSTANT); } | ||
542 | |||
543 | "HTTP_METHOD" { count(); yylval.ival = HTTP_METHOD; return(INTEGER_CONSTANT); } | ||
544 | "HTTP_MIMETYPE" { count(); yylval.ival = HTTP_MIMETYPE; return(INTEGER_CONSTANT); } | ||
545 | "HTTP_BODY_MAXLENGTH" { count(); yylval.ival = HTTP_BODY_MAXLENGTH; return(INTEGER_CONSTANT); } | ||
546 | "HTTP_BODY_TRUNCATED" { count(); yylval.ival = HTTP_BODY_TRUNCATED; return(INTEGER_CONSTANT); } | ||
547 | "HTTP_VERIFY_CERT" { count(); yylval.ival = HTTP_VERIFY_CERT; return(INTEGER_CONSTANT); } | ||
548 | |||
549 | "PARCEL_COUNT_TOTAL" { count(); yylval.ival = OC_TOTAL; return(INTEGER_CONSTANT); } | ||
550 | "PARCEL_COUNT_OWNER" { count(); yylval.ival = OC_OWNER; return(INTEGER_CONSTANT); } | ||
551 | "PARCEL_COUNT_GROUP" { count(); yylval.ival = OC_GROUP; return(INTEGER_CONSTANT); } | ||
552 | "PARCEL_COUNT_OTHER" { count(); yylval.ival = OC_OTHER; return(INTEGER_CONSTANT); } | ||
553 | "PARCEL_COUNT_SELECTED" { count(); yylval.ival = OC_SELECTED; return(INTEGER_CONSTANT); } | ||
554 | "PARCEL_COUNT_TEMP" { count(); yylval.ival = OC_TEMP; return(INTEGER_CONSTANT); } | ||
555 | |||
556 | "PARCEL_DETAILS_NAME" { count(); yylval.ival = PARCEL_DETAILS_NAME; return(INTEGER_CONSTANT); } | ||
557 | "PARCEL_DETAILS_DESC" { count(); yylval.ival = PARCEL_DETAILS_DESC; return(INTEGER_CONSTANT); } | ||
558 | "PARCEL_DETAILS_OWNER" { count(); yylval.ival = PARCEL_DETAILS_OWNER; return(INTEGER_CONSTANT); } | ||
559 | "PARCEL_DETAILS_GROUP" { count(); yylval.ival = PARCEL_DETAILS_GROUP; return(INTEGER_CONSTANT); } | ||
560 | "PARCEL_DETAILS_AREA" { count(); yylval.ival = PARCEL_DETAILS_AREA; return(INTEGER_CONSTANT); } | ||
561 | |||
562 | {L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); } | ||
563 | |||
564 | {D}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } | ||
565 | {D}*"."{D}+({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } | ||
566 | {D}+"."{D}*({E})?{FS}? { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } | ||
567 | |||
568 | L?\"(\\.|[^\\"])*\" { parse_string(); count(); return(STRING_CONSTANT); } | ||
569 | |||
570 | "++" { count(); return(INC_OP); } | ||
571 | "--" { count(); return(DEC_OP); } | ||
572 | "+=" { count(); return(ADD_ASSIGN); } | ||
573 | "-=" { count(); return(SUB_ASSIGN); } | ||
574 | "*=" { count(); return(MUL_ASSIGN); } | ||
575 | "/=" { count(); return(DIV_ASSIGN); } | ||
576 | "%=" { count(); return(MOD_ASSIGN); } | ||
577 | ";" { count(); return(';'); } | ||
578 | "{" { count(); return('{'); } | ||
579 | "}" { count(); return('}'); } | ||
580 | "," { count(); return(','); } | ||
581 | "=" { count(); return('='); } | ||
582 | "(" { count(); return('('); } | ||
583 | ")" { count(); return(')'); } | ||
584 | "-" { count(); return('-'); } | ||
585 | "+" { count(); return('+'); } | ||
586 | "*" { count(); return('*'); } | ||
587 | "/" { count(); return('/'); } | ||
588 | "%" { count(); return('%'); } | ||
589 | "@" { count(); return('@'); } | ||
590 | ":" { count(); return(':'); } | ||
591 | ">" { count(); return('>'); } | ||
592 | "<" { count(); return('<'); } | ||
593 | "]" { count(); return(']'); } | ||
594 | "[" { count(); return('['); } | ||
595 | "==" { count(); return(EQ); } | ||
596 | "!=" { count(); return(NEQ); } | ||
597 | ">=" { count(); return(GEQ); } | ||
598 | "<=" { count(); return(LEQ); } | ||
599 | "&" { count(); return('&'); } | ||
600 | "|" { count(); return('|'); } | ||
601 | "^" { count(); return('^'); } | ||
602 | "~" { count(); return('~'); } | ||
603 | "!" { count(); return('!'); } | ||
604 | "&&" { count(); return(BOOLEAN_AND); } | ||
605 | "||" { count(); return(BOOLEAN_OR); } | ||
606 | "<<" { count(); return(SHIFT_LEFT); } | ||
607 | ">>" { count(); return(SHIFT_RIGHT); } | ||
608 | |||
609 | [ \t\v\n\f] { count(); } | ||
610 | . { /* ignore bad characters */ } | ||
611 | |||
612 | %% | ||
613 | |||
614 | LLScriptAllocationManager *gAllocationManager; | ||
615 | LLScriptScript *gScriptp; | ||
616 | |||
617 | // Prototype for the yacc parser entry point | ||
618 | int yyparse(void); | ||
619 | |||
620 | int yyerror(const char *fmt, ...) | ||
621 | { | ||
622 | gErrorToText.writeError(yyout, gLine, gColumn, LSERROR_SYNTAX_ERROR); | ||
623 | return 0; | ||
624 | } | ||
625 | |||
626 | #define LL_MKS_YACC 0 | ||
627 | #if LL_WINDOWS && LL_MKS_YACC | ||
628 | int yyinput(void) | ||
629 | { | ||
630 | return input(); | ||
631 | } | ||
632 | #endif | ||
633 | |||
634 | //#define EMERGENCY_DEBUG_PRINTOUTS | ||
635 | //#define EMIT_CIL_ASSEMBLER | ||
636 | |||
637 | BOOL lscript_compile(const char* src_filename, const char* dst_filename, | ||
638 | const char* err_filename, BOOL is_god_like) | ||
639 | { | ||
640 | BOOL b_parse_ok = FALSE; | ||
641 | BOOL b_dummy = FALSE; | ||
642 | U64 b_dummy_count = FALSE; | ||
643 | LSCRIPTType type = LST_NULL; | ||
644 | |||
645 | gInternalColumn = 0; | ||
646 | gInternalLine = 0; | ||
647 | gScriptp = NULL; | ||
648 | |||
649 | gErrorToText.init(); | ||
650 | init_supported_expressions(); | ||
651 | init_temp_jumps(); | ||
652 | gAllocationManager = new LLScriptAllocationManager(); | ||
653 | |||
654 | yyin = LLFile::fopen(src_filename, "r"); | ||
655 | if (yyin) | ||
656 | { | ||
657 | yyout = LLFile::fopen(err_filename, "w"); | ||
658 | |||
659 | // Reset the lexer's internal buffering. | ||
660 | #if LL_DARWIN || LL_LINUX || !LL_MKS_YACC | ||
661 | yyrestart(yyin); | ||
662 | #else | ||
663 | yy_reset(); | ||
664 | #endif | ||
665 | b_parse_ok = !yyparse(); | ||
666 | |||
667 | if (b_parse_ok) | ||
668 | { | ||
669 | #ifdef EMERGENCY_DEBUG_PRINTOUTS | ||
670 | char compiled[256]; | ||
671 | sprintf(compiled, "%s.o", src_filename); | ||
672 | FILE* compfile; | ||
673 | compfile = LLFile::fopen(compiled, "w"); | ||
674 | #endif | ||
675 | |||
676 | if(dst_filename) | ||
677 | { | ||
678 | gScriptp->setBytecodeDest(dst_filename); | ||
679 | } | ||
680 | |||
681 | gScriptp->mGodLike = is_god_like; | ||
682 | |||
683 | gScopeStringTable = new LLStringTable(16384); | ||
684 | #ifdef EMERGENCY_DEBUG_PRINTOUTS | ||
685 | gScriptp->recurse(compfile, 0, 4, LSCP_PRETTY_PRINT, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
686 | #endif | ||
687 | gScriptp->recurse(yyout, 0, 0, LSCP_PRUNE, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
688 | gScriptp->recurse(yyout, 0, 0, LSCP_SCOPE_PASS1, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
689 | gScriptp->recurse(yyout, 0, 0, LSCP_SCOPE_PASS2, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
690 | gScriptp->recurse(yyout, 0, 0, LSCP_TYPE, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
691 | if (!gErrorToText.getErrors()) | ||
692 | { | ||
693 | gScriptp->recurse(yyout, 0, 0, LSCP_RESOURCE, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
694 | #ifdef EMERGENCY_DEBUG_PRINTOUTS | ||
695 | gScriptp->recurse(yyout, 0, 0, LSCP_EMIT_ASSEMBLY, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
696 | #endif | ||
697 | #ifdef EMIT_CIL_ASSEMBLER | ||
698 | const char* cil_output_file_name = dst_filename? dst_filename : "lscript.cil"; | ||
699 | FILE* cilout = LLFile::fopen(cil_output_file_name, "w"); | ||
700 | if(NULL == cilout) | ||
701 | { | ||
702 | fprintf(yyout, "Error opening cil output file %s\n", cil_output_file_name); | ||
703 | } | ||
704 | else | ||
705 | { | ||
706 | gScriptp->recurse(cilout, 0, 0, LSCP_EMIT_CIL_ASSEMBLY, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
707 | if(fclose(cilout) == EOF) | ||
708 | { | ||
709 | fprintf(yyout, "Error closing cil output file %s\n", cil_output_file_name); | ||
710 | } | ||
711 | } | ||
712 | #endif | ||
713 | gScriptp->recurse(yyout, 0, 0, LSCP_EMIT_BYTE_CODE, LSPRUNE_INVALID, b_dummy, NULL, type, type, b_dummy_count, NULL, NULL, 0, NULL, 0, NULL); | ||
714 | } | ||
715 | delete gScopeStringTable; | ||
716 | gScopeStringTable = NULL; | ||
717 | #ifdef EMERGENCY_DEBUG_PRINTOUTS | ||
718 | fclose(compfile); | ||
719 | #endif | ||
720 | } | ||
721 | fclose(yyout); | ||
722 | } | ||
723 | |||
724 | fclose(yyin); | ||
725 | delete gAllocationManager; | ||
726 | delete gScopeStringTable; | ||
727 | |||
728 | return b_parse_ok && !gErrorToText.getErrors(); | ||
729 | } | ||
730 | |||
731 | |||
732 | BOOL lscript_compile(char *filename, BOOL is_god_like = FALSE) | ||
733 | { | ||
734 | char src_filename[MAX_STRING]; | ||
735 | sprintf(src_filename, "%s.lsl", filename); | ||
736 | char err_filename[MAX_STRING]; | ||
737 | sprintf(err_filename, "%s.out", filename); | ||
738 | return lscript_compile(src_filename, NULL, err_filename, is_god_like); | ||
739 | } | ||
740 | |||
741 | |||
742 | S32 yywrap() | ||
743 | { | ||
744 | return(1); | ||
745 | } | ||
746 | |||
747 | void comment() | ||
748 | { | ||
749 | char c; | ||
750 | |||
751 | #if LL_DARWIN | ||
752 | while ((c = yyinput()) != '\n' && c != 0 && c != EOF) | ||
753 | ; | ||
754 | #else | ||
755 | while ((c = yyinput()) != '\n' && c != 0) | ||
756 | ; | ||
757 | #endif | ||
758 | |||
759 | |||
760 | } | ||
761 | |||
762 | void count() | ||
763 | { | ||
764 | S32 i; | ||
765 | |||
766 | gColumn = gInternalColumn; | ||
767 | gLine = gInternalLine; | ||
768 | |||
769 | for (i = 0; yytext[i] != '\0'; i++) | ||
770 | if (yytext[i] == '\n') | ||
771 | { | ||
772 | gInternalLine++; | ||
773 | gInternalColumn = 0; | ||
774 | } | ||
775 | else if (yytext[i] == '\t') | ||
776 | gInternalColumn += 4 - (gInternalColumn % 8); | ||
777 | else | ||
778 | gInternalColumn++; | ||
779 | } | ||
780 | |||
781 | void parse_string() | ||
782 | { | ||
783 | S32 length = (S32)strlen(yytext); | ||
784 | length = length - 2; | ||
785 | char *temp = yytext + 1; | ||
786 | |||
787 | S32 i; | ||
788 | S32 escapes = 0; | ||
789 | S32 tabs = 0; | ||
790 | for (i = 0; i < length; i++) | ||
791 | { | ||
792 | if (temp[i] == '\\') | ||
793 | { | ||
794 | escapes++; | ||
795 | i++; | ||
796 | if (temp[i] == 't') | ||
797 | tabs++; | ||
798 | } | ||
799 | } | ||
800 | |||
801 | S32 newlength = length - escapes + tabs*3; | ||
802 | yylval.sval = new char[newlength + 1]; | ||
803 | |||
804 | char *dest = yylval.sval; | ||
805 | |||
806 | for (i = 0; i < length; i++) | ||
807 | { | ||
808 | if (temp[i] == '\\') | ||
809 | { | ||
810 | i++; | ||
811 | // linefeed | ||
812 | if (temp[i] == 'n') | ||
813 | { | ||
814 | *dest++ = 10; | ||
815 | } | ||
816 | else if (temp[i] == 't') | ||
817 | { | ||
818 | *dest++ = ' '; | ||
819 | *dest++ = ' '; | ||
820 | *dest++ = ' '; | ||
821 | *dest++ = ' '; | ||
822 | } | ||
823 | else | ||
824 | { | ||
825 | *dest++ = temp[i]; | ||
826 | } | ||
827 | } | ||
828 | else | ||
829 | { | ||
830 | *dest++ = temp[i]; | ||
831 | } | ||
832 | } | ||
833 | yylval.sval[newlength] = 0; | ||
834 | } | ||