Got rid of 81 reduce/reduce warnings in parser.y

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13424 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dmitry Kabak 2012-07-28 09:19:23 +00:00
commit 4951d4a900

View file

@ -1798,7 +1798,6 @@ static void tag_nodes(Node *n, const_String_or_char_ptr attrname, DOH *value) {
%type <node> featattr; %type <node> featattr;
%type <str> doxygen_comment; %type <str> doxygen_comment;
%type <str> doxygen_comment_item; %type <str> doxygen_comment_item;
%type <str> c_style_comment;
%type <str> doxygen_post_comment; %type <str> doxygen_post_comment;
%type <str> doxygen_post_comment_item; %type <str> doxygen_post_comment_item;
%% %%
@ -1849,6 +1848,16 @@ interface : interface declaration {
appendChild($1,$2); appendChild($1,$2);
$$ = $1; $$ = $1;
} }
| interface doxygen_comment declaration {
set_comment($3, $2);
appendChild($1, $3);
$$ = $1;
}
| interface declaration doxygen_post_comment {
set_comment($2, $3);
appendChild($1, $2);
$$ = $1;
}
| empty { | empty {
$$ = new_node("top"); $$ = new_node("top");
} }
@ -1857,7 +1866,6 @@ interface : interface declaration {
declaration : swig_directive { $$ = $1; } declaration : swig_directive { $$ = $1; }
| c_declaration { $$ = $1; } | c_declaration { $$ = $1; }
| cpp_declaration { $$ = $1; } | cpp_declaration { $$ = $1; }
| c_style_comment { $$ = $1; }
| SEMI { $$ = 0; } | SEMI { $$ = 0; }
| error { | error {
$$ = 0; $$ = 0;
@ -1880,15 +1888,6 @@ declaration : swig_directive { $$ = $1; }
COPERATOR token---discarding the rest of the definition. Ugh. COPERATOR token---discarding the rest of the definition. Ugh.
*/ */
| doxygen_comment declaration {
$$ = $2;
set_comment($2, $1);
}
| declaration doxygen_post_comment {
$$ = $1;
set_comment($1, $2);
}
| error COPERATOR { | error COPERATOR {
$$ = 0; $$ = 0;
skip_decl(); skip_decl();
@ -3470,15 +3469,14 @@ doxygen_comment_item : DOXYGENSTRING {
else { else {
$$ = $1; $$ = $1;
} }
} }
; | doxygen_comment_item doxygen_comment_item {
doxygen_comment : doxygen_comment doxygen_comment_item {
Append($1, $2); Append($1, $2);
$$ = $1; $$ = $1;
} }
| doxygen_comment_item { ;
doxygen_comment : doxygen_comment_item {
$$ = $1; $$ = $1;
} }
; ;
@ -3493,23 +3491,14 @@ doxygen_post_comment_item : DOXYGENPOSTSTRING {
$$ = $1; $$ = $1;
} }
; | doxygen_post_comment_item doxygen_post_comment_item {
doxygen_post_comment : doxygen_post_comment doxygen_post_comment_item {
Append($1, $2); Append($1, $2);
$$ = $1; $$ = $1;
} }
| doxygen_post_comment_item {
$$ = $1;
}
; ;
c_style_comment : C_COMMENT_STRING { doxygen_post_comment : doxygen_post_comment_item {
if(currentCComment != 0){ $$ = $1;
Append(currentCComment, $1);
}
else currentCComment = $1;
$$ = 0;
} }
; ;
@ -4489,7 +4478,6 @@ cpp_member : c_declaration { $$ = $1; }
| storage_class idcolon SEMI { $$ = 0; } | storage_class idcolon SEMI { $$ = 0; }
| cpp_using_decl { $$ = $1; } | cpp_using_decl { $$ = $1; }
| cpp_template_decl { $$ = $1; } | cpp_template_decl { $$ = $1; }
| c_style_comment{ $$ = $1; }
| cpp_catch_decl { $$ = 0; } | cpp_catch_decl { $$ = 0; }
| template_directive { $$ = $1; } | template_directive { $$ = $1; }
| warn_directive { $$ = $1; } | warn_directive { $$ = $1; }