From 420b91db29485df39fd6e724e782c449158811cb Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 2 Jan 2007 08:33:20 +0000 Subject: Print done when done. --- indra/lscript/lscript_compile/indra.y | 1680 +++++++++++++++++++++++++++++++++ 1 file changed, 1680 insertions(+) create mode 100644 indra/lscript/lscript_compile/indra.y (limited to 'indra/lscript/lscript_compile/indra.y') diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y new file mode 100644 index 0000000000..7744649a92 --- /dev/null +++ b/indra/lscript/lscript_compile/indra.y @@ -0,0 +1,1680 @@ +%{ + #include "stdtypes.h" + #include "lscript_tree.h" + + #ifdef __cplusplus + extern "C" { + #endif + + int yylex(void); + int yyparse( void ); + int yyerror(const char *fmt, ...); + + #if LL_LINUX + // broken yacc codegen... --ryan. + #define getenv getenv_workaround + #endif + + #ifdef __cplusplus + } + #endif +%} + +%union +{ + S32 ival; + F32 fval; + char *sval; + class LLScriptType *type; + class LLScriptConstant *constant; + class LLScriptIdentifier *identifier; + class LLScriptSimpleAssignable *assignable; + class LLScriptGlobalVariable *global; + class LLScriptEvent *event; + class LLScriptEventHandler *handler; + class LLScriptExpression *expression; + class LLScriptStatement *statement; + class LLScriptGlobalFunctions *global_funcs; + class LLScriptFunctionDec *global_decl; + class LLScriptState *state; + class LLScritpGlobalStorage *global_store; + class LLScriptScript *script; +}; + +%token INTEGER +%token FLOAT_TYPE +%token STRING +%token LLKEY +%token VECTOR +%token QUATERNION +%token LIST + +%token STATE_DEFAULT +%token STATE +%token EVENT +%token JUMP +%token RETURN + +%token STATE_ENTRY +%token STATE_EXIT +%token TOUCH_START +%token TOUCH +%token TOUCH_END +%token COLLISION_START +%token COLLISION +%token COLLISION_END +%token LAND_COLLISION_START +%token LAND_COLLISION +%token LAND_COLLISION_END +%token TIMER +%token CHAT +%token SENSOR +%token NO_SENSOR +%token CONTROL +%token AT_TARGET +%token NOT_AT_TARGET +%token AT_ROT_TARGET +%token NOT_AT_ROT_TARGET +%token MONEY +%token EMAIL +%token RUN_TIME_PERMISSIONS +%token INVENTORY +%token ATTACH +%token DATASERVER +%token MOVING_START +%token MOVING_END +%token REZ +%token OBJECT_REZ +%token LINK_MESSAGE +%token REMOTE_DATA +%token HTTP_RESPONSE + +%token IDENTIFIER +%token STATE_DEFAULT + +%token INTEGER_CONSTANT +%token INTEGER_TRUE +%token INTEGER_FALSE + +%token FP_CONSTANT + +%token STRING_CONSTANT + +%token INC_OP +%token DEC_OP +%token ADD_ASSIGN +%token SUB_ASSIGN +%token MUL_ASSIGN +%token DIV_ASSIGN +%token MOD_ASSIGN + +%token EQ +%token NEQ +%token GEQ +%token LEQ + +%token BOOLEAN_AND +%token BOOLEAN_OR + +%token SHIFT_LEFT +%token SHIFT_RIGHT + +%token IF +%token ELSE +%token FOR +%token DO +%token WHILE + +%token PRINT + +%token PERIOD + +%token ZERO_VECTOR +%token ZERO_ROTATION + +%nonassoc LOWER_THAN_ELSE +%nonassoc ELSE + + +%type