From 22042d5823770cbfc2dfe8e5204aeca8bbd07a5e Mon Sep 17 00:00:00 2001 From: johans Date: Fri, 6 Mar 2009 12:04:11 +0000 Subject: - Update bison to 2.4.1, see announcements for important changes: http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00000.html http://lists.gnu.org/archive/html/bug-bison/2008-12/msg00000.html - Take over bison maintainership - as approved by portmgr (marcus) - Add patches for ports to compile with new bison: Replace %{ .. %} with %code { .. } where required and accommodate stricter typing requirements Thanks to pav for an exp-run on pointyhat PR: ports/131640 Approved by: portmgr (pav) --- graphics/flasm/files/patch-assembler.y | 257 +++++++++++++++++++++ .../files/patch-src_actioncompiler_swf5compiler.y | 23 ++ 2 files changed, 280 insertions(+) create mode 100644 graphics/flasm/files/patch-assembler.y create mode 100644 graphics/ming/files/patch-src_actioncompiler_swf5compiler.y (limited to 'graphics') diff --git a/graphics/flasm/files/patch-assembler.y b/graphics/flasm/files/patch-assembler.y new file mode 100644 index 000000000000..476d16639901 --- /dev/null +++ b/graphics/flasm/files/patch-assembler.y @@ -0,0 +1,257 @@ +http://sourceforge.net/tracker/index.php?func=detail&aid=2615264&group_id=33473&atid=408391 +diff -up assembler.y.midrule assembler.y +--- assembler.y.midrule 2008-12-20 22:44:50.000000000 +0100 ++++ assembler.y 2008-12-20 22:54:03.000000000 +0100 +@@ -605,24 +605,24 @@ finally_opt + + trycatchfinally + : TRY name_opt { +- $$ = writeByte(SWFACTION_TRY); ++ $$ = writeByte(SWFACTION_TRY); + /* action length */ +- $$ += writeShort(strlen($2)+8); ++ $$ += writeShort(strlen($2)+8); + /* zero flag */ +- $$ += writeByte(0); ++ $$ += writeByte(0); + /* zero try length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* zero catch length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* zero finally length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* error variable name */ +- $$ += writeString($2); ++ $$ += writeString($2); + } + +- statements_opt { $$ = $3 + $4; patchLength($$ - 6, $4); } +- catch_opt { $$ = $5 + $6; patchLength($$ - 8, $6); } +- finally_opt { $$ = $7 + $8; patchLength($$ - 10, $8); } ++ statements_opt { $$ = $3 + $4; patchLength($$ - 6, $4); } ++ catch_opt { $$ = $5 + $6; patchLength($$ - 8, $6); } ++ finally_opt { $$ = $7 + $8; patchLength($$ - 10, $8); } + END { + byte flag = 0; + $$ = $9; +@@ -634,24 +634,24 @@ trycatchfinally + } + + | TRY register { +- $$ = writeByte(SWFACTION_TRY); ++ $$ = writeByte(SWFACTION_TRY); + /* action length */ +- $$ += writeShort(8); ++ $$ += writeShort(8); + /* zero flag */ +- $$ += writeByte(0); ++ $$ += writeByte(0); + /* zero try length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* zero catch length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* zero finally length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* error register number */ +- $$ += writeByte((byte) $2); ++ $$ += writeByte((byte) $2); + } + +- statements_opt { $$ = $3 + $4; patchLength($$ - 6, $4); } +- catch_opt { $$ = $5 + $6; patchLength($$ - 8, $6); } +- finally_opt { $$ = $7 + $8; patchLength($$ - 10, $8); } ++ statements_opt { $$ = $3 + $4; patchLength($$ - 6, $4); } ++ catch_opt { $$ = $5 + $6; patchLength($$ - 8, $6); } ++ finally_opt { $$ = $7 + $8; patchLength($$ - 10, $8); } + END { + byte flag = 4; + $$ = $9; +@@ -707,25 +707,25 @@ name_opt + + function + : FUNCTION name_opt { +- $$ = writeByte(SWFACTION_DEFINEFUNCTION); ++ $$ = writeByte(SWFACTION_DEFINEFUNCTION); + /* zero block length */ +- $$ += writeShort(0); +- $$ += writeString($2); ++ $$ += writeShort(0); ++ $$ += writeString($2); + } + + '(' function_args ')' { + unsigned int i; + numArgs = $5; + +- $$ = $3 + writeShort(numArgs); ++ $$ = $3 + writeShort(numArgs); + + for(i = 0; i < numArgs; ++i) +- $$ += writeString(func_args[i]); ++ $$ += writeString(func_args[i]); + + /* zero function length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* patch block length */ +- patchLength($$-3, $$-3); ++ patchLength($$-3, $$-3); + } + + statements_opt END { +@@ -837,25 +837,25 @@ autoregarglist + + function2 + : FUNCTION2 name_opt { +- $$ = writeByte(SWFACTION_DEFINEFUNCTION2); ++ $$ = writeByte(SWFACTION_DEFINEFUNCTION2); + /* zero block length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + /* function name */ +- $$ += writeString($2); ++ $$ += writeString($2); + curFunc++; + memset(regfunc_args[curFunc], 0, sizeof (regfunc_args[curFunc])); + numArgs = 0; + /* zero num of function arguments */ +- $$ += writeShort(numArgs); ++ $$ += writeShort(numArgs); + /* allocate zero registers */ + numRegisters[curFunc] = 0; +- $$ += writeByte(numRegisters[curFunc]); ++ $$ += writeByte(numRegisters[curFunc]); + /* zero automatic register flags */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + } + + '(' regarglist ')' { +- $$ = $3 + $5; ++ $$ = $3 + $5; + /* patch num of function arguments */ + patchLength($5 + 3, numArgs); + autoregFlags = 0; +@@ -866,9 +866,9 @@ function2 + byte curautoreg = 1; + unsigned int i; + +- $$ = $7; ++ $$ = $7; + /* zero body length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + + /* make sure auto registers are allocated in the right order */ + for (i = 0; i < MAX_AUTO_REGS; i++) { +@@ -883,9 +883,9 @@ function2 + } + + /* patch automatic register flags */ +- patchLength($$ - $3, autoregFlags); ++ patchLength($$ - $3, autoregFlags); + /* patch block length */ +- patchLength($$ - 3, $$ - 3); ++ patchLength($$ - 3, $$ - 3); + } + + statements_opt END { +@@ -905,11 +905,11 @@ function2 + + with + : WITH { +- $$ = writeByte(SWFACTION_WITH); ++ $$ = writeByte(SWFACTION_WITH); + /* length of with action */ +- $$ += writeShort(2); ++ $$ += writeShort(2); + /* length of with block - will be patched */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + } + + statements_opt END { +@@ -921,9 +921,9 @@ with + + settarget + : SETTARGET STRING { +- $$ = writeByte(SWFACTION_SETTARGET); +- $$ += writeShort(strlen($2)+1); +- $$ += writeString($2); ++ $$ = writeByte(SWFACTION_SETTARGET); ++ $$ += writeShort(strlen($2)+1); ++ $$ += writeString($2); + } + + statements_opt END { +@@ -934,7 +934,7 @@ settarget + ; + + settargetexpression +- : SETTARGETEXPR { $$ = writeByte(SWFACTION_SETTARGETEXPRESSION); } ++ : SETTARGETEXPR { $$ = writeByte(SWFACTION_SETTARGETEXPRESSION); } + statements_opt END { + $$ = $3 + writeByte(SWFACTION_SETTARGET); + $$ += $2 + writeShort(1); +@@ -946,9 +946,9 @@ ifframeloadedexpression + : IFFRAMELOADEDEXPR { + if (frameloadedStart>-1) + yyerror("IfFrameLoaded actions can't be nested"); +- $$ = writeByte(SWFACTION_IFFRAMELOADEDEXPRESSION); +- $$ += writeShort(1); +- $$ += writeByte(0); ++ $$ = writeByte(SWFACTION_IFFRAMELOADEDEXPRESSION); ++ $$ += writeShort(1); ++ $$ += writeByte(0); + frameloadedStart = numActions; + } + +@@ -963,10 +963,10 @@ ifframeloaded + : IFFRAMELOADED INTEGER { + if (frameloadedStart>-1) + yyerror("IfFrameLoaded actions can't be nested"); +- $$ = writeByte(SWFACTION_IFFRAMELOADED); +- $$ += writeShort(3); +- $$ += writeShort($2); +- $$ += writeByte(0); ++ $$ = writeByte(SWFACTION_IFFRAMELOADED); ++ $$ += writeShort(3); ++ $$ += writeShort($2); ++ $$ += writeByte(0); + frameloadedStart = numActions; + } + +@@ -1199,9 +1199,9 @@ opcode + constant_list_opt { $$ = writeConstants(); } + + | PUSH { +- $$ = writeByte(SWFACTION_PUSHDATA); ++ $$ = writeByte(SWFACTION_PUSHDATA); + /* length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + } + + push_list { +@@ -1212,10 +1212,10 @@ opcode + | SWFACTION HEX { + if (xtoi($2)>0xff) + yyerror("Action code out of range"); +- $$ = writeByte((char)xtoi($2)); ++ $$ = writeByte((char)xtoi($2)); + if (xtoi($2)>=0x80) + /* length */ +- $$ += writeShort(0); ++ $$ += writeShort(0); + } + + hexlist_opt { + + + diff --git a/graphics/ming/files/patch-src_actioncompiler_swf5compiler.y b/graphics/ming/files/patch-src_actioncompiler_swf5compiler.y new file mode 100644 index 000000000000..cf0ccde2b457 --- /dev/null +++ b/graphics/ming/files/patch-src_actioncompiler_swf5compiler.y @@ -0,0 +1,23 @@ +--- src/actioncompiler/swf5compiler.y.orig 2006-02-08 23:48:38.000000000 +0100 ++++ src/actioncompiler/swf5compiler.y 2009-03-06 11:32:10.000000000 +0100 +@@ -1795,7 +1795,7 @@ opcode_list + + with + : WITH +- { $$ = bufferWriteOp(asmBuffer, ++ { $$ = bufferWriteOp(asmBuffer, + SWFACTION_WITH); } + opcode_list END { $$ = $2 + $3; + bufferPatchLength(asmBuffer, $3); } +@@ -1828,9 +1828,9 @@ push_list + ; + + opcode +- : PUSH { $$ = bufferWriteOp(asmBuffer, ++ : PUSH { $$ = bufferWriteOp(asmBuffer, + SWFACTION_PUSH); +- $$ += bufferWriteS16(asmBuffer, 0); } ++ $$ += bufferWriteS16(asmBuffer, 0); } + push_list { $$ = $2 + $3; + bufferPatchLength(asmBuffer, $3); } + -- cgit