;
declareType
: STRUCT identifier '{' structItemList '}'
{
// printf("AddType: %s\n", $2->name().retStr());
gtypelist.append(Type($2->name(), $4));
$$ = new NodeOp2(Node::TSTRUCT, $2->name(), $4, 0);
}
| STRUCT identifier derived '{' structItemList '}'
{
// printf("AddType: %s\n", $2->name().retStr());
gtypelist.append(Type($2->name(), $5,gtypelist.search($3->name())));
$$ = new NodeOp2(Node::TSTRUCT, $2->name(), $5, $3);
}
| CLASS identifier '{' structItemList '}'
{
// printf("AddType: %s\n", $2->name().retStr());
gtypelist.append(Type($2->name(), $4));
$$ = new NodeOp2(Node::TSTRUCT, $2->name(), $4, 0);
}
| CLASS identifier derived '{' structItemList '}'
{
// printf("AddType: %s\n", $2->name().retStr());
gtypelist.append(Type($2->name(), $5, gtypelist.search($3->name())));
$$ = new NodeOp2(Node::TSTRUCT, $2->name(), $5, $3);
}
| type identifier '(' parameterList ')'
{ $$ = new NodeOp2(Node::TFUNC, $2->name(), $1, $4); }