$$->set_name($2);
}
+CommaOrSemicolonOptional:
+ ','
+ {}
+| ';'
+ {}
+|
+ {}
+
EnumDefList:
- EnumDefList ',' EnumDef
+ EnumDefList EnumDef
{
pdebug("EnumDefList -> EnumDefList EnumDef");
$$ = $1;
- $$->append($3);
- }
-| EnumDef
- {
- pdebug("EnumDefList -> EnumDef");
- $$ = new t_enum(g_program);
- $$->append($1);
+ $$->append($2);
}
|
{
}
EnumDef:
- tok_identifier '=' tok_int_constant
+ tok_identifier '=' tok_int_constant CommaOrSemicolonOptional
{
pdebug("EnumDef => tok_identifier = tok_int_constant");
if ($3 < 0) {
}
FunctionList:
- FunctionList Function CommaOptional
+ FunctionList Function
{
pdebug("FunctionList -> FunctionList Function");
$$ = $1;
$$ = new t_service(g_program);
}
-CommaOptional:
- ','
- {}
-|
- {}
-
Function:
- AsyncOptional FunctionType tok_identifier '(' FieldList ')' ThrowsOptional
+ AsyncOptional FunctionType tok_identifier '(' FieldList ')' ThrowsOptional CommaOrSemicolonOptional
{
$5->set_name(std::string($3) + "_args");
$$ = new t_function($2, $3, $5, $7, $1);
}
FieldList:
- FieldList ',' Field
+ FieldList Field
{
pdebug("FieldList -> FieldList , Field");
$$ = $1;
- $$->append($3);
- }
-| Field
- {
- pdebug("FieldList -> Field");
- $$ = new t_struct(g_program);
- $$->append($1);
+ $$->append($2);
}
|
{
}
Field:
- tok_int_constant ':' FieldType tok_identifier
+ tok_int_constant ':' FieldType tok_identifier CommaOrSemicolonOptional
{
pdebug("tok_int_constant : Field -> FieldType tok_identifier");
if ($1 <= 0) {