summaryrefslogtreecommitdiff
path: root/gcc/gengtype-lex.l
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-26 21:00:20 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-26 21:00:20 +0000
commit6fee8f021d6bfb1dcf2ed224145ccbe9ae228d0b (patch)
treebc7cc4d9040d552a301d8fe6061ec59da8a396fe /gcc/gengtype-lex.l
parent80da8e25e1b3d41423d0f5cd0548086714bf34b5 (diff)
downloadgcc-6fee8f021d6bfb1dcf2ed224145ccbe9ae228d0b.tar.gz
* gengtype-lex.l: Distinguish unions from structures in the
token type. Don't call find_structure; return the tag as a string. * gengtype-yacc.y: Add new token types ENT_TYPEDEF_UNION and ENT_UNION. Type of these, ENT_TYPEDEF_STRUCT, and ENT_STRUCT is string. Reorganize typedef_struct production accordingly. Use create_nested_ptr_option. * gengtype.c (create_nested_ptr_option): New function. * gengtype.h: Declare it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gengtype-lex.l')
-rw-r--r--gcc/gengtype-lex.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index 1d136251e10..baf09bcd5fe 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -171,12 +171,12 @@ ITYPE {IWORD}({WS}{IWORD})*
for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++)
;
- yylval.t = find_structure ((const char *) xmemdup (tagstart, taglen,
- taglen + 1),
- union_p);
+ yylval.s = (const char *) xmemdup (tagstart, taglen, taglen + 1);
+
BEGIN(in_struct);
update_lineno (yytext, yyleng);
- return typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT;
+ return union_p ? (typedef_p ? ENT_TYPEDEF_UNION : ENT_UNION)
+ : (typedef_p ? ENT_TYPEDEF_STRUCT : ENT_STRUCT);
}
[^[:alnum:]_](extern|static){WS}/"GTY" {