[Scummvm-cvs-logs] SF.net SVN: scummvm:[48033] scummvm/trunk/engines/sci/parser

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Feb 10 17:47:53 CET 2010


Revision: 48033
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48033&view=rev
Author:   fingolfin
Date:     2010-02-10 16:47:53 +0000 (Wed, 10 Feb 2010)

Log Message:
-----------
SCI: Update said.y to match changes made to said.cpp; regenerate said.cpp using 'bison -l -o said.cpp said.y'

Modified Paths:
--------------
    scummvm/trunk/engines/sci/parser/said.cpp
    scummvm/trunk/engines/sci/parser/said.y

Modified: scummvm/trunk/engines/sci/parser/said.cpp
===================================================================
--- scummvm/trunk/engines/sci/parser/said.cpp	2010-02-10 16:34:32 UTC (rev 48032)
+++ scummvm/trunk/engines/sci/parser/said.cpp	2010-02-10 16:47:53 UTC (rev 48033)
@@ -104,8 +104,8 @@
 
 
 /* Copy the first part of user declarations.  */
-#line 1 "said.y"
 
+
 /* ScummVM - Graphic Adventure Engine
  *
  * ScummVM is the legal property of its developers, whose names
@@ -207,7 +207,7 @@
 static tree_t said_value(int, tree_t);
 static tree_t said_terminal(int);
 
-static int yylex(void);
+static int yylex();
 
 static int yyerror(const char *s) {
 	said_parse_error = strdup(s);
@@ -247,8 +247,8 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 250 "said.tab.c"
 
+
 #ifdef short
 # undef short
 #endif
@@ -544,10 +544,10 @@
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,   129,   129,   131,   133,   139,   140,   147,   148,   154,
-     156,   158,   164,   166,   168,   173,   178,   180,   185,   187,
-     189,   191,   193,   198,   200,   202,   207,   209,   211,   216,
-     218,   220,   222,   227,   229,   231
+       0,   130,   130,   132,   134,   140,   141,   148,   149,   155,
+     157,   159,   165,   167,   169,   174,   179,   181,   186,   188,
+     190,   192,   194,   199,   201,   203,   208,   210,   212,   217,
+     219,   221,   223,   228,   230,   232
 };
 #endif
 
@@ -1246,7 +1246,7 @@
 #endif
 #endif
 {
-
+  
   int yystate;
   int yyn;
   int yyresult;
@@ -1491,178 +1491,178 @@
   switch (yyn)
     {
         case 2:
-#line 130 "said.y"
+
     { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]))); ;}
     break;
 
   case 3:
-#line 132 "said.y"
+
     { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (3)]), said_attach_branch((yyvsp[(2) - (3)]), (yyvsp[(3) - (3)])))); ;}
     break;
 
   case 4:
-#line 134 "said.y"
+
     { (yyval) = said_top_branch(said_attach_branch((yyvsp[(1) - (4)]), said_attach_branch((yyvsp[(2) - (4)]), said_attach_branch((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]))))); ;}
     break;
 
   case 5:
-#line 139 "said.y"
+
     { (yyval) = SAID_BRANCH_NULL; ;}
     break;
 
   case 6:
-#line 141 "said.y"
+
     { (yyval) = said_paren(said_value(0x14b, said_value(0xf900, said_terminal(0xf900))), SAID_BRANCH_NULL); ;}
     break;
 
   case 7:
-#line 147 "said.y"
+
     { (yyval) = SAID_BRANCH_NULL; ;}
     break;
 
   case 8:
-#line 149 "said.y"
+
     { (yyval) = said_paren(said_value(0x141, said_value(0x149, (yyvsp[(1) - (1)]))), SAID_BRANCH_NULL); ;}
     break;
 
   case 9:
-#line 155 "said.y"
+
     { (yyval) = said_aug_branch(0x142, 0x14a, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 10:
-#line 157 "said.y"
+
     { (yyval) = said_aug_branch(0x152, 0x142, said_aug_branch(0x142, 0x14a, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 11:
-#line 159 "said.y"
+
     { (yyval) = SAID_BRANCH_NULL; ;}
     break;
 
   case 12:
-#line 165 "said.y"
+
     { (yyval) = said_aug_branch(0x143, 0x14a, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 13:
-#line 167 "said.y"
+
     { (yyval) = said_aug_branch(0x152, 0x143, said_aug_branch(0x143, 0x14a, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 14:
-#line 169 "said.y"
+
     { (yyval) = SAID_BRANCH_NULL; ;}
     break;
 
   case 15:
-#line 174 "said.y"
+
     { (yyval) = said_paren(said_value(0x141, said_value(0x153, said_terminal((yyvsp[(1) - (1)])))), SAID_BRANCH_NULL); ;}
     break;
 
   case 16:
-#line 179 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x14f, (yyvsp[(1) - (1)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 17:
-#line 181 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x14f, said_aug_branch(0x152, 0x14c, said_aug_branch(0x141, 0x14f, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 18:
-#line 186 "said.y"
+
     { (yyval) = (yyvsp[(1) - (1)]); ;}
     break;
 
   case 19:
-#line 188 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x14c, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 20:
-#line 190 "said.y"
+
     { (yyval) = said_attach_branch((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;}
     break;
 
   case 21:
-#line 192 "said.y"
+
     { (yyval) = said_attach_branch((yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); ;}
     break;
 
   case 22:
-#line 194 "said.y"
+
     { (yyval) = said_attach_branch((yyvsp[(1) - (5)]), (yyvsp[(3) - (5)])); ;}
     break;
 
   case 23:
-#line 199 "said.y"
+
     { (yyval) = said_attach_branch((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); ;}
     break;
 
   case 24:
-#line 201 "said.y"
+
     { (yyval) = (yyvsp[(1) - (1)]); ;}
     break;
 
   case 25:
-#line 203 "said.y"
+
     { (yyval) = (yyvsp[(1) - (1)]); ;}
     break;
 
   case 26:
-#line 208 "said.y"
+
     { (yyval) = (yyvsp[(1) - (1)]); ;}
     break;
 
   case 27:
-#line 210 "said.y"
+
     { (yyval) = said_aug_branch(0x152, 0x144, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 28:
-#line 212 "said.y"
+
     { (yyval) = said_attach_branch((yyvsp[(1) - (4)]), said_aug_branch(0x152, 0x144, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL)); ;}
     break;
 
   case 29:
-#line 217 "said.y"
+
     { (yyval) = said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)])); ;}
     break;
 
   case 30:
-#line 219 "said.y"
+
     { (yyval) = said_aug_branch(0x144, 0x14f, said_aug_branch(0x141, 0x144, (yyvsp[(2) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 31:
-#line 221 "said.y"
+
     { (yyval) = said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL); ;}
     break;
 
   case 32:
-#line 223 "said.y"
+
     { (yyval) = said_aug_branch(0x152, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(3) - (4)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 33:
-#line 228 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (3)]), SAID_BRANCH_NULL), (yyvsp[(3) - (3)])); ;}
     break;
 
   case 34:
-#line 230 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x144, said_aug_branch(0x144, 0x14f, (yyvsp[(2) - (2)]), SAID_BRANCH_NULL), SAID_BRANCH_NULL); ;}
     break;
 
   case 35:
-#line 232 "said.y"
+
     { (yyval) = said_aug_branch(0x141, 0x14c, (yyvsp[(2) - (4)]), SAID_BRANCH_NULL); ;}
     break;
 
 
 /* Line 1267 of yacc.c.  */
