Create some list nodes
This commit is contained in:
parent
eef900bedc
commit
aca67c1a54
@ -384,8 +384,14 @@ struct_or_union
|
|||||||
;
|
;
|
||||||
|
|
||||||
struct_declaration_list
|
struct_declaration_list
|
||||||
: struct_declaration
|
: struct_declaration {
|
||||||
| struct_declaration_list struct_declaration
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| struct_declaration_list struct_declaration {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
struct_declaration
|
struct_declaration
|
||||||
@ -394,15 +400,33 @@ struct_declaration
|
|||||||
;
|
;
|
||||||
|
|
||||||
specifier_qualifier_list
|
specifier_qualifier_list
|
||||||
: type_specifier specifier_qualifier_list
|
: type_specifier specifier_qualifier_list {
|
||||||
| type_specifier
|
$$ = $2;
|
||||||
| type_qualifier specifier_qualifier_list
|
$$->list->push_back($1);
|
||||||
| type_qualifier
|
}
|
||||||
|
| type_specifier {
|
||||||
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| type_qualifier specifier_qualifier_list {
|
||||||
|
$$ = $2;
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| type_qualifier {
|
||||||
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
struct_declarator_list
|
struct_declarator_list
|
||||||
: struct_declarator
|
: struct_declarator {
|
||||||
| struct_declarator_list COMMA struct_declarator
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| struct_declarator_list COMMA struct_declarator {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($3);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
struct_declarator
|
struct_declarator
|
||||||
@ -418,8 +442,14 @@ enum_specifier
|
|||||||
;
|
;
|
||||||
|
|
||||||
enumerator_list
|
enumerator_list
|
||||||
: enumerator
|
: enumerator {
|
||||||
| enumerator_list COMMA enumerator
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| enumerator_list COMMA enumerator {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($3);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
enumerator
|
enumerator
|
||||||
@ -460,8 +490,14 @@ pointer
|
|||||||
;
|
;
|
||||||
|
|
||||||
type_qualifier_list
|
type_qualifier_list
|
||||||
: type_qualifier
|
: type_qualifier {
|
||||||
| type_qualifier_list type_qualifier
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| type_qualifier_list type_qualifier {
|
||||||
|
$$ = $2;
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
parameter_type_list
|
parameter_type_list
|
||||||
@ -470,8 +506,14 @@ parameter_type_list
|
|||||||
;
|
;
|
||||||
|
|
||||||
parameter_list
|
parameter_list
|
||||||
: parameter_declaration
|
: parameter_declaration {
|
||||||
| parameter_list COMMA parameter_declaration
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| parameter_list COMMA parameter_declaration {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($3);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
parameter_declaration
|
parameter_declaration
|
||||||
@ -481,8 +523,14 @@ parameter_declaration
|
|||||||
;
|
;
|
||||||
|
|
||||||
identifier_list
|
identifier_list
|
||||||
: IDENTIFIER
|
: IDENTIFIER {
|
||||||
| identifier_list COMMA IDENTIFIER
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| identifier_list COMMA IDENTIFIER {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($3);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
type_name
|
type_name
|
||||||
@ -513,8 +561,14 @@ initializer
|
|||||||
;
|
;
|
||||||
|
|
||||||
initializer_list
|
initializer_list
|
||||||
: initializer
|
: initializer {
|
||||||
| initializer_list COMMA initializer
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| initializer_list COMMA initializer {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($3);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
statement
|
statement
|
||||||
@ -541,13 +595,25 @@ compound_statement
|
|||||||
;
|
;
|
||||||
|
|
||||||
declaration_list
|
declaration_list
|
||||||
: declaration
|
: declaration {
|
||||||
| declaration_list declaration
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| declaration_list declaration {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
statement_list
|
statement_list
|
||||||
: statement
|
: statement {
|
||||||
| statement_list statement
|
$$ = new Node(NODE_TYPE_LIST);
|
||||||
|
$$->list->push_back($1);
|
||||||
|
}
|
||||||
|
| statement_list statement {
|
||||||
|
$$ = $1;
|
||||||
|
$$->list->push_back($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
expression_statement
|
expression_statement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user