summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_compile/indra.y
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript/lscript_compile/indra.y')
-rw-r--r--indra/lscript/lscript_compile/indra.y71
1 files changed, 71 insertions, 0 deletions
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