-#line 1665 "said.tab.c"
+
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1876,12 +1876,12 @@
 }
 
 
-#line 235 "said.y"
 
 
+
 int parse_yy_token_lookup[] = {YY_COMMA, YY_AMP, YY_SLASH, YY_PARENO, YY_PARENC, YY_BRACKETSO, YY_BRACKETSC, YY_HASH, YY_LT, YY_GT};
 
-static int yylex(void) {
+static int yylex() {
 	int retval = said_tokens[said_token++];
 
 	if (retval < SAID_LONG(SAID_FIRST)) {

Modified: scummvm/trunk/engines/sci/parser/said.y
===================================================================
--- scummvm/trunk/engines/sci/parser/said.y	2010-02-10 16:34:32 UTC (rev 48032)
+++ scummvm/trunk/engines/sci/parser/said.y	2010-02-10 16:47:53 UTC (rev 48033)
@@ -275,7 +275,7 @@
 #define SAID_NEXT_NODE said_next_node()
 
 static int said_leaf_node(tree_t pos, int value) {
-	said_tree[pos].type = PARSE_TREE_NODE_LEAF;
+	said_tree[pos].type = kParseTreeLeafNode;
 
 	if (value != VALUE_IGNORE)
 		said_tree[pos].content.value = value;
@@ -284,7 +284,7 @@
 }
 
 static int said_branch_node(tree_t pos, int left, int right) {
-	said_tree[pos].type = PARSE_TREE_NODE_BRANCH;
+	said_tree[pos].type = kParseTreeBranchNode;
 
 	if (left != VALUE_IGNORE)
 		said_tree[pos].content.branches[0] = left;
@@ -414,12 +414,12 @@
 // primitive functions
 
 #define AUG_READ_BRANCH(a, br, p) \
-	if (tree[p].type != PARSE_TREE_NODE_BRANCH) \
+	if (tree[p].type != kParseTreeBranchNode) \
 		return 0; \
 	a = tree[p].content.branches[br];
 
 #define AUG_READ_VALUE(a, p) \
-	if (tree[p].type != PARSE_TREE_NODE_LEAF) \
+	if (tree[p].type != kParseTreeLeafNode) \
 		return 0; \
 	a = tree[p].content.value;
 
@@ -800,11 +800,11 @@
 int said(EngineState *s, byte *spec, bool verbose) {
 	int retval;
 
-	parse_tree_node_t *parse_tree_ptr = s->_voc->_parser_nodes;
+	parse_tree_node_t *parse_tree_ptr = s->_voc->_parserNodes;
 
 	if (s->_voc->parserIsValid) {
-		if (said_parse_spec(s, spec)) {
-			warning("Offending spec was: ");
+		if (said_parse_spec(spec)) {
+			printf("Offending spec was: ");
 			s->_voc->decipherSaidBlock(spec);
 			return SAID_NO_MATCH;
 		}
@@ -830,7 +830,7 @@
 	byte block[] = {0x01, 0x00, 0xf8, 0xf5, 0x02, 0x01, 0xf6, 0xf2, 0x02, 0x01, 0xf2, 0x01, 0x03, 0xff};
 	EngineState s;
 
-	s._voc->parser_valid = 1;
+	s.parser_valid = 1;
 	said(&s, block);
 }
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list