summaryrefslogtreecommitdiff
path: root/indra/lscript
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript')
-rw-r--r--indra/lscript/lscript_compile/indra.l7
-rw-r--r--indra/lscript/lscript_compile/indra.y71
2 files changed, 77 insertions, 1 deletions
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 49ed6fc5ee..3e62195dc8 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -611,6 +611,11 @@ extern "C" { int yyerror(const char *fmt, ...); }
"TEXTURE_PLYWOOD" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "89556747-24cb-43ed-920b-47caed15465f"); return(STRING_CONSTANT); }
"TEXTURE_TRANSPARENT" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); return(STRING_CONSTANT); }
+"TOUCH_INVALID_FACE" { count(); yylval.ival = -1; return(INTEGER_CONSTANT); }
+"TOUCH_INVALID_VECTOR" { count(); return(TOUCH_INVALID_VECTOR); }
+"TOUCH_INVALID_TEXCOORD" { count(); return(TOUCH_INVALID_TEXCOORD); }
+
+
{L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); }
{N}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); }
@@ -752,8 +757,8 @@ BOOL lscript_compile(const char* src_filename, const char* dst_filename,
#ifdef EMERGENCY_DEBUG_PRINTOUTS
fclose(compfile);
#endif
- fclose(yyout);
}
+ fclose(yyout);
fclose(yyin);
}
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y
index d10cbfedba..fdc240c772 100644
--- a/indra/lscript/lscript_compile/indra.y
+++ b/indra/lscript/lscript_compile/indra.y
@@ -136,6 +136,9 @@
%token ZERO_VECTOR
%token ZERO_ROTATION
+%token TOUCH_INVALID_VECTOR
+%token TOUCH_INVALID_TEXCOORD
+
%nonassoc LOWER_THAN_ELSE
%nonassoc ELSE
@@ -439,6 +442,40 @@ vector_constant
$$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2);
gAllocationManager->addAllocation($$);
}
+ | TOUCH_INVALID_VECTOR
+ {
+ LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf0);
+ LLScriptSAConstant *sa0 = new LLScriptSAConstant(gLine, gColumn, cf0);
+ gAllocationManager->addAllocation(sa0);
+ LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf1);
+ LLScriptSAConstant *sa1 = new LLScriptSAConstant(gLine, gColumn, cf1);
+ gAllocationManager->addAllocation(sa1);
+ LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf2);
+ LLScriptSAConstant *sa2 = new LLScriptSAConstant(gLine, gColumn, cf2);
+ gAllocationManager->addAllocation(sa2);
+ $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2);
+ gAllocationManager->addAllocation($$);
+ }
+ | TOUCH_INVALID_TEXCOORD
+ {
+ LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, -1.f);
+ gAllocationManager->addAllocation(cf0);
+ LLScriptSAConstant *sa0 = new LLScriptSAConstant(gLine, gColumn, cf0);
+ gAllocationManager->addAllocation(sa0);
+ LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, -1.f);
+ gAllocationManager->addAllocation(cf1);
+ LLScriptSAConstant *sa1 = new LLScriptSAConstant(gLine, gColumn, cf1);
+ gAllocationManager->addAllocation(sa1);
+ LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf2);
+ LLScriptSAConstant *sa2 = new LLScriptSAConstant(gLine, gColumn, cf2);
+ gAllocationManager->addAllocation(sa2);
+ $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2);
+ gAllocationManager->addAllocation($$);
+ }
;
quaternion_constant
@@ -1645,6 +1682,40 @@ vector_initializer
$$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2);
gAllocationManager->addAllocation($$);
}
+ | TOUCH_INVALID_VECTOR
+ {
+ LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf0);
+ LLScriptConstantExpression *sa0 = new LLScriptConstantExpression(gLine, gColumn, cf0);
+ gAllocationManager->addAllocation(sa0);
+ LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf1);
+ LLScriptConstantExpression *sa1 = new LLScriptConstantExpression(gLine, gColumn, cf1);
+ gAllocationManager->addAllocation(sa1);
+ LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf2);
+ LLScriptConstantExpression *sa2 = new LLScriptConstantExpression(gLine, gColumn, cf2);
+ gAllocationManager->addAllocation(sa2);
+ $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2);
+ gAllocationManager->addAllocation($$);
+ }
+ | TOUCH_INVALID_TEXCOORD
+ {
+ LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, -1.f);
+ gAllocationManager->addAllocation(cf0);
+ LLScriptConstantExpression *sa0 = new LLScriptConstantExpression(gLine, gColumn, cf0);
+ gAllocationManager->addAllocation(sa0);
+ LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, -1.f);
+ gAllocationManager->addAllocation(cf1);
+ LLScriptConstantExpression *sa1 = new LLScriptConstantExpression(gLine, gColumn, cf1);
+ gAllocationManager->addAllocation(sa1);
+ LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f);
+ gAllocationManager->addAllocation(cf2);
+ LLScriptConstantExpression *sa2 = new LLScriptConstantExpression(gLine, gColumn, cf2);
+ gAllocationManager->addAllocation(sa2);
+ $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2);
+ gAllocationManager->addAllocation($$);
+ }
;
quaternion_initializer