aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lscript/lscript_compile
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/lscript/lscript_compile')
-rw-r--r--linden/indra/lscript/lscript_compile/indra.l51
-rw-r--r--linden/indra/lscript/lscript_compile/indra.y21
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_alloc.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_error.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_error.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_heap.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_heap.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_resource.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_resource.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_scope.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_scope.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.cpp116
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.h33
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_typecheck.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_typecheck.h3
17 files changed, 229 insertions, 31 deletions
diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l
index 3e62195..ac52432 100644
--- a/linden/indra/lscript/lscript_compile/indra.l
+++ b/linden/indra/lscript/lscript_compile/indra.l
@@ -36,7 +36,8 @@ FS (f|F)
36#include "llclickaction.h" 36#include "llclickaction.h"
37 37
38void count(); 38void count();
39void comment(); 39void line_comment();
40void block_comment();
40void parse_string(); 41void parse_string();
41 42
42#define YYLMAX 16384 43#define YYLMAX 16384
@@ -60,7 +61,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
60%} 61%}
61 62
62%% 63%%
63"//" { gInternalLine++; gInternalColumn = 0; comment(); } 64"//" { gInternalLine++; gInternalColumn = 0; line_comment(); }
65"/*" { block_comment(); }
64 66
65"integer" { count(); return(INTEGER); } 67"integer" { count(); return(INTEGER); }
66"float" { count(); return(FLOAT_TYPE); } 68"float" { count(); return(FLOAT_TYPE); }
@@ -116,6 +118,7 @@ extern "C" { int yyerror(const char *fmt, ...); }
116"object_rez" { count(); return(OBJECT_REZ); } 118"object_rez" { count(); return(OBJECT_REZ); }
117"remote_data" { count(); return(REMOTE_DATA); } 119"remote_data" { count(); return(REMOTE_DATA); }
118"http_response" { count(); return(HTTP_RESPONSE); } 120"http_response" { count(); return(HTTP_RESPONSE); }
121"http_request" { count(); return(HTTP_REQUEST); }
119"." { count(); return(PERIOD); } 122"." { count(); return(PERIOD); }
120 123
121 124
@@ -219,16 +222,17 @@ extern "C" { int yyerror(const char *fmt, ...); }
219"INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } 222"INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); }
220"INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } 223"INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); }
221 224
222"CHANGED_INVENTORY" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } 225"CHANGED_INVENTORY" { count(); yylval.ival = CHANGED_INVENTORY; return(INTEGER_CONSTANT); }
223"CHANGED_COLOR" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } 226"CHANGED_COLOR" { count(); yylval.ival = CHANGED_COLOR; return(INTEGER_CONSTANT); }
224"CHANGED_SHAPE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } 227"CHANGED_SHAPE" { count(); yylval.ival = CHANGED_SHAPE; return(INTEGER_CONSTANT); }
225"CHANGED_SCALE" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } 228"CHANGED_SCALE" { count(); yylval.ival = CHANGED_SCALE; return(INTEGER_CONSTANT); }
226"CHANGED_TEXTURE" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } 229"CHANGED_TEXTURE" { count(); yylval.ival = CHANGED_TEXTURE; return(INTEGER_CONSTANT); }
227"CHANGED_LINK" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } 230"CHANGED_LINK" { count(); yylval.ival = CHANGED_LINK; return(INTEGER_CONSTANT); }
228"CHANGED_ALLOWED_DROP" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } 231"CHANGED_ALLOWED_DROP" { count(); yylval.ival = CHANGED_ALLOWED_DROP; return(INTEGER_CONSTANT); }
229"CHANGED_OWNER" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } 232"CHANGED_OWNER" { count(); yylval.ival = CHANGED_OWNER; return(INTEGER_CONSTANT); }
230"CHANGED_REGION" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } 233"CHANGED_REGION" { count(); yylval.ival = CHANGED_REGION; return(INTEGER_CONSTANT); }
231"CHANGED_TELEPORT" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } 234"CHANGED_TELEPORT" { count(); yylval.ival = CHANGED_TELEPORT; return(INTEGER_CONSTANT); }
235"CHANGED_REGION_START" { count(); yylval.ival = CHANGED_REGION_START; return(INTEGER_CONSTANT); }
232 236
233"OBJECT_UNKNOWN_DETAIL" { count(); yylval.ival = OBJECT_UNKNOWN_DETAIL; return(INTEGER_CONSTANT); } 237"OBJECT_UNKNOWN_DETAIL" { count(); yylval.ival = OBJECT_UNKNOWN_DETAIL; return(INTEGER_CONSTANT); }
234"OBJECT_NAME" { count(); yylval.ival = OBJECT_NAME; return(INTEGER_CONSTANT); } 238"OBJECT_NAME" { count(); yylval.ival = OBJECT_NAME; return(INTEGER_CONSTANT); }
@@ -250,6 +254,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
250 254
251"NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); } 255"NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); }
252"EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); } 256"EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); }
257"URL_REQUEST_GRANTED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_GRANTED); return(STRING_CONSTANT); }
258"URL_REQUEST_DENIED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_DENIED); return(STRING_CONSTANT); }
253 259
254"PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); } 260"PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); }
255"TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); } 261"TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); }
@@ -790,7 +796,7 @@ S32 yywrap()
790 return(1); 796 return(1);
791} 797}
792 798
793void comment() 799void line_comment()
794{ 800{
795 char c; 801 char c;
796 802
@@ -798,6 +804,25 @@ void comment()
798 ; 804 ;
799} 805}
800 806
807void block_comment()
808{
809 char c1 = 0;
810 char c2 = yyinput();
811 while (c2 != 0 && c2 != EOF && !(c1 == '*' && c2 == '/')) {
812 if (c2 == '\n')
813 {
814 gInternalLine++;
815 gInternalColumn = 0;
816 }
817 else if (c2 == '\t')
818 gInternalColumn += 4 - (gInternalColumn % 8);
819 else
820 gInternalColumn++;
821 c1 = c2;
822 c2 = yyinput();
823 }
824}
825
801void count() 826void count()
802{ 827{
803 S32 i; 828 S32 i;
diff --git a/linden/indra/lscript/lscript_compile/indra.y b/linden/indra/lscript/lscript_compile/indra.y
index fdc240c..e4b10ff 100644
--- a/linden/indra/lscript/lscript_compile/indra.y
+++ b/linden/indra/lscript/lscript_compile/indra.y
@@ -92,6 +92,7 @@
92%token LINK_MESSAGE 92%token LINK_MESSAGE
93%token REMOTE_DATA 93%token REMOTE_DATA
94%token HTTP_RESPONSE 94%token HTTP_RESPONSE
95%token HTTP_REQUEST
95 96
96%token <sval> IDENTIFIER 97%token <sval> IDENTIFIER
97%token <sval> STATE_DEFAULT 98%token <sval> STATE_DEFAULT
@@ -195,6 +196,7 @@
195%type <event> object_rez 196%type <event> object_rez
196%type <event> remote_data 197%type <event> remote_data
197%type <event> http_response 198%type <event> http_response
199%type <event> http_request
198%type <event> link_message 200%type <event> link_message
199%type <event> timer 201%type <event> timer
200%type <event> chat 202%type <event> chat
@@ -848,6 +850,11 @@ event
848 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2); 850 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
849 gAllocationManager->addAllocation($$); 851 gAllocationManager->addAllocation($$);
850 } 852 }
853 | http_request compound_statement
854 {
855 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
856 gAllocationManager->addAllocation($$);
857 }
851 ; 858 ;
852 859
853state_entry 860state_entry
@@ -1216,6 +1223,20 @@ http_response
1216 } 1223 }
1217 ; 1224 ;
1218 1225
1226http_request
1227 : HTTP_REQUEST '(' LLKEY IDENTIFIER ',' STRING IDENTIFIER ',' STRING IDENTIFIER ')'
1228 {
1229 LLScriptIdentifier *id1 = new LLScriptIdentifier(gLine, gColumn, $4);
1230 gAllocationManager->addAllocation(id1);
1231 LLScriptIdentifier *id2 = new LLScriptIdentifier(gLine, gColumn, $7);
1232 gAllocationManager->addAllocation(id2);
1233 LLScriptIdentifier *id3 = new LLScriptIdentifier(gLine, gColumn, $10);
1234 gAllocationManager->addAllocation(id3);
1235 $$ = new LLScriptHTTPRequestEvent(gLine, gColumn, id1, id2, id3);
1236 gAllocationManager->addAllocation($$);
1237 }
1238 ;
1239
1219compound_statement 1240compound_statement
1220 : '{' '}' 1241 : '{' '}'
1221 { 1242 {
diff --git a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
index f522e18..76713de 100644
--- a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
index f6e5127..9cd7d48 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.h b/linden/indra/lscript/lscript_compile/lscript_bytecode.h
index c9f8633..5e2789d 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.h
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_error.cpp b/linden/indra/lscript/lscript_compile/lscript_error.cpp
index 5bdf2a2..c1a765b 100644
--- a/linden/indra/lscript/lscript_compile/lscript_error.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_error.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_error.h b/linden/indra/lscript/lscript_compile/lscript_error.h
index 2f8f8bc..95f48a4 100644
--- a/linden/indra/lscript/lscript_compile/lscript_error.h
+++ b/linden/indra/lscript/lscript_compile/lscript_error.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.cpp b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
index 5dccce9..b4d2764 100644
--- a/linden/indra/lscript/lscript_compile/lscript_heap.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.h b/linden/indra/lscript/lscript_compile/lscript_heap.h
index ced4609..b1a4b5c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_heap.h
+++ b/linden/indra/lscript/lscript_compile/lscript_heap.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.cpp b/linden/indra/lscript/lscript_compile/lscript_resource.cpp
index eb23665..c5eff1c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_resource.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_resource.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.h b/linden/indra/lscript/lscript_compile/lscript_resource.h
index f69e605..ede8b03 100644
--- a/linden/indra/lscript/lscript_compile/lscript_resource.h
+++ b/linden/indra/lscript/lscript_compile/lscript_resource.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.cpp b/linden/indra/lscript/lscript_compile/lscript_scope.cpp
index 95a8eae..e6a7940 100644
--- a/linden/indra/lscript/lscript_compile/lscript_scope.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_scope.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.h b/linden/indra/lscript/lscript_compile/lscript_scope.h
index 31125bc..ec36d37 100644
--- a/linden/indra/lscript/lscript_compile/lscript_scope.h
+++ b/linden/indra/lscript/lscript_compile/lscript_scope.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
index 2a41d91..e291d4c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -630,7 +631,9 @@ static void print_cil_cast(LLFILE* fp, LSCRIPTType srcType, LSCRIPTType targetTy
630 switch(targetType) 631 switch(targetType)
631 { 632 {
632 case LST_INTEGER: 633 case LST_INTEGER:
633 fprintf(fp, "conv.i4\n"); 634 //fprintf(fp, "call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)\n");
635 fprintf(fp, "conv.i4\n"); // TODO replace this line with the above
636 // we the entire grid is > 1.25.1
634 break; 637 break;
635 case LST_STRING: 638 case LST_STRING:
636 fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n"); 639 fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n");
@@ -3288,6 +3291,110 @@ S32 LLScriptHTTPResponseEvent::getSize()
3288 return 16; 3291 return 16;
3289} 3292}
3290 3293
3294void LLScriptHTTPRequestEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata)
3295{
3296 if (gErrorToText.getErrors())
3297 {
3298 return;
3299 }
3300 switch(pass)
3301 {
3302 case LSCP_PRETTY_PRINT:
3303 case LSCP_EMIT_ASSEMBLY:
3304 fdotabs(fp, tabs, tabsize);
3305 fprintf(fp, "http_request( key ");
3306 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3307 fprintf(fp, ", string ");
3308 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3309 fprintf(fp, ", string ");
3310 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3311 fprintf(fp, " )\n");
3312 break;
3313
3314 case LSCP_SCOPE_PASS1:
3315 checkForDuplicateHandler(fp, this, scope, "http_request");
3316 if (scope->checkEntry(mRequestId->mName))
3317 {
3318 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3319 }
3320 else
3321 {
3322 mRequestId->mScopeEntry = scope->addEntry(mRequestId->mName, LIT_VARIABLE, LST_KEY);
3323 }
3324
3325 if (scope->checkEntry(mMethod->mName))
3326 {
3327 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3328 }
3329 else
3330 {
3331 mMethod->mScopeEntry = scope->addEntry(mMethod->mName, LIT_VARIABLE, LST_STRING);
3332 }
3333
3334 if (scope->checkEntry(mBody->mName))
3335 {
3336 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3337 }
3338 else
3339 {
3340 mBody->mScopeEntry = scope->addEntry(mBody->mName, LIT_VARIABLE, LST_STRING);
3341 }
3342 break;
3343
3344 case LSCP_RESOURCE:
3345 {
3346 // we're just tryng to determine how much space the variable needs
3347 if (mRequestId->mScopeEntry)
3348 {
3349 mRequestId->mScopeEntry->mOffset = (S32)count;
3350 mRequestId->mScopeEntry->mSize = 4;
3351 count += mRequestId->mScopeEntry->mSize;
3352
3353 mMethod->mScopeEntry->mOffset = (S32)count;
3354 mMethod->mScopeEntry->mSize = 4;
3355 count += mMethod->mScopeEntry->mSize;
3356
3357 mBody->mScopeEntry->mOffset = (S32)count;
3358 mBody->mScopeEntry->mSize = 4;
3359 count += mBody->mScopeEntry->mSize;
3360 }
3361 }
3362 break;
3363
3364 case LSCP_EMIT_BYTE_CODE:
3365 {
3366#ifdef LSL_INCLUDE_DEBUG_INFO
3367 char name[] = "http_request";
3368 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3369 chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/
3370 chunk->addBytes(mMethod->mName, strlen(mMethod->mName) + 1); /*Flawfinder: ignore*/
3371 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
3372#endif
3373 }
3374 break;
3375 case LSCP_EMIT_CIL_ASSEMBLY:
3376 fdotabs(fp, tabs, tabsize);
3377 fprintf(fp, "http_request( valuetype [ScriptTypes]LindenLab.SecondLife.Key ");
3378 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3379 fprintf(fp, ", string ");
3380 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3381 fprintf(fp, ", string ");
3382 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3383 fprintf(fp, " )\n");
3384 break;
3385 default:
3386 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3387 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3388 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3389 break;
3390 }
3391}
3392
3393S32 LLScriptHTTPRequestEvent::getSize()
3394{
3395 // key + string + string = 12
3396 return 12;
3397}
3291 3398
3292void LLScriptMoneyEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata) 3399void LLScriptMoneyEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata)
3293{ 3400{
@@ -9655,6 +9762,11 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
9655 mScopeEntry->mFunctionArgs.addType(LST_LIST); 9762 mScopeEntry->mFunctionArgs.addType(LST_LIST);
9656 mScopeEntry->mFunctionArgs.addType(LST_STRING); 9763 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9657 break; 9764 break;
9765 case LSTT_HTTP_REQUEST:
9766 mScopeEntry->mFunctionArgs.addType(LST_KEY);
9767 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9768 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9769 break;
9658 9770
9659 default: 9771 default:
9660 break; 9772 break;
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.h b/linden/indra/lscript/lscript_compile/lscript_tree.h
index 0e110f5..12c1690 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.h
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -758,12 +759,12 @@ class LLScriptHTTPResponseEvent : public LLScriptEvent
758{ 759{
759public: 760public:
760 LLScriptHTTPResponseEvent(S32 line, S32 col, 761 LLScriptHTTPResponseEvent(S32 line, S32 col,
761 LLScriptIdentifier *reqeust_id, 762 LLScriptIdentifier *request_id,
762 LLScriptIdentifier *status, 763 LLScriptIdentifier *status,
763 LLScriptIdentifier *metadata, 764 LLScriptIdentifier *metadata,
764 LLScriptIdentifier *body) 765 LLScriptIdentifier *body)
765 : LLScriptEvent(line, col, LSTT_HTTP_RESPONSE), 766 : LLScriptEvent(line, col, LSTT_HTTP_RESPONSE),
766 mRequestId(reqeust_id), mStatus(status), mMetadata(metadata), mBody(body) 767 mRequestId(request_id), mStatus(status), mMetadata(metadata), mBody(body)
767 { 768 {
768 } 769 }
769 770
@@ -782,6 +783,32 @@ public:
782 LLScriptIdentifier *mBody; 783 LLScriptIdentifier *mBody;
783}; 784};
784 785
786class LLScriptHTTPRequestEvent : public LLScriptEvent
787{
788public:
789 LLScriptHTTPRequestEvent(S32 line, S32 col,
790 LLScriptIdentifier *request_id,
791 LLScriptIdentifier *method,
792 LLScriptIdentifier *body)
793 : LLScriptEvent(line, col, LSTT_HTTP_REQUEST),
794 mRequestId(request_id), mMethod(method), mBody(body)
795 {
796 }
797
798 void recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass,
799 LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope,
800 LSCRIPTType &type, LSCRIPTType basetype, U64 &count,
801 LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap,
802 S32 stacksize, LLScriptScopeEntry *entry,
803 S32 entrycount, LLScriptLibData **ldata);
804
805 S32 getSize();
806
807 LLScriptIdentifier *mRequestId;
808 LLScriptIdentifier *mMethod;
809 LLScriptIdentifier *mBody;
810};
811
785class LLScriptRezEvent : public LLScriptEvent 812class LLScriptRezEvent : public LLScriptEvent
786{ 813{
787public: 814public:
diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
index ed01cdd..6a409b8 100644
--- a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.h b/linden/indra/lscript/lscript_compile/lscript_typecheck.h
index 7e3a35d..cebe3ce 100644
--- a/linden/indra/lscript/lscript_compile/lscript_typecheck.h
+++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,