diff options
author | Jacek Antonelli | 2008-09-12 14:59:33 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-12 14:59:39 -0500 |
commit | 80a8bab2a9dd8e77262b001af973212a6cba4a5a (patch) | |
tree | 170168232fd4e2eec5f15295a9445535969cdb76 /linden/indra/lscript | |
parent | Second Life viewer sources 1.21.1-RC (diff) | |
download | meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.zip meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.gz meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.bz2 meta-impy-80a8bab2a9dd8e77262b001af973212a6cba4a5a.tar.xz |
Second Life viewer sources 1.21.2-RC
Diffstat (limited to 'linden/indra/lscript')
-rw-r--r-- | linden/indra/lscript/lscript_compile/indra.l | 5 | ||||
-rw-r--r-- | linden/indra/lscript/lscript_compile/indra.y | 71 |
2 files changed, 76 insertions, 0 deletions
diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 4cfe199..3e62195 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/indra/lscript/lscript_compile/indra.l | |||
@@ -611,6 +611,11 @@ extern "C" { int yyerror(const char *fmt, ...); } | |||
611 | "TEXTURE_PLYWOOD" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "89556747-24cb-43ed-920b-47caed15465f"); return(STRING_CONSTANT); } | 611 | "TEXTURE_PLYWOOD" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "89556747-24cb-43ed-920b-47caed15465f"); return(STRING_CONSTANT); } |
612 | "TEXTURE_TRANSPARENT" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); return(STRING_CONSTANT); } | 612 | "TEXTURE_TRANSPARENT" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); return(STRING_CONSTANT); } |
613 | 613 | ||
614 | "TOUCH_INVALID_FACE" { count(); yylval.ival = -1; return(INTEGER_CONSTANT); } | ||
615 | "TOUCH_INVALID_VECTOR" { count(); return(TOUCH_INVALID_VECTOR); } | ||
616 | "TOUCH_INVALID_TEXCOORD" { count(); return(TOUCH_INVALID_TEXCOORD); } | ||
617 | |||
618 | |||
614 | {L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); } | 619 | {L}({L}|{N})* { count(); yylval.sval = new char[strlen(yytext) + 1]; strcpy(yylval.sval, yytext); return(IDENTIFIER); } |
615 | 620 | ||
616 | {N}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } | 621 | {N}+{E} { count(); yylval.fval = (F32)atof(yytext); return(FP_CONSTANT); } |
diff --git a/linden/indra/lscript/lscript_compile/indra.y b/linden/indra/lscript/lscript_compile/indra.y index d10cbfe..fdc240c 100644 --- a/linden/indra/lscript/lscript_compile/indra.y +++ b/linden/indra/lscript/lscript_compile/indra.y | |||
@@ -136,6 +136,9 @@ | |||
136 | %token ZERO_VECTOR | 136 | %token ZERO_VECTOR |
137 | %token ZERO_ROTATION | 137 | %token ZERO_ROTATION |
138 | 138 | ||
139 | %token TOUCH_INVALID_VECTOR | ||
140 | %token TOUCH_INVALID_TEXCOORD | ||
141 | |||
139 | %nonassoc LOWER_THAN_ELSE | 142 | %nonassoc LOWER_THAN_ELSE |
140 | %nonassoc ELSE | 143 | %nonassoc ELSE |
141 | 144 | ||
@@ -439,6 +442,40 @@ vector_constant | |||
439 | $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2); | 442 | $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2); |
440 | gAllocationManager->addAllocation($$); | 443 | gAllocationManager->addAllocation($$); |
441 | } | 444 | } |
445 | | TOUCH_INVALID_VECTOR | ||
446 | { | ||
447 | LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
448 | gAllocationManager->addAllocation(cf0); | ||
449 | LLScriptSAConstant *sa0 = new LLScriptSAConstant(gLine, gColumn, cf0); | ||
450 | gAllocationManager->addAllocation(sa0); | ||
451 | LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
452 | gAllocationManager->addAllocation(cf1); | ||
453 | LLScriptSAConstant *sa1 = new LLScriptSAConstant(gLine, gColumn, cf1); | ||
454 | gAllocationManager->addAllocation(sa1); | ||
455 | LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
456 | gAllocationManager->addAllocation(cf2); | ||
457 | LLScriptSAConstant *sa2 = new LLScriptSAConstant(gLine, gColumn, cf2); | ||
458 | gAllocationManager->addAllocation(sa2); | ||
459 | $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2); | ||
460 | gAllocationManager->addAllocation($$); | ||
461 | } | ||
462 | | TOUCH_INVALID_TEXCOORD | ||
463 | { | ||
464 | LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, -1.f); | ||
465 | gAllocationManager->addAllocation(cf0); | ||
466 | LLScriptSAConstant *sa0 = new LLScriptSAConstant(gLine, gColumn, cf0); | ||
467 | gAllocationManager->addAllocation(sa0); | ||
468 | LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, -1.f); | ||
469 | gAllocationManager->addAllocation(cf1); | ||
470 | LLScriptSAConstant *sa1 = new LLScriptSAConstant(gLine, gColumn, cf1); | ||
471 | gAllocationManager->addAllocation(sa1); | ||
472 | LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
473 | gAllocationManager->addAllocation(cf2); | ||
474 | LLScriptSAConstant *sa2 = new LLScriptSAConstant(gLine, gColumn, cf2); | ||
475 | gAllocationManager->addAllocation(sa2); | ||
476 | $$ = new LLScriptSAVector(gLine, gColumn, sa0, sa1, sa2); | ||
477 | gAllocationManager->addAllocation($$); | ||
478 | } | ||
442 | ; | 479 | ; |
443 | 480 | ||
444 | quaternion_constant | 481 | quaternion_constant |
@@ -1645,6 +1682,40 @@ vector_initializer | |||
1645 | $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2); | 1682 | $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2); |
1646 | gAllocationManager->addAllocation($$); | 1683 | gAllocationManager->addAllocation($$); |
1647 | } | 1684 | } |
1685 | | TOUCH_INVALID_VECTOR | ||
1686 | { | ||
1687 | LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
1688 | gAllocationManager->addAllocation(cf0); | ||
1689 | LLScriptConstantExpression *sa0 = new LLScriptConstantExpression(gLine, gColumn, cf0); | ||
1690 | gAllocationManager->addAllocation(sa0); | ||
1691 | LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
1692 | gAllocationManager->addAllocation(cf1); | ||
1693 | LLScriptConstantExpression *sa1 = new LLScriptConstantExpression(gLine, gColumn, cf1); | ||
1694 | gAllocationManager->addAllocation(sa1); | ||
1695 | LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
1696 | gAllocationManager->addAllocation(cf2); | ||
1697 | LLScriptConstantExpression *sa2 = new LLScriptConstantExpression(gLine, gColumn, cf2); | ||
1698 | gAllocationManager->addAllocation(sa2); | ||
1699 | $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2); | ||
1700 | gAllocationManager->addAllocation($$); | ||
1701 | } | ||
1702 | | TOUCH_INVALID_TEXCOORD | ||
1703 | { | ||
1704 | LLScriptConstantFloat *cf0 = new LLScriptConstantFloat(gLine, gColumn, -1.f); | ||
1705 | gAllocationManager->addAllocation(cf0); | ||
1706 | LLScriptConstantExpression *sa0 = new LLScriptConstantExpression(gLine, gColumn, cf0); | ||
1707 | gAllocationManager->addAllocation(sa0); | ||
1708 | LLScriptConstantFloat *cf1 = new LLScriptConstantFloat(gLine, gColumn, -1.f); | ||
1709 | gAllocationManager->addAllocation(cf1); | ||
1710 | LLScriptConstantExpression *sa1 = new LLScriptConstantExpression(gLine, gColumn, cf1); | ||
1711 | gAllocationManager->addAllocation(sa1); | ||
1712 | LLScriptConstantFloat *cf2 = new LLScriptConstantFloat(gLine, gColumn, 0.f); | ||
1713 | gAllocationManager->addAllocation(cf2); | ||
1714 | LLScriptConstantExpression *sa2 = new LLScriptConstantExpression(gLine, gColumn, cf2); | ||
1715 | gAllocationManager->addAllocation(sa2); | ||
1716 | $$ = new LLScriptVectorInitializer(gLine, gColumn, sa0, sa1, sa2); | ||
1717 | gAllocationManager->addAllocation($$); | ||
1718 | } | ||
1648 | ; | 1719 | ; |
1649 | 1720 | ||
1650 | quaternion_initializer | 1721 | quaternion_initializer |