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

svn-id: r48033
This commit is contained in:
Max Horn 2010-02-10 16:47:53 +00:00
parent 2ddfdd960c
commit b90acf431b
2 changed files with 53 additions and 53 deletions

View File

@ -104,7 +104,7 @@
/* Copy the first part of user declarations. */
#line 1 "said.y"
/* ScummVM - Graphic Adventure Engine
*
@ -207,7 +207,7 @@ static tree_t said_paren(tree_t, tree_t);
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,7 +247,7 @@ typedef int YYSTYPE;
/* Line 216 of yacc.c. */
#line 250 "said.tab.c"
#ifdef short
# undef short
@ -544,10 +544,10 @@ static const yytype_int8 yyrhs[] =
/* 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 @@ yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;
@ -1491,178 +1491,178 @@ yyreduce:
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 @@ yyreturn:
}
#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)) {

View File

@ -275,7 +275,7 @@ static int said_next_node() {
#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_leaf_node(tree_t pos, int value) {
}
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 @@ static int said_parse_spec(byte *spec) {
// 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 @@ static int augment_parse_nodes(parse_tree_node_t *parset, parse_tree_node_t *sai
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 @@ int main (int argc, char *argv) {
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