%lex-param {void *scanner}
%token DEFINE FUNC_MACRO IDENTIFIER NEWLINE OBJ_MACRO REPLACEMENT TOKEN UNDEF
-%type <str> FUNC_MACRO IDENTIFIER OBJ_MACRO REPLACEMENT TOKEN word
+%type <str> argument_word FUNC_MACRO IDENTIFIER OBJ_MACRO REPLACEMENT TOKEN
%type <string_list> argument macro parameter_list
%type <argument_list> argument_list
;
argument:
- word {
+ argument_word {
$$ = _string_list_create (parser);
_string_list_append_item ($$, $1);
}
| macro {
$$ = _string_list_create (parser);
}
-| FUNC_MACRO {
- $$ = _string_list_create (parser);
- _string_list_append_item ($$, $1);
- }
-| argument word {
+| argument argument_word {
_string_list_append_item ($1, $2);
talloc_free ($2);
$$ = $1;
}
;
+argument_word:
+ IDENTIFIER { $$ = $1; }
+| TOKEN { $$ = $1; }
+| FUNC_MACRO { $$ = $1; }
+;
+
+
directive:
DEFINE IDENTIFIER REPLACEMENT {
_define_object_macro (parser, $2, $3);
}
;
-word:
- IDENTIFIER { $$ = $1; }
-| TOKEN { $$ = $1; }
-;
-
%%
string_list_t *