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.y92
1 files changed, 92 insertions, 0 deletions
diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y
index d10cbfedba..e4b10ffdd9 100644
--- a/indra/lscript/lscript_compile/indra.y
+++ b/indra/lscript/lscript_compile/indra.y
@@ -92,6 +92,7 @@
%token LINK_MESSAGE
%token REMOTE_DATA
%token HTTP_RESPONSE
+%token HTTP_REQUEST
%token <sval> IDENTIFIER
%token <sval> STATE_DEFAULT
@@ -136,6 +137,9 @@
%token ZERO_VECTOR
%token ZERO_ROTATION
+%token TOUCH_INVALID_VECTOR
+%token TOUCH_INVALID_TEXCOORD
+
%nonassoc LOWER_THAN_ELSE
%nonassoc ELSE
@@ -192,6 +196,7 @@
%type <event> object_rez
%type <event> remote_data
%type <event> http_response
+%type <event> http_request
%type <event> link_message
%type <event> timer
%type <event> chat
@@ -439,6 +444,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
@@ -811,6 +850,11 @@ event
$$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
gAllocationManager->addAllocation($$);
}
+ | http_request compound_statement
+ {
+ $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
+ gAllocationManager->addAllocation($$);
+ }
;
state_entry
@@ -1179,6 +1223,20 @@ http_response
}
;
+http_request
+ : HTTP_REQUEST '(' LLKEY IDENTIFIER ',' STRING IDENTIFIER ',' STRING IDENTIFIER ')'
+ {
+ LLScriptIdentifier *id1 = new LLScriptIdentifier(gLine, gColumn, $4);
+ gAllocationManager->addAllocation(id1);
+ LLScriptIdentifier *id2 = new LLScriptIdentifier(gLine, gColumn, $7);
+ gAllocationManager->addAllocation(id2);
+ LLScriptIdentifier *id3 = new LLScriptIdentifier(gLine, gColumn, $10);
+ gAllocationManager->addAllocation(id3);
+ $$ = new LLScriptHTTPRequestEvent(gLine, gColumn, id1, id2, id3);
+ gAllocationManager->addAllocation($$);
+ }
+ ;
+
compound_statement
: '{' '}'
{
@@ -1645,6 +1703,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