X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fgengtype-lex.l;h=297ebf857a803761832a6da97aabc97b0e173634;hb=069e806a92b774c4ae94d66921da49d7b58de70b;hp=05c0c0418ebe23eaa52b1997658cc44cc53804ce;hpb=30dfb8d18e0eea35b8af1a051fd7a43365a58856;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 05c0c0418eb..297ebf857a8 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -1,12 +1,13 @@ /* -*- indented-text -*- */ /* Process source files and output type information. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +16,10 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ + +%option noinput %{ #include "bconfig.h" @@ -105,6 +107,7 @@ EOID [^[:alnum:]_] "/*" { BEGIN(in_struct_comment); } {WS} { update_lineno (yytext, yyleng); } +\\\n { lexer_line.line++; } "const"/{EOID} /* don't care */ "GTY"/{EOID} { return GTY_TOKEN; } @@ -116,7 +119,7 @@ EOID [^[:alnum:]_] "nested_ptr"/{EOID} { return NESTED_PTR; } [0-9]+ { return NUM; } "param"[0-9]*"_is"/{EOID} { - *yylval = xmemdup (yytext, yyleng, yyleng+1); + *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return PARAM_IS; } @@ -127,28 +130,28 @@ EOID [^[:alnum:]_] for (len = yyleng; ISSPACE (yytext[len-1]); len--) ; - *yylval = xmemdup (yytext, len, len+1); + *yylval = XDUPVAR (const char, yytext, len, len+1); update_lineno (yytext, yyleng); return SCALAR; } {ID}/{EOID} { - *yylval = xmemdup (yytext, yyleng, yyleng+1); + *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return ID; } \"([^"\\]|\\.)*\" { - *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1); + *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return STRING; } /* This "terminal" avoids having to parse integer constant expressions. */ "["[^\[\]]*"]" { - *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1); + *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return ARRAY; } "'"("\\".|[^\\])"'" { - *yylval = xmemdup (yytext+1, yyleng-2, yyleng); + *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng); return CHAR; } @@ -187,9 +190,6 @@ EOID [^[:alnum:]_] } ^{HWS}"#"{HWS}"define"{WS}"GTY(" /* do nothing */ -{WS}"GTY"{WS}?"(" { - error_at_line (&lexer_line, "stray GTY marker"); -} %%