From 26ce453b08b4dcbd8c2858f9834a4ac921309377 Mon Sep 17 00:00:00 2001 From: ruanshudong Date: Mon, 21 Feb 2022 20:40:17 +0800 Subject: [PATCH] support run in container --- servant/libservant/Application.cpp | 3 + servant/libservant/EndpointManager.cpp | 94 +- servant/protocol | 2 +- servant/servant/EndpointManager.h | 8 +- tools/tarsgrammar/tars.tab.cpp | 1527 ++++++++++----------- tools/tarsparse/tars.lex.cpp | 478 +++---- tools/tarsparse/tars.tab.cpp | 1527 ++++++++++----------- tools/tarsparse/tars.tab.hpp | 88 +- unit-test/server/Hello.h | 2 +- unit-test/util/test_tc_epoller_server.cpp | 2 +- unit-test/util/test_tc_port.cpp | 35 + util/include/util/tc_clientsocket.h | 6 + util/include/util/tc_port.h | 43 + util/include/util/tc_thread_pool.h | 1 - util/src/tc_clientsocket.cpp | 45 + util/src/tc_port.cpp | 149 ++ 16 files changed, 2021 insertions(+), 1989 deletions(-) create mode 100755 unit-test/util/test_tc_port.cpp diff --git a/servant/libservant/Application.cpp b/servant/libservant/Application.cpp index 56e1394..670e071 100644 --- a/servant/libservant/Application.cpp +++ b/servant/libservant/Application.cpp @@ -717,6 +717,9 @@ void Application::main(const TC_Option &option) string config = TC_File::load2str(ServerConfig::ConfigFile); + __out__.debug() << "config:" << ServerConfig::ConfigFile << endl; + __out__.debug() << "config:" << config << endl; + main(config); } diff --git a/servant/libservant/EndpointManager.cpp b/servant/libservant/EndpointManager.cpp index e88a6aa..9df7721 100644 --- a/servant/libservant/EndpointManager.cpp +++ b/servant/libservant/EndpointManager.cpp @@ -239,52 +239,52 @@ void QueryEpBase::setObjName(const string & sObjName) notifyEndpoints(_activeEndpoints,_inactiveEndpoints,true); } } - -vector QueryEpBase::sepEndpoint(const string& sEndpoints) -{ - vector vEndpoints; - bool flag = false; - string::size_type startPos = 0; - string::size_type sepPos = 0; - for(string::size_type pos = 0; pos < sEndpoints.size(); pos++) - { - if(sEndpoints[pos] == ':' && !flag ) - { - sepPos = pos; - flag = true; - } - else if(flag) - { - if(sEndpoints[pos] == ' ') - { - continue; - } - - if(TC_Port::strncasecmp("tcp", (sEndpoints.c_str() + pos), 3) == 0 - || TC_Port::strncasecmp("udp", (sEndpoints.c_str() + pos), 3) == 0 - || TC_Port::strncasecmp("ssl", (sEndpoints.c_str() + pos), 3) == 0) - { - string ep = TC_Common::trim(string(sEndpoints.c_str() + startPos, sepPos - startPos)); - if(!ep.empty()) { - vEndpoints.push_back(ep); - } - startPos = pos; - } - - flag = false; - } - } - - string ep = sEndpoints.substr(startPos); - - if(!ep.empty()) { - vEndpoints.push_back(ep); - } - -// vEndpoints.push_back(sEndpoints.substr(startPos)); - - return vEndpoints; -} +// +//vector QueryEpBase::sepEndpoint(const string& sEndpoints) +//{ +// vector vEndpoints; +// bool flag = false; +// string::size_type startPos = 0; +// string::size_type sepPos = 0; +// for(string::size_type pos = 0; pos < sEndpoints.size(); pos++) +// { +// if(sEndpoints[pos] == ':' && !flag ) +// { +// sepPos = pos; +// flag = true; +// } +// else if(flag) +// { +// if(sEndpoints[pos] == ' ') +// { +// continue; +// } +// +// if(TC_Port::strncasecmp("tcp", (sEndpoints.c_str() + pos), 3) == 0 +// || TC_Port::strncasecmp("udp", (sEndpoints.c_str() + pos), 3) == 0 +// || TC_Port::strncasecmp("ssl", (sEndpoints.c_str() + pos), 3) == 0) +// { +// string ep = TC_Common::trim(string(sEndpoints.c_str() + startPos, sepPos - startPos)); +// if(!ep.empty()) { +// vEndpoints.push_back(ep); +// } +// startPos = pos; +// } +// +// flag = false; +// } +// } +// +// string ep = sEndpoints.substr(startPos); +// +// if(!ep.empty()) { +// vEndpoints.push_back(ep); +// } +// +//// vEndpoints.push_back(sEndpoints.substr(startPos)); +// +// return vEndpoints; +//} void QueryEpBase::setEndpoints(const string & sEndpoints, set & setEndpoints) { @@ -297,7 +297,7 @@ void QueryEpBase::setEndpoints(const string & sEndpoints, set & se bool bFirstWeightType = true; unsigned int iWeightType = 0; - vector vEndpoints = sepEndpoint(sEndpoints); + vector vEndpoints = TC_Endpoint::sepEndpoint(sEndpoints); for (size_t i = 0; i < vEndpoints.size(); ++i) { diff --git a/servant/protocol b/servant/protocol index 39c6f87..9d299a7 160000 --- a/servant/protocol +++ b/servant/protocol @@ -1 +1 @@ -Subproject commit 39c6f87733710a28eb5e57e42558c7e016d84eba +Subproject commit 9d299a769d9f827670b726984e40ae9f52b3189c diff --git a/servant/servant/EndpointManager.h b/servant/servant/EndpointManager.h index a7cdac2..62f2307 100644 --- a/servant/servant/EndpointManager.h +++ b/servant/servant/EndpointManager.h @@ -155,10 +155,10 @@ private: */ void setObjName(const string & sObjName); - /* - * 解析endpoint - */ - vector sepEndpoint(const string& sEndpoints); +// /* +// * 解析endpoint +// */ +// vector sepEndpoint(const string& sEndpoints); /* * 从sEndpoints提取ip列表信息 diff --git a/tools/tarsgrammar/tars.tab.cpp b/tools/tarsgrammar/tars.tab.cpp index 483d33f..25e7386 100644 --- a/tools/tarsgrammar/tars.tab.cpp +++ b/tools/tarsgrammar/tars.tab.cpp @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program 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 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 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 this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,62 +55,11 @@ /* Pure parsers. */ #define YYPURE 0 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" - -#include -#include -#include - -using namespace std; - -#define YYSTYPE GrammarBasePtr - -#include "parse.h" -#define YYDEBUG 1 -#define YYINITDEPTH 10000 - -/* Line 371 of yacc.c */ -#line 82 "tars.tab.cpp" - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "tars.tab.hpp". */ -#ifndef YY_YY_TARS_TAB_HPP_INCLUDED -# define YY_YY_TARS_TAB_HPP_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int yydebug; -#endif - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -147,37 +99,90 @@ extern int yydebug; BAD_CHAR = 288 }; #endif +/* Tokens. */ +#define TARS_VOID 258 +#define TARS_STRUCT 259 +#define TARS_BOOL 260 +#define TARS_BYTE 261 +#define TARS_SHORT 262 +#define TARS_INT 263 +#define TARS_DOUBLE 264 +#define TARS_FLOAT 265 +#define TARS_LONG 266 +#define TARS_STRING 267 +#define TARS_VECTOR 268 +#define TARS_MAP 269 +#define TARS_NAMESPACE 270 +#define TARS_INTERFACE 271 +#define TARS_IDENTIFIER 272 +#define TARS_OUT 273 +#define TARS_OP 274 +#define TARS_KEY 275 +#define TARS_ROUTE_KEY 276 +#define TARS_REQUIRE 277 +#define TARS_OPTIONAL 278 +#define TARS_CONST_INTEGER 279 +#define TARS_CONST_FLOAT 280 +#define TARS_FALSE 281 +#define TARS_TRUE 282 +#define TARS_STRING_LITERAL 283 +#define TARS_SCOPE_DELIMITER 284 +#define TARS_CONST 285 +#define TARS_ENUM 286 +#define TARS_UNSIGNED 287 +#define BAD_CHAR 288 + + +/* Copy the first part of user declarations. */ +#line 17 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" + +#include +#include +#include + +using namespace std; + +#define YYSTYPE GrammarBasePtr + +#include "parse.h" +#define YYDEBUG 1 +#define YYINITDEPTH 10000 + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_TARS_TAB_HPP_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 181 "tars.tab.cpp" + +/* Line 216 of yacc.c. */ +#line 186 "tars.tab.cpp" #ifdef short # undef short @@ -230,36 +235,36 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ -# define YY_(Msgid) Msgid +# define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YYUSE(e) ((void) (e)) #else -# define YYUSE(E) /* empty */ +# define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(N) (N) +# define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -280,12 +285,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -308,24 +312,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -341,9 +345,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -354,19 +358,35 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -374,26 +394,6 @@ union yyalloc #endif -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - /* YYFINAL -- State number of the termination state. */ #define YYFINAL 75 /* YYLAST -- Last index in YYTABLE. */ @@ -534,7 +534,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -547,15 +547,15 @@ static const char *const yytname[] = "TARS_CONST_FLOAT", "TARS_FALSE", "TARS_TRUE", "TARS_STRING_LITERAL", "TARS_SCOPE_DELIMITER", "TARS_CONST", "TARS_ENUM", "TARS_UNSIGNED", "BAD_CHAR", "';'", "'{'", "'}'", "','", "'='", "'['", "']'", "')'", - "'*'", "':'", "'<'", "'>'", "$accept", "start", "definitions", "$@1", - "$@2", "definition", "enum_def", "@3", "enum_id", "enumerator_list", - "enumerator", "namespace_def", "@4", "key_def", "$@5", "key_members", + "'*'", "':'", "'<'", "'>'", "$accept", "start", "definitions", "@1", + "@2", "definition", "enum_def", "@3", "enum_id", "enumerator_list", + "enumerator", "namespace_def", "@4", "key_def", "@5", "key_members", "interface_def", "@6", "interface_id", "interface_exports", "interface_export", "operation", "operation_preamble", "return_type", "parameters", "routekey_qualifier", "out_qualifier", "struct_def", "@7", "struct_id", "struct_exports", "data_member", "struct_type_id", "const_initializer", "const_def", "type_id", "type", "type_no", "vector", - "map", "scoped_name", "keyword", YY_NULL + "map", "scoped_name", "keyword", 0 }; #endif @@ -610,8 +610,8 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -686,7 +686,8 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -113 static const yytype_int16 yytable[] = { @@ -749,12 +750,6 @@ static const yytype_int16 yytable[] = 0, 0, 65, 0, 0, 66 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-146))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 6, 52, 84, 85, 149, 2, 1, 4, 1, 1, @@ -854,50 +849,78 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) -/* Error token number */ + #define YYTERROR 1 #define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else @@ -947,8 +970,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) YYSTYPE const * const yyvaluep; #endif { - FILE *yyo = yyoutput; - YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT @@ -960,7 +981,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) switch (yytype) { default: - break; + break; } } @@ -998,20 +1019,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1045,11 +1063,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1086,6 +1104,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1188,145 +1207,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1355,32 +1344,40 @@ yydestruct (yymsg, yytype, yyvaluep) { default: - break; + break; } } + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ - -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; + /*----------. | yyparse. | `----------*/ @@ -1407,37 +1404,14 @@ yyparse () #endif #endif { - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - + + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1445,22 +1419,54 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -1487,6 +1493,7 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1494,6 +1501,7 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -1516,8 +1524,9 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1528,6 +1537,7 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1537,9 +1547,6 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1548,16 +1555,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1583,27 +1590,29 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1640,93 +1649,81 @@ yyreduce: switch (yyn) { case 3: -/* Line 1792 of yacc.c */ -#line 75 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 75 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 5: -/* Line 1792 of yacc.c */ -#line 79 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 79 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { yyerrok; -} +;} break; case 7: -/* Line 1792 of yacc.c */ -#line 84 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 84 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("`;' missing after definition"); -} +;} break; case 8: -/* Line 1792 of yacc.c */ -#line 88 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 88 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 9: -/* Line 1792 of yacc.c */ -#line 96 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 96 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || NamespacePtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 10: -/* Line 1792 of yacc.c */ -#line 100 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 100 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || InterfacePtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 11: -/* Line 1792 of yacc.c */ -#line 104 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 104 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 12: -/* Line 1792 of yacc.c */ -#line 108 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 108 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 13: -/* Line 1792 of yacc.c */ -#line 111 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 111 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 14: -/* Line 1792 of yacc.c */ -#line 115 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 115 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 15: -/* Line 1792 of yacc.c */ -#line 124 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 124 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(1) - (1)]); -} +;} break; case 16: -/* Line 1792 of yacc.c */ -#line 128 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 128 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(3) - (5)])) { @@ -1739,12 +1736,11 @@ yyreduce: } (yyval) = (yyvsp[(2) - (5)]); -} +;} break; case 17: -/* Line 1792 of yacc.c */ -#line 147 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 147 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { NamespacePtr c = NamespacePtr::dynamicCast(g_parse->currentContainer()); if(!c) @@ -1756,37 +1752,33 @@ yyreduce: g_parse->pushContainer(e); (yyval) = e; -} +;} break; case 18: -/* Line 1792 of yacc.c */ -#line 160 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 160 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as enumeration name"); (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 19: -/* Line 1792 of yacc.c */ -#line 171 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 171 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (3)]); -} +;} break; case 20: -/* Line 1792 of yacc.c */ -#line 175 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 175 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 21: -/* Line 1792 of yacc.c */ -#line 183 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 183 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong)); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -1796,21 +1788,19 @@ yyreduce: assert(e); e->addMember(tPtr); (yyval) = e; -} +;} break; case 22: -/* Line 1792 of yacc.c */ -#line 194 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 194 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); g_parse->error("keyword `" + ident->v + "' cannot be used as enumerator"); -} +;} break; case 23: -/* Line 1792 of yacc.c */ -#line 199 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 199 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong)); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); @@ -1822,19 +1812,17 @@ yyreduce: assert(e); e->addMember(tPtr); (yyval) = e; -} +;} break; case 24: -/* Line 1792 of yacc.c */ -#line 212 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 212 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 25: -/* Line 1792 of yacc.c */ -#line 220 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 220 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); ContainerPtr c = g_parse->currentContainer(); @@ -1848,12 +1836,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 26: -/* Line 1792 of yacc.c */ -#line 235 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 235 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(3) - (6)])) { @@ -1864,12 +1851,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 27: -/* Line 1792 of yacc.c */ -#line 253 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 253 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); StructPtr sp = StructPtr::dynamicCast(g_parse->findUserType(ident->v)); @@ -1879,19 +1865,17 @@ yyreduce: } g_parse->setKeyStruct(sp); -} +;} break; case 28: -/* Line 1792 of yacc.c */ -#line 264 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 264 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 29: -/* Line 1792 of yacc.c */ -#line 272 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 272 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); StructPtr np = g_parse->getKeyStruct(); @@ -1903,12 +1887,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 30: -/* Line 1792 of yacc.c */ -#line 285 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 285 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); StructPtr np = g_parse->getKeyStruct(); @@ -1920,12 +1903,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 31: -/* Line 1792 of yacc.c */ -#line 304 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 304 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -1941,12 +1923,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 32: -/* Line 1792 of yacc.c */ -#line 321 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 321 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(2) - (5)])) { @@ -1957,59 +1938,52 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 33: -/* Line 1792 of yacc.c */ -#line 338 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 338 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 34: -/* Line 1792 of yacc.c */ -#line 342 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 342 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as interface name"); (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 35: -/* Line 1792 of yacc.c */ -#line 353 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 353 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 36: -/* Line 1792 of yacc.c */ -#line 356 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 356 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 37: -/* Line 1792 of yacc.c */ -#line 359 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 359 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("`;' missing after definition"); -} +;} break; case 38: -/* Line 1792 of yacc.c */ -#line 363 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 363 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 40: -/* Line 1792 of yacc.c */ -#line 377 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 377 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(1) - (3)])) { @@ -2020,12 +1994,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 41: -/* Line 1792 of yacc.c */ -#line 394 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 394 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr returnType = TypePtr::dynamicCast((yyvsp[(1) - (2)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2048,27 +2021,24 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 43: -/* Line 1792 of yacc.c */ -#line 424 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 424 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = 0; -} +;} break; case 44: -/* Line 1792 of yacc.c */ -#line 434 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 434 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 45: -/* Line 1792 of yacc.c */ -#line 437 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 437 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -2078,12 +2048,11 @@ yyreduce: { op->createParamDecl(tsp, false, false); } -} +;} break; case 46: -/* Line 1792 of yacc.c */ -#line 448 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 448 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(3) - (3)])); @@ -2093,12 +2062,11 @@ yyreduce: { op->createParamDecl(tsp, false, false); } -} +;} break; case 47: -/* Line 1792 of yacc.c */ -#line 459 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 459 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2109,12 +2077,11 @@ yyreduce: { op->createParamDecl(tsp, isOutParam->v, false); } -} +;} break; case 48: -/* Line 1792 of yacc.c */ -#line 471 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 471 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)])); @@ -2125,12 +2092,11 @@ yyreduce: { op->createParamDecl(tsp, isOutParam->v, false); } -} +;} break; case 49: -/* Line 1792 of yacc.c */ -#line 483 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 483 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2141,12 +2107,11 @@ yyreduce: { op->createParamDecl(tsp, false, isRouteKeyParam->v); } -} +;} break; case 50: -/* Line 1792 of yacc.c */ -#line 495 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 495 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)])); @@ -2157,48 +2122,43 @@ yyreduce: { op->createParamDecl(tsp, false, isRouteKeyParam->v); } -} +;} break; case 51: -/* Line 1792 of yacc.c */ -#line 507 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 507 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("'out' must be defined with a type"); -} +;} break; case 52: -/* Line 1792 of yacc.c */ -#line 511 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 511 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("'routekey' must be defined with a type"); -} +;} break; case 53: -/* Line 1792 of yacc.c */ -#line 520 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 520 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr routekey = new BoolGrammar; routekey->v = true; (yyval) = GrammarBasePtr::dynamicCast(routekey); -} +;} break; case 54: -/* Line 1792 of yacc.c */ -#line 531 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 531 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr out = new BoolGrammar; out->v = true; (yyval) = GrammarBasePtr::dynamicCast(out); -} +;} break; case 55: -/* Line 1792 of yacc.c */ -#line 542 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 542 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer()); @@ -2219,12 +2179,11 @@ yyreduce: { g_parse->error("struct '" + ident->v + "' must definition in namespace"); } -} +;} break; case 56: -/* Line 1792 of yacc.c */ -#line 564 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 564 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(2) - (5)])) { @@ -2238,69 +2197,61 @@ yyreduce: { g_parse->error("struct `" + st->getSid() + "' must have at least one member"); } -} +;} break; case 57: -/* Line 1792 of yacc.c */ -#line 584 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 584 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 58: -/* Line 1792 of yacc.c */ -#line 588 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 588 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as struct name"); -} +;} break; case 59: -/* Line 1792 of yacc.c */ -#line 594 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 594 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("abstract declarator '' used as declaration"); -} +;} break; case 60: -/* Line 1792 of yacc.c */ -#line 603 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 603 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 61: -/* Line 1792 of yacc.c */ -#line 607 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 607 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("';' missing after definition"); -} +;} break; case 62: -/* Line 1792 of yacc.c */ -#line 611 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 611 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 63: -/* Line 1792 of yacc.c */ -#line 621 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 621 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 64: -/* Line 1792 of yacc.c */ -#line 630 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 630 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2317,12 +2268,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 65: -/* Line 1792 of yacc.c */ -#line 648 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 648 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2343,12 +2293,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 66: -/* Line 1792 of yacc.c */ -#line 670 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 670 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2369,12 +2318,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 67: -/* Line 1792 of yacc.c */ -#line 692 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 692 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2390,44 +2338,39 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 68: -/* Line 1792 of yacc.c */ -#line 709 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 709 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag'"); -} +;} break; case 69: -/* Line 1792 of yacc.c */ -#line 713 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 713 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag'"); -} +;} break; case 70: -/* Line 1792 of yacc.c */ -#line 717 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 717 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'require' or 'optional'"); -} +;} break; case 71: -/* Line 1792 of yacc.c */ -#line 721 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 721 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag' or 'require' or 'optional'"); -} +;} break; case 72: -/* Line 1792 of yacc.c */ -#line 730 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 730 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { IntergerGrammarPtr intVal = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ostringstream sstr; @@ -2436,12 +2379,11 @@ yyreduce: c->t = ConstGrammar::VALUE; c->v = sstr.str(); (yyval) = c; -} +;} break; case 73: -/* Line 1792 of yacc.c */ -#line 740 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 740 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { FloatGrammarPtr floatVal = FloatGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ostringstream sstr; @@ -2450,48 +2392,44 @@ yyreduce: c->t = ConstGrammar::VALUE; c->v = sstr.str(); (yyval) = c; -} +;} break; case 74: -/* Line 1792 of yacc.c */ -#line 750 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 750 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::STRING; c->v = ident->v; (yyval) = c; -} +;} break; case 75: -/* Line 1792 of yacc.c */ -#line 758 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 758 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::BOOL; c->v = ident->v; (yyval) = c; -} +;} break; case 76: -/* Line 1792 of yacc.c */ -#line 766 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 766 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::BOOL; c->v = ident->v; (yyval) = c; -} +;} break; case 77: -/* Line 1792 of yacc.c */ -#line 774 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 774 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -2503,12 +2441,11 @@ yyreduce: c->t = ConstGrammar::ENUM; c->v = ident->v; (yyval) = c; -} +;} break; case 78: -/* Line 1792 of yacc.c */ -#line 787 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 787 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); @@ -2522,12 +2459,11 @@ yyreduce: c->t = ConstGrammar::ENUM; c->v = scoped->v + "::" + ident->v; (yyval) = c; -} +;} break; case 79: -/* Line 1792 of yacc.c */ -#line 807 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 807 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer()); if(!np) @@ -2539,12 +2475,11 @@ yyreduce: ConstGrammarPtr c = ConstGrammarPtr::dynamicCast((yyvsp[(4) - (4)])); ConstPtr cPtr = np->createConst(t, c); (yyval) = cPtr; -} +;} break; case 80: -/* Line 1792 of yacc.c */ -#line 825 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 825 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2552,12 +2487,11 @@ yyreduce: TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 81: -/* Line 1792 of yacc.c */ -#line 834 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 834 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (5)]))); IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(4) - (5)])); @@ -2566,12 +2500,11 @@ yyreduce: StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (5)])); TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 82: -/* Line 1792 of yacc.c */ -#line 844 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 844 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (3)]))); //IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast($4); @@ -2580,12 +2513,11 @@ yyreduce: StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 83: -/* Line 1792 of yacc.c */ -#line 854 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 854 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (4)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2593,37 +2525,33 @@ yyreduce: IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); g_parse->checkArrayVaid(type,iPtrSize->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 84: -/* Line 1792 of yacc.c */ -#line 863 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 863 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as data member name"); -} +;} break; case 85: -/* Line 1792 of yacc.c */ -#line 868 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 868 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("missing data member name"); -} +;} break; case 86: -/* Line 1792 of yacc.c */ -#line 872 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 872 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("unkown type"); -} +;} break; case 87: -/* Line 1792 of yacc.c */ -#line 881 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 881 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (3)])); @@ -2631,132 +2559,116 @@ yyreduce: g_parse->checkArrayVaid(type,iPtrSize->v); type->setArray(iPtrSize->v); (yyval) = type; -} +;} break; case 88: -/* Line 1792 of yacc.c */ -#line 890 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 890 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(1) - (1)]); -} +;} break; case 89: -/* Line 1792 of yacc.c */ -#line 894 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 894 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("array missing size"); -} +;} break; case 90: -/* Line 1792 of yacc.c */ -#line 903 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 903 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindBool); -} +;} break; case 91: -/* Line 1792 of yacc.c */ -#line 907 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 907 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindByte); -} +;} break; case 92: -/* Line 1792 of yacc.c */ -#line 911 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 911 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindShort,true); -} +;} break; case 93: -/* Line 1792 of yacc.c */ -#line 915 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 915 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindShort); -} +;} break; case 94: -/* Line 1792 of yacc.c */ -#line 919 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 919 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindInt,true); -} +;} break; case 95: -/* Line 1792 of yacc.c */ -#line 923 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 923 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindInt); -} +;} break; case 96: -/* Line 1792 of yacc.c */ -#line 927 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 927 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindLong,true); -} +;} break; case 97: -/* Line 1792 of yacc.c */ -#line 931 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 931 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindLong); -} +;} break; case 98: -/* Line 1792 of yacc.c */ -#line 935 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 935 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindFloat); -} +;} break; case 99: -/* Line 1792 of yacc.c */ -#line 939 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 939 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindDouble); -} +;} break; case 100: -/* Line 1792 of yacc.c */ -#line 943 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 943 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindString); -} +;} break; case 101: -/* Line 1792 of yacc.c */ -#line 947 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 947 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 102: -/* Line 1792 of yacc.c */ -#line 951 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 951 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 103: -/* Line 1792 of yacc.c */ -#line 955 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 955 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); TypePtr sp = g_parse->findUserType(ident->v); @@ -2768,277 +2680,232 @@ yyreduce: { g_parse->error("'" + ident->v + "' undefined!"); } -} +;} break; case 104: -/* Line 1792 of yacc.c */ -#line 973 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 973 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast(g_parse->createVector(TypePtr::dynamicCast((yyvsp[(3) - (4)])))); -} +;} break; case 105: -/* Line 1792 of yacc.c */ -#line 977 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 977 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector error"); -} +;} break; case 106: -/* Line 1792 of yacc.c */ -#line 981 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 981 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector missing '>'"); -} +;} break; case 107: -/* Line 1792 of yacc.c */ -#line 985 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 985 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector missing type"); -} +;} break; case 108: -/* Line 1792 of yacc.c */ -#line 994 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 994 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast(g_parse->createMap(TypePtr::dynamicCast((yyvsp[(3) - (6)])), TypePtr::dynamicCast((yyvsp[(5) - (6)])))); -} +;} break; case 109: -/* Line 1792 of yacc.c */ -#line 998 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 998 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("map error"); -} +;} break; case 110: -/* Line 1792 of yacc.c */ -#line 1007 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1007 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 111: -/* Line 1792 of yacc.c */ -#line 1010 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1010 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); ident->v = "::" + ident->v; (yyval) = GrammarBasePtr::dynamicCast(ident); -} +;} break; case 112: -/* Line 1792 of yacc.c */ -#line 1016 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1016 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); scoped->v += "::"; scoped->v += ident->v; (yyval) = GrammarBasePtr::dynamicCast(scoped); -} +;} break; case 113: -/* Line 1792 of yacc.c */ -#line 1029 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1029 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 114: -/* Line 1792 of yacc.c */ -#line 1032 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1032 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 115: -/* Line 1792 of yacc.c */ -#line 1035 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1035 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 116: -/* Line 1792 of yacc.c */ -#line 1038 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1038 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 117: -/* Line 1792 of yacc.c */ -#line 1041 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1041 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 118: -/* Line 1792 of yacc.c */ -#line 1044 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1044 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 119: -/* Line 1792 of yacc.c */ -#line 1047 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1047 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 120: -/* Line 1792 of yacc.c */ -#line 1050 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1050 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 121: -/* Line 1792 of yacc.c */ -#line 1053 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1053 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 122: -/* Line 1792 of yacc.c */ -#line 1056 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1056 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 123: -/* Line 1792 of yacc.c */ -#line 1059 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1059 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 124: -/* Line 1792 of yacc.c */ -#line 1062 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1062 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 125: -/* Line 1792 of yacc.c */ -#line 1065 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1065 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 126: -/* Line 1792 of yacc.c */ -#line 1068 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1068 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 127: -/* Line 1792 of yacc.c */ -#line 1071 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1071 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 128: -/* Line 1792 of yacc.c */ -#line 1074 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1074 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 129: -/* Line 1792 of yacc.c */ -#line 1077 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1077 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 130: -/* Line 1792 of yacc.c */ -#line 1080 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1080 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 131: -/* Line 1792 of yacc.c */ -#line 1083 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1083 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 132: -/* Line 1792 of yacc.c */ -#line 1086 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1086 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 133: -/* Line 1792 of yacc.c */ -#line 1089 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1089 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 134: -/* Line 1792 of yacc.c */ -#line 1092 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1092 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 135: -/* Line 1792 of yacc.c */ -#line 1095 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1095 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 136: -/* Line 1792 of yacc.c */ -#line 1098 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1098 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 137: -/* Line 1792 of yacc.c */ -#line 1101 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1101 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; -/* Line 1792 of yacc.c */ -#line 3029 "tars.tab.cpp" +/* Line 1267 of yacc.c. */ +#line 2907 "tars.tab.cpp" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -3047,6 +2914,7 @@ yyreduce: *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3066,10 +2934,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -3077,36 +2941,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -3114,7 +2979,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -3131,7 +2996,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -3165,7 +3030,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -3188,9 +3053,10 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -3214,7 +3080,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined yyoverflow || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -3225,14 +3091,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -3256,8 +3117,8 @@ yyreturn: } -/* Line 2055 of yacc.c */ -#line 1105 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1105 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" + diff --git a/tools/tarsparse/tars.lex.cpp b/tools/tarsparse/tars.lex.cpp index 4cce193..21382ba 100644 --- a/tools/tarsparse/tars.lex.cpp +++ b/tools/tarsparse/tars.lex.cpp @@ -1,6 +1,6 @@ -#line 2 "tars.lex.cpp" +#line 1 "tars.lex.cpp" -#line 4 "tars.lex.cpp" +#line 3 "tars.lex.cpp" #define YY_INT_ALIGNED short int @@ -8,8 +8,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -84,65 +85,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -166,21 +163,28 @@ extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ - int yyl;\ + yy_size_t yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -195,7 +199,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -210,7 +213,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -238,7 +241,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -266,7 +269,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -277,7 +280,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -289,7 +291,7 @@ static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -298,82 +300,78 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; - int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 13 #define YY_END_OF_BUFFER 14 /* This struct is not used in this scanner, @@ -383,7 +381,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[52] = +static const flex_int16_t yy_accept[52] = { 0, 0, 0, 0, 0, 14, 12, 11, 11, 8, 12, 12, 12, 12, 9, 9, 12, 6, 13, 13, 0, @@ -393,7 +391,7 @@ static yyconst flex_int16_t yy_accept[52] = 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, @@ -425,14 +423,14 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[29] = +static const YY_CHAR yy_meta[29] = { 0, 1, 2, 3, 2, 1, 1, 2, 1, 4, 4, 1, 1, 5, 5, 5, 1, 6, 6, 6, 2, 6, 6, 6, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[58] = +static const flex_int16_t yy_base[58] = { 0, 0, 0, 119, 118, 122, 125, 125, 125, 125, 97, 18, 21, 29, 31, 25, 104, 48, 125, 114, 83, @@ -442,7 +440,7 @@ static yyconst flex_int16_t yy_base[58] = 125, 95, 100, 106, 109, 110, 113 } ; -static yyconst flex_int16_t yy_def[58] = +static const flex_int16_t yy_def[58] = { 0, 51, 1, 52, 52, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 14, 51, 53, 51, 54, 51, @@ -452,7 +450,7 @@ static yyconst flex_int16_t yy_def[58] = 0, 51, 51, 51, 51, 51, 51 } ; -static yyconst flex_int16_t yy_nxt[154] = +static const flex_int16_t yy_nxt[154] = { 0, 6, 7, 8, 7, 9, 10, 6, 6, 11, 11, 12, 13, 14, 15, 15, 16, 17, 17, 17, 17, @@ -473,7 +471,7 @@ static yyconst flex_int16_t yy_nxt[154] = 51, 51, 51 } ; -static yyconst flex_int16_t yy_chk[154] = +static const flex_int16_t yy_chk[154] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -495,7 +493,7 @@ static yyconst flex_int16_t yy_chk[154] = } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[14] = +static const flex_int32_t yy_rule_can_match_eol[14] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, }; @@ -513,7 +511,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 1 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" /** * Tencent is pleased to support the open source community by making Tars available. * @@ -529,7 +527,7 @@ char *yytext; * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -#line 20 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 20 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" #include #include #include @@ -566,8 +564,9 @@ int isatty(int) return 0; } +#line 567 "tars.lex.cpp" -#line 571 "tars.lex.cpp" +#line 569 "tars.lex.cpp" #define INITIAL 0 #define INCL 1 @@ -576,36 +575,36 @@ int isatty(int) #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy ( void ); -int yyget_debug (void ); +int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + yy_size_t yyget_leng ( void ); -char *yyget_text (void ); +char *yyget_text ( void ); -int yyget_lineno (void ); +int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -613,35 +612,43 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + static void yyunput ( int c, char *buf_ptr ); + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -649,7 +656,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -660,7 +667,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -673,7 +680,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -728,7 +735,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -738,15 +745,10 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 67 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" - - -#line 749 "tars.lex.cpp" - if ( !(yy_init) ) { (yy_init) = 1; @@ -767,13 +769,19 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 67 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" + + +#line 782 "tars.lex.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -789,7 +797,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -799,9 +807,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 52 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 125 ); @@ -819,10 +827,10 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) - + yylineno++; ; } @@ -840,12 +848,12 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 69 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 69 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { BEGIN(INCL); } YY_BREAK case 2: YY_RULE_SETUP -#line 71 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 71 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { if ( include_file_stack_ptr >= MAX_INCLUDE_DEPTH ) { @@ -869,7 +877,7 @@ YY_RULE_SETUP g_parse->error("can't open file:" + file); } - yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) ); + yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ) ); g_parse->pushFile(file); } @@ -878,7 +886,7 @@ YY_RULE_SETUP YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INCL): -#line 101 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 101 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { --include_file_stack_ptr; if ( include_file_stack_ptr < 0 ) @@ -888,7 +896,7 @@ case YY_STATE_EOF(INCL): } else { - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); fclose(yyin); yy_switch_to_buffer(include_file_stack[include_file_stack_ptr].state ); g_parse->popFile(); @@ -897,14 +905,14 @@ case YY_STATE_EOF(INCL): YY_BREAK case 3: YY_RULE_SETUP -#line 117 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 117 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { return TARS_SCOPE_DELIMITER; } YY_BREAK case 4: YY_RULE_SETUP -#line 121 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 121 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { // C++ comment bool e = false; @@ -925,7 +933,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 139 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 139 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { // C comment bool e = false; @@ -976,7 +984,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 187 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 187 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { StringGrammarPtr ident = new StringGrammar; ident->v = yytext; @@ -987,7 +995,7 @@ YY_RULE_SETUP case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 194 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 194 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { StringGrammarPtr ident = new StringGrammar; ident->v = yytext; @@ -1000,7 +1008,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 204 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 204 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { StringGrammarPtr str = new StringGrammar; bool e = false; @@ -1115,7 +1123,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 316 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 316 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { errno = 0; IntergerGrammarPtr ptr = new IntergerGrammar; @@ -1140,7 +1148,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 338 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 338 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { errno = 0; FloatGrammarPtr ptr = new FloatGrammar; @@ -1175,7 +1183,7 @@ YY_RULE_SETUP case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 369 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 369 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { if(yytext[0] == '\n') { @@ -1185,7 +1193,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 376 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 376 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" { if(yytext[0] < 32 || yytext[0] > 126) { @@ -1204,10 +1212,10 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 392 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" +#line 392 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" ECHO; YY_BREAK -#line 1211 "tars.lex.cpp" +#line 1218 "tars.lex.cpp" case YY_END_OF_BUFFER: { @@ -1283,7 +1291,7 @@ ECHO; { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1336,6 +1344,7 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1347,9 +1356,9 @@ ECHO; */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1378,7 +1387,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1414,11 +1423,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1446,7 +1456,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -1460,12 +1470,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1481,14 +1494,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1498,9 +1511,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 52 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1513,10 +1526,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1526,17 +1539,19 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 52 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 51); return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -1546,10 +1561,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1558,7 +1573,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1575,6 +1590,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1616,14 +1633,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1646,7 +1663,7 @@ static int yy_get_next_buffer (void) (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - + yylineno++; ; @@ -1665,11 +1682,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -1697,7 +1714,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1725,7 +1742,7 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1734,13 +1751,13 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -1759,9 +1776,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -1773,7 +1790,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1816,7 +1833,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1847,7 +1864,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1866,7 +1883,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1884,15 +1901,15 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1901,7 +1918,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -1921,7 +1938,7 @@ static void yyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { @@ -1931,23 +1948,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } @@ -1960,10 +1977,10 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -1973,16 +1990,16 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -1991,7 +2008,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -2007,9 +2024,9 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2020,7 +2037,7 @@ static void yy_fatal_error (yyconst char* msg ) do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ @@ -2037,7 +2054,7 @@ static void yy_fatal_error (yyconst char* msg ) */ int yyget_lineno (void) { - + return yylineno; } @@ -2075,29 +2092,29 @@ char *yyget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -2105,9 +2122,9 @@ int yyget_debug (void) return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -2119,10 +2136,10 @@ static int yy_init_globals (void) /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -2131,8 +2148,8 @@ static int yy_init_globals (void) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -2147,7 +2164,7 @@ int yylex_destroy (void) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -2168,18 +2185,19 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2189,11 +2207,12 @@ static int yy_flex_strlen (yyconst char * s ) void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2201,18 +2220,17 @@ void *yyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 392 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.l" - +#line 392 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.l" diff --git a/tools/tarsparse/tars.tab.cpp b/tools/tarsparse/tars.tab.cpp index 483d33f..25e7386 100644 --- a/tools/tarsparse/tars.tab.cpp +++ b/tools/tarsparse/tars.tab.cpp @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program 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 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 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 this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,62 +55,11 @@ /* Pure parsers. */ #define YYPURE 0 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 17 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" - -#include -#include -#include - -using namespace std; - -#define YYSTYPE GrammarBasePtr - -#include "parse.h" -#define YYDEBUG 1 -#define YYINITDEPTH 10000 - -/* Line 371 of yacc.c */ -#line 82 "tars.tab.cpp" - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "tars.tab.hpp". */ -#ifndef YY_YY_TARS_TAB_HPP_INCLUDED -# define YY_YY_TARS_TAB_HPP_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int yydebug; -#endif - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -147,37 +99,90 @@ extern int yydebug; BAD_CHAR = 288 }; #endif +/* Tokens. */ +#define TARS_VOID 258 +#define TARS_STRUCT 259 +#define TARS_BOOL 260 +#define TARS_BYTE 261 +#define TARS_SHORT 262 +#define TARS_INT 263 +#define TARS_DOUBLE 264 +#define TARS_FLOAT 265 +#define TARS_LONG 266 +#define TARS_STRING 267 +#define TARS_VECTOR 268 +#define TARS_MAP 269 +#define TARS_NAMESPACE 270 +#define TARS_INTERFACE 271 +#define TARS_IDENTIFIER 272 +#define TARS_OUT 273 +#define TARS_OP 274 +#define TARS_KEY 275 +#define TARS_ROUTE_KEY 276 +#define TARS_REQUIRE 277 +#define TARS_OPTIONAL 278 +#define TARS_CONST_INTEGER 279 +#define TARS_CONST_FLOAT 280 +#define TARS_FALSE 281 +#define TARS_TRUE 282 +#define TARS_STRING_LITERAL 283 +#define TARS_SCOPE_DELIMITER 284 +#define TARS_CONST 285 +#define TARS_ENUM 286 +#define TARS_UNSIGNED 287 +#define BAD_CHAR 288 + + +/* Copy the first part of user declarations. */ +#line 17 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" + +#include +#include +#include + +using namespace std; + +#define YYSTYPE GrammarBasePtr + +#include "parse.h" +#define YYDEBUG 1 +#define YYINITDEPTH 10000 + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_TARS_TAB_HPP_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 181 "tars.tab.cpp" + +/* Line 216 of yacc.c. */ +#line 186 "tars.tab.cpp" #ifdef short # undef short @@ -230,36 +235,36 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ -# define YY_(Msgid) Msgid +# define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YYUSE(e) ((void) (e)) #else -# define YYUSE(E) /* empty */ +# define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(N) (N) +# define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -280,12 +285,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -308,24 +312,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -341,9 +345,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -354,19 +358,35 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -374,26 +394,6 @@ union yyalloc #endif -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - /* YYFINAL -- State number of the termination state. */ #define YYFINAL 75 /* YYLAST -- Last index in YYTABLE. */ @@ -534,7 +534,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -547,15 +547,15 @@ static const char *const yytname[] = "TARS_CONST_FLOAT", "TARS_FALSE", "TARS_TRUE", "TARS_STRING_LITERAL", "TARS_SCOPE_DELIMITER", "TARS_CONST", "TARS_ENUM", "TARS_UNSIGNED", "BAD_CHAR", "';'", "'{'", "'}'", "','", "'='", "'['", "']'", "')'", - "'*'", "':'", "'<'", "'>'", "$accept", "start", "definitions", "$@1", - "$@2", "definition", "enum_def", "@3", "enum_id", "enumerator_list", - "enumerator", "namespace_def", "@4", "key_def", "$@5", "key_members", + "'*'", "':'", "'<'", "'>'", "$accept", "start", "definitions", "@1", + "@2", "definition", "enum_def", "@3", "enum_id", "enumerator_list", + "enumerator", "namespace_def", "@4", "key_def", "@5", "key_members", "interface_def", "@6", "interface_id", "interface_exports", "interface_export", "operation", "operation_preamble", "return_type", "parameters", "routekey_qualifier", "out_qualifier", "struct_def", "@7", "struct_id", "struct_exports", "data_member", "struct_type_id", "const_initializer", "const_def", "type_id", "type", "type_no", "vector", - "map", "scoped_name", "keyword", YY_NULL + "map", "scoped_name", "keyword", 0 }; #endif @@ -610,8 +610,8 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -686,7 +686,8 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -113 static const yytype_int16 yytable[] = { @@ -749,12 +750,6 @@ static const yytype_int16 yytable[] = 0, 0, 65, 0, 0, 66 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-146))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 6, 52, 84, 85, 149, 2, 1, 4, 1, 1, @@ -854,50 +849,78 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) -/* Error token number */ + #define YYTERROR 1 #define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else @@ -947,8 +970,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) YYSTYPE const * const yyvaluep; #endif { - FILE *yyo = yyoutput; - YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT @@ -960,7 +981,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) switch (yytype) { default: - break; + break; } } @@ -998,20 +1019,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1045,11 +1063,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1086,6 +1104,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1188,145 +1207,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1355,32 +1344,40 @@ yydestruct (yymsg, yytype, yyvaluep) { default: - break; + break; } } + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ - -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; + /*----------. | yyparse. | `----------*/ @@ -1407,37 +1404,14 @@ yyparse () #endif #endif { - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - + + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1445,22 +1419,54 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -1487,6 +1493,7 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1494,6 +1501,7 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -1516,8 +1524,9 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1528,6 +1537,7 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1537,9 +1547,6 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1548,16 +1555,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1583,27 +1590,29 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1640,93 +1649,81 @@ yyreduce: switch (yyn) { case 3: -/* Line 1792 of yacc.c */ -#line 75 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 75 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 5: -/* Line 1792 of yacc.c */ -#line 79 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 79 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { yyerrok; -} +;} break; case 7: -/* Line 1792 of yacc.c */ -#line 84 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 84 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("`;' missing after definition"); -} +;} break; case 8: -/* Line 1792 of yacc.c */ -#line 88 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 88 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 9: -/* Line 1792 of yacc.c */ -#line 96 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 96 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || NamespacePtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 10: -/* Line 1792 of yacc.c */ -#line 100 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 100 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || InterfacePtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 11: -/* Line 1792 of yacc.c */ -#line 104 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 104 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 12: -/* Line 1792 of yacc.c */ -#line 108 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 108 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 13: -/* Line 1792 of yacc.c */ -#line 111 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 111 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 14: -/* Line 1792 of yacc.c */ -#line 115 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 115 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); -} +;} break; case 15: -/* Line 1792 of yacc.c */ -#line 124 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 124 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(1) - (1)]); -} +;} break; case 16: -/* Line 1792 of yacc.c */ -#line 128 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 128 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(3) - (5)])) { @@ -1739,12 +1736,11 @@ yyreduce: } (yyval) = (yyvsp[(2) - (5)]); -} +;} break; case 17: -/* Line 1792 of yacc.c */ -#line 147 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 147 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { NamespacePtr c = NamespacePtr::dynamicCast(g_parse->currentContainer()); if(!c) @@ -1756,37 +1752,33 @@ yyreduce: g_parse->pushContainer(e); (yyval) = e; -} +;} break; case 18: -/* Line 1792 of yacc.c */ -#line 160 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 160 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as enumeration name"); (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 19: -/* Line 1792 of yacc.c */ -#line 171 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 171 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (3)]); -} +;} break; case 20: -/* Line 1792 of yacc.c */ -#line 175 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 175 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 21: -/* Line 1792 of yacc.c */ -#line 183 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 183 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong)); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -1796,21 +1788,19 @@ yyreduce: assert(e); e->addMember(tPtr); (yyval) = e; -} +;} break; case 22: -/* Line 1792 of yacc.c */ -#line 194 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 194 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); g_parse->error("keyword `" + ident->v + "' cannot be used as enumerator"); -} +;} break; case 23: -/* Line 1792 of yacc.c */ -#line 199 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 199 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong)); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); @@ -1822,19 +1812,17 @@ yyreduce: assert(e); e->addMember(tPtr); (yyval) = e; -} +;} break; case 24: -/* Line 1792 of yacc.c */ -#line 212 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 212 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 25: -/* Line 1792 of yacc.c */ -#line 220 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 220 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); ContainerPtr c = g_parse->currentContainer(); @@ -1848,12 +1836,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 26: -/* Line 1792 of yacc.c */ -#line 235 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 235 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(3) - (6)])) { @@ -1864,12 +1851,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 27: -/* Line 1792 of yacc.c */ -#line 253 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 253 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); StructPtr sp = StructPtr::dynamicCast(g_parse->findUserType(ident->v)); @@ -1879,19 +1865,17 @@ yyreduce: } g_parse->setKeyStruct(sp); -} +;} break; case 28: -/* Line 1792 of yacc.c */ -#line 264 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 264 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 29: -/* Line 1792 of yacc.c */ -#line 272 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 272 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); StructPtr np = g_parse->getKeyStruct(); @@ -1903,12 +1887,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 30: -/* Line 1792 of yacc.c */ -#line 285 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 285 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); StructPtr np = g_parse->getKeyStruct(); @@ -1920,12 +1903,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 31: -/* Line 1792 of yacc.c */ -#line 304 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 304 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -1941,12 +1923,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 32: -/* Line 1792 of yacc.c */ -#line 321 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 321 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(2) - (5)])) { @@ -1957,59 +1938,52 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 33: -/* Line 1792 of yacc.c */ -#line 338 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 338 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 34: -/* Line 1792 of yacc.c */ -#line 342 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 342 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as interface name"); (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 35: -/* Line 1792 of yacc.c */ -#line 353 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 353 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 36: -/* Line 1792 of yacc.c */ -#line 356 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 356 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 37: -/* Line 1792 of yacc.c */ -#line 359 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 359 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("`;' missing after definition"); -} +;} break; case 38: -/* Line 1792 of yacc.c */ -#line 363 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 363 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 40: -/* Line 1792 of yacc.c */ -#line 377 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 377 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(1) - (3)])) { @@ -2020,12 +1994,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 41: -/* Line 1792 of yacc.c */ -#line 394 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 394 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr returnType = TypePtr::dynamicCast((yyvsp[(1) - (2)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2048,27 +2021,24 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 43: -/* Line 1792 of yacc.c */ -#line 424 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 424 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = 0; -} +;} break; case 44: -/* Line 1792 of yacc.c */ -#line 434 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 434 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 45: -/* Line 1792 of yacc.c */ -#line 437 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 437 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -2078,12 +2048,11 @@ yyreduce: { op->createParamDecl(tsp, false, false); } -} +;} break; case 46: -/* Line 1792 of yacc.c */ -#line 448 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 448 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(3) - (3)])); @@ -2093,12 +2062,11 @@ yyreduce: { op->createParamDecl(tsp, false, false); } -} +;} break; case 47: -/* Line 1792 of yacc.c */ -#line 459 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 459 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2109,12 +2077,11 @@ yyreduce: { op->createParamDecl(tsp, isOutParam->v, false); } -} +;} break; case 48: -/* Line 1792 of yacc.c */ -#line 471 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 471 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)])); @@ -2125,12 +2092,11 @@ yyreduce: { op->createParamDecl(tsp, isOutParam->v, false); } -} +;} break; case 49: -/* Line 1792 of yacc.c */ -#line 483 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 483 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2141,12 +2107,11 @@ yyreduce: { op->createParamDecl(tsp, false, isRouteKeyParam->v); } -} +;} break; case 50: -/* Line 1792 of yacc.c */ -#line 495 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 495 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)])); @@ -2157,48 +2122,43 @@ yyreduce: { op->createParamDecl(tsp, false, isRouteKeyParam->v); } -} +;} break; case 51: -/* Line 1792 of yacc.c */ -#line 507 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 507 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("'out' must be defined with a type"); -} +;} break; case 52: -/* Line 1792 of yacc.c */ -#line 511 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 511 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("'routekey' must be defined with a type"); -} +;} break; case 53: -/* Line 1792 of yacc.c */ -#line 520 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 520 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr routekey = new BoolGrammar; routekey->v = true; (yyval) = GrammarBasePtr::dynamicCast(routekey); -} +;} break; case 54: -/* Line 1792 of yacc.c */ -#line 531 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 531 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { BoolGrammarPtr out = new BoolGrammar; out->v = true; (yyval) = GrammarBasePtr::dynamicCast(out); -} +;} break; case 55: -/* Line 1792 of yacc.c */ -#line 542 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 542 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer()); @@ -2219,12 +2179,11 @@ yyreduce: { g_parse->error("struct '" + ident->v + "' must definition in namespace"); } -} +;} break; case 56: -/* Line 1792 of yacc.c */ -#line 564 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 564 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { if((yyvsp[(2) - (5)])) { @@ -2238,69 +2197,61 @@ yyreduce: { g_parse->error("struct `" + st->getSid() + "' must have at least one member"); } -} +;} break; case 57: -/* Line 1792 of yacc.c */ -#line 584 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 584 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(2) - (2)]); -} +;} break; case 58: -/* Line 1792 of yacc.c */ -#line 588 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 588 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as struct name"); -} +;} break; case 59: -/* Line 1792 of yacc.c */ -#line 594 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 594 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("abstract declarator '' used as declaration"); -} +;} break; case 60: -/* Line 1792 of yacc.c */ -#line 603 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 603 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 61: -/* Line 1792 of yacc.c */ -#line 607 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 607 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("';' missing after definition"); -} +;} break; case 62: -/* Line 1792 of yacc.c */ -#line 611 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 611 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 63: -/* Line 1792 of yacc.c */ -#line 621 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 621 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 64: -/* Line 1792 of yacc.c */ -#line 630 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 630 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2317,12 +2268,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 65: -/* Line 1792 of yacc.c */ -#line 648 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 648 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2343,12 +2293,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 66: -/* Line 1792 of yacc.c */ -#line 670 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 670 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2369,12 +2318,11 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 67: -/* Line 1792 of yacc.c */ -#line 692 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 692 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer()); if(np) @@ -2390,44 +2338,39 @@ yyreduce: { (yyval) = 0; } -} +;} break; case 68: -/* Line 1792 of yacc.c */ -#line 709 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 709 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag'"); -} +;} break; case 69: -/* Line 1792 of yacc.c */ -#line 713 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 713 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag'"); -} +;} break; case 70: -/* Line 1792 of yacc.c */ -#line 717 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 717 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'require' or 'optional'"); -} +;} break; case 71: -/* Line 1792 of yacc.c */ -#line 721 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 721 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("struct member need 'tag' or 'require' or 'optional'"); -} +;} break; case 72: -/* Line 1792 of yacc.c */ -#line 730 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 730 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { IntergerGrammarPtr intVal = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ostringstream sstr; @@ -2436,12 +2379,11 @@ yyreduce: c->t = ConstGrammar::VALUE; c->v = sstr.str(); (yyval) = c; -} +;} break; case 73: -/* Line 1792 of yacc.c */ -#line 740 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 740 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { FloatGrammarPtr floatVal = FloatGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ostringstream sstr; @@ -2450,48 +2392,44 @@ yyreduce: c->t = ConstGrammar::VALUE; c->v = sstr.str(); (yyval) = c; -} +;} break; case 74: -/* Line 1792 of yacc.c */ -#line 750 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 750 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::STRING; c->v = ident->v; (yyval) = c; -} +;} break; case 75: -/* Line 1792 of yacc.c */ -#line 758 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 758 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::BOOL; c->v = ident->v; (yyval) = c; -} +;} break; case 76: -/* Line 1792 of yacc.c */ -#line 766 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 766 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); ConstGrammarPtr c = new ConstGrammar(); c->t = ConstGrammar::BOOL; c->v = ident->v; (yyval) = c; -} +;} break; case 77: -/* Line 1792 of yacc.c */ -#line 774 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 774 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -2503,12 +2441,11 @@ yyreduce: c->t = ConstGrammar::ENUM; c->v = ident->v; (yyval) = c; -} +;} break; case 78: -/* Line 1792 of yacc.c */ -#line 787 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 787 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); @@ -2522,12 +2459,11 @@ yyreduce: c->t = ConstGrammar::ENUM; c->v = scoped->v + "::" + ident->v; (yyval) = c; -} +;} break; case 79: -/* Line 1792 of yacc.c */ -#line 807 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 807 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer()); if(!np) @@ -2539,12 +2475,11 @@ yyreduce: ConstGrammarPtr c = ConstGrammarPtr::dynamicCast((yyvsp[(4) - (4)])); ConstPtr cPtr = np->createConst(t, c); (yyval) = cPtr; -} +;} break; case 80: -/* Line 1792 of yacc.c */ -#line 825 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 825 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2552,12 +2487,11 @@ yyreduce: TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 81: -/* Line 1792 of yacc.c */ -#line 834 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 834 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (5)]))); IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(4) - (5)])); @@ -2566,12 +2500,11 @@ yyreduce: StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (5)])); TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 82: -/* Line 1792 of yacc.c */ -#line 844 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 844 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (3)]))); //IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast($4); @@ -2580,12 +2513,11 @@ yyreduce: StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); TypeIdPtr typeIdPtr = new TypeId(type, ident->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 83: -/* Line 1792 of yacc.c */ -#line 854 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 854 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (4)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2593,37 +2525,33 @@ yyreduce: IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(3) - (4)])); g_parse->checkArrayVaid(type,iPtrSize->v); (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr); -} +;} break; case 84: -/* Line 1792 of yacc.c */ -#line 863 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 863 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); g_parse->error("keyword `" + ident->v + "' cannot be used as data member name"); -} +;} break; case 85: -/* Line 1792 of yacc.c */ -#line 868 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 868 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("missing data member name"); -} +;} break; case 86: -/* Line 1792 of yacc.c */ -#line 872 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 872 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("unkown type"); -} +;} break; case 87: -/* Line 1792 of yacc.c */ -#line 881 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 881 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (3)])); @@ -2631,132 +2559,116 @@ yyreduce: g_parse->checkArrayVaid(type,iPtrSize->v); type->setArray(iPtrSize->v); (yyval) = type; -} +;} break; case 88: -/* Line 1792 of yacc.c */ -#line 890 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 890 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = (yyvsp[(1) - (1)]); -} +;} break; case 89: -/* Line 1792 of yacc.c */ -#line 894 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 894 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("array missing size"); -} +;} break; case 90: -/* Line 1792 of yacc.c */ -#line 903 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 903 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindBool); -} +;} break; case 91: -/* Line 1792 of yacc.c */ -#line 907 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 907 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindByte); -} +;} break; case 92: -/* Line 1792 of yacc.c */ -#line 911 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 911 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindShort,true); -} +;} break; case 93: -/* Line 1792 of yacc.c */ -#line 915 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 915 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindShort); -} +;} break; case 94: -/* Line 1792 of yacc.c */ -#line 919 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 919 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindInt,true); -} +;} break; case 95: -/* Line 1792 of yacc.c */ -#line 923 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 923 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindInt); -} +;} break; case 96: -/* Line 1792 of yacc.c */ -#line 927 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 927 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindLong,true); -} +;} break; case 97: -/* Line 1792 of yacc.c */ -#line 931 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 931 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindLong); -} +;} break; case 98: -/* Line 1792 of yacc.c */ -#line 935 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 935 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindFloat); -} +;} break; case 99: -/* Line 1792 of yacc.c */ -#line 939 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 939 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindDouble); -} +;} break; case 100: -/* Line 1792 of yacc.c */ -#line 943 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 943 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = g_parse->createBuiltin(Builtin::KindString); -} +;} break; case 101: -/* Line 1792 of yacc.c */ -#line 947 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 947 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 102: -/* Line 1792 of yacc.c */ -#line 951 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 951 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)])); -} +;} break; case 103: -/* Line 1792 of yacc.c */ -#line 955 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 955 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)])); TypePtr sp = g_parse->findUserType(ident->v); @@ -2768,277 +2680,232 @@ yyreduce: { g_parse->error("'" + ident->v + "' undefined!"); } -} +;} break; case 104: -/* Line 1792 of yacc.c */ -#line 973 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 973 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast(g_parse->createVector(TypePtr::dynamicCast((yyvsp[(3) - (4)])))); -} +;} break; case 105: -/* Line 1792 of yacc.c */ -#line 977 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 977 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector error"); -} +;} break; case 106: -/* Line 1792 of yacc.c */ -#line 981 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 981 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector missing '>'"); -} +;} break; case 107: -/* Line 1792 of yacc.c */ -#line 985 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 985 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("vector missing type"); -} +;} break; case 108: -/* Line 1792 of yacc.c */ -#line 994 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 994 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { (yyval) = GrammarBasePtr::dynamicCast(g_parse->createMap(TypePtr::dynamicCast((yyvsp[(3) - (6)])), TypePtr::dynamicCast((yyvsp[(5) - (6)])))); -} +;} break; case 109: -/* Line 1792 of yacc.c */ -#line 998 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 998 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { g_parse->error("map error"); -} +;} break; case 110: -/* Line 1792 of yacc.c */ -#line 1007 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1007 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 111: -/* Line 1792 of yacc.c */ -#line 1010 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1010 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)])); ident->v = "::" + ident->v; (yyval) = GrammarBasePtr::dynamicCast(ident); -} +;} break; case 112: -/* Line 1792 of yacc.c */ -#line 1016 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1016 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)])); StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)])); scoped->v += "::"; scoped->v += ident->v; (yyval) = GrammarBasePtr::dynamicCast(scoped); -} +;} break; case 113: -/* Line 1792 of yacc.c */ -#line 1029 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1029 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 114: -/* Line 1792 of yacc.c */ -#line 1032 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1032 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 115: -/* Line 1792 of yacc.c */ -#line 1035 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1035 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 116: -/* Line 1792 of yacc.c */ -#line 1038 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1038 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 117: -/* Line 1792 of yacc.c */ -#line 1041 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1041 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 118: -/* Line 1792 of yacc.c */ -#line 1044 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1044 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 119: -/* Line 1792 of yacc.c */ -#line 1047 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1047 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 120: -/* Line 1792 of yacc.c */ -#line 1050 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1050 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 121: -/* Line 1792 of yacc.c */ -#line 1053 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1053 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 122: -/* Line 1792 of yacc.c */ -#line 1056 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1056 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 123: -/* Line 1792 of yacc.c */ -#line 1059 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1059 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 124: -/* Line 1792 of yacc.c */ -#line 1062 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1062 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 125: -/* Line 1792 of yacc.c */ -#line 1065 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1065 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 126: -/* Line 1792 of yacc.c */ -#line 1068 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1068 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 127: -/* Line 1792 of yacc.c */ -#line 1071 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1071 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 128: -/* Line 1792 of yacc.c */ -#line 1074 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1074 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 129: -/* Line 1792 of yacc.c */ -#line 1077 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1077 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 130: -/* Line 1792 of yacc.c */ -#line 1080 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1080 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 131: -/* Line 1792 of yacc.c */ -#line 1083 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1083 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 132: -/* Line 1792 of yacc.c */ -#line 1086 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1086 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 133: -/* Line 1792 of yacc.c */ -#line 1089 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1089 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 134: -/* Line 1792 of yacc.c */ -#line 1092 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1092 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 135: -/* Line 1792 of yacc.c */ -#line 1095 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1095 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 136: -/* Line 1792 of yacc.c */ -#line 1098 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1098 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; case 137: -/* Line 1792 of yacc.c */ -#line 1101 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1101 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" { -} +;} break; -/* Line 1792 of yacc.c */ -#line 3029 "tars.tab.cpp" +/* Line 1267 of yacc.c. */ +#line 2907 "tars.tab.cpp" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -3047,6 +2914,7 @@ yyreduce: *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3066,10 +2934,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -3077,36 +2941,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -3114,7 +2979,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -3131,7 +2996,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -3165,7 +3030,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -3188,9 +3053,10 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -3214,7 +3080,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined yyoverflow || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -3225,14 +3091,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -3256,8 +3117,8 @@ yyreturn: } -/* Line 2055 of yacc.c */ -#line 1105 "/home/worker/Centos_share/src/TarsCloud/UP-Tars/tars_kiven_dev/TarsCpp/tools/tarsgrammar/tars.y" +#line 1105 "/Users/jarod/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y" + diff --git a/tools/tarsparse/tars.tab.hpp b/tools/tarsparse/tars.tab.hpp index 5de0922..4968554 100644 --- a/tools/tarsparse/tars.tab.hpp +++ b/tools/tarsparse/tars.tab.hpp @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program 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 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 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 this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,20 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_YY_TARS_TAB_HPP_INCLUDED -# define YY_YY_TARS_TAB_HPP_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int yydebug; -#endif - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -79,29 +72,48 @@ extern int yydebug; BAD_CHAR = 288 }; #endif +/* Tokens. */ +#define TARS_VOID 258 +#define TARS_STRUCT 259 +#define TARS_BOOL 260 +#define TARS_BYTE 261 +#define TARS_SHORT 262 +#define TARS_INT 263 +#define TARS_DOUBLE 264 +#define TARS_FLOAT 265 +#define TARS_LONG 266 +#define TARS_STRING 267 +#define TARS_VECTOR 268 +#define TARS_MAP 269 +#define TARS_NAMESPACE 270 +#define TARS_INTERFACE 271 +#define TARS_IDENTIFIER 272 +#define TARS_OUT 273 +#define TARS_OP 274 +#define TARS_KEY 275 +#define TARS_ROUTE_KEY 276 +#define TARS_REQUIRE 277 +#define TARS_OPTIONAL 278 +#define TARS_CONST_INTEGER 279 +#define TARS_CONST_FLOAT 280 +#define TARS_FALSE 281 +#define TARS_TRUE 282 +#define TARS_STRING_LITERAL 283 +#define TARS_SCOPE_DELIMITER 284 +#define TARS_CONST 285 +#define TARS_ENUM 286 +#define TARS_UNSIGNED 287 +#define BAD_CHAR 288 + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_TARS_TAB_HPP_INCLUDED */ diff --git a/unit-test/server/Hello.h b/unit-test/server/Hello.h index b1a08a3..9a61108 100644 --- a/unit-test/server/Hello.h +++ b/unit-test/server/Hello.h @@ -1,6 +1,6 @@ // ********************************************************************** // This file was generated by a TARS parser! -// TARS version 3.0.3. +// TARS version 3.0.4. // ********************************************************************** #ifndef __HELLO_H_ diff --git a/unit-test/util/test_tc_epoller_server.cpp b/unit-test/util/test_tc_epoller_server.cpp index 61ac9f6..44f33e4 100644 --- a/unit-test/util/test_tc_epoller_server.cpp +++ b/unit-test/util/test_tc_epoller_server.cpp @@ -111,7 +111,7 @@ TEST_F(UtilEpollServerTest, RunTcp) TEST_F(UtilEpollServerTest, RunEnableManualListen) { - int i = 0; +// int i = 0; for(int i = 0; i <= TC_EpollServer::NET_THREAD_MERGE_HANDLES_CO; i++) { MyTcpServer server; diff --git a/unit-test/util/test_tc_port.cpp b/unit-test/util/test_tc_port.cpp new file mode 100755 index 0000000..cfe889c --- /dev/null +++ b/unit-test/util/test_tc_port.cpp @@ -0,0 +1,35 @@ +#include "util/tc_port.h" +#include "util/tc_common.h" +#include +#include "gtest/gtest.h" + +#include +#include + +using namespace std; +using namespace tars; + +class UtilPortTest : public testing::Test +{ +public: + //添加日志 + static void SetUpTestCase() + { + } + static void TearDownTestCase() + { + } + virtual void SetUp() //TEST跑之前会执行SetUp + { + } + virtual void TearDown() //TEST跑完之后会执行TearDown + { + } +}; + +TEST_F(UtilPortTest, testExec) +{ + string err; + string result = TC_Port::exec("ls '*.txt'", err); + cout << result << endl; +} diff --git a/util/include/util/tc_clientsocket.h b/util/include/util/tc_clientsocket.h index a8ac627..fc54483 100644 --- a/util/include/util/tc_clientsocket.h +++ b/util/include/util/tc_clientsocket.h @@ -369,6 +369,12 @@ public: */ void parse(const string &desc); + /* + * 解析成多个endpoint(tcp -h xxx -p yyy:udp -h xxx -p yyy:ssl -h xxx -p xxx) + * 支持ipv6地址 + */ + static vector sepEndpoint(const string& sEndpoints); + private: void init(const string& host, int port, int timeout, EType type, int grid, int qos, int weight, unsigned int weighttype, AUTH_TYPE authType); diff --git a/util/include/util/tc_port.h b/util/include/util/tc_port.h index ede3fc1..646e04e 100755 --- a/util/include/util/tc_port.h +++ b/util/include/util/tc_port.h @@ -2,6 +2,7 @@ #define __TC_PORT_H #include "util/tc_platform.h" +#include "util/tc_ex.h" #if TARGET_PLATFORM_LINUX || TARGET_PLATFORM_IOS @@ -36,6 +37,15 @@ using namespace std; namespace tars { +/** +* @brief 跨平台port异常类 +*/ +struct TC_Port_Exception : public TC_Exception +{ + TC_Port_Exception(const string &buffer) : TC_Exception(buffer){}; + ~TC_Port_Exception() throw() {}; +}; + class TC_Port { public: @@ -81,14 +91,47 @@ public: static int64_t getpid(); + /** + * 获取环境变量 + * @param name + * @return + */ static std::string getEnv(const std::string &name); + /** + * 设置环境变量 + * @param name + * @param value + */ static void setEnv(const std::string &name, const std::string &value); + /** + * 运行一个脚本 + * @param cmd + * @param err + * @return 程序的标准输出 + */ static std::string exec(const char* cmd); + + /** + * 运行一个脚本(程序+命令行) + * @param cmd + * @param err + * @return: 程序的标准输出 + */ static std::string exec(const char* cmd, std::string &err); /** + * fork子进程并运行程序 + * @param sExe: 可执行程序路径 + * @param sPwdPath: 程序运行的当前路径 + * @param sRollLogPath: 滚动日志路径(stdout会重定向到滚动日志), 为空则不重定向 + * @param vOptions: 参数 + * @return 子进程id: ==0: 子进程中, >0: 父进程中(子进程pid), 其他抛出异常 TC_Port_Exception + */ + static int64_t forkExec(const string& sExe, const string& sPwdPath, const string& sRollLogPath, const vector& vOptions); + + /** * 注册ctrl+c回调事件(SIGINT/CTRL_C_EVENT) * @param callback * @return size_t, 注册事件的id, 取消注册时需要 diff --git a/util/include/util/tc_thread_pool.h b/util/include/util/tc_thread_pool.h index 00e4d56..fca849a 100644 --- a/util/include/util/tc_thread_pool.h +++ b/util/include/util/tc_thread_pool.h @@ -250,7 +250,6 @@ public: */ void init(size_t num); - /** * @brief 停止所有线程, 会等待所有线程结束 */ diff --git a/util/src/tc_clientsocket.cpp b/util/src/tc_clientsocket.cpp index e4925b3..45aa6c2 100644 --- a/util/src/tc_clientsocket.cpp +++ b/util/src/tc_clientsocket.cpp @@ -256,6 +256,51 @@ void TC_Endpoint::parse(const string &str) // _authType = 1; } +vector TC_Endpoint::sepEndpoint(const string& sEndpoints) +{ + vector vEndpoints; + bool flag = false; + string::size_type startPos = 0; + string::size_type sepPos = 0; + for(string::size_type pos = 0; pos < sEndpoints.size(); pos++) + { + if(sEndpoints[pos] == ':' && !flag ) + { + sepPos = pos; + flag = true; + } + else if(flag) + { + if(sEndpoints[pos] == ' ') + { + continue; + } + + if(TC_Port::strncasecmp("tcp", (sEndpoints.c_str() + pos), 3) == 0 + || TC_Port::strncasecmp("udp", (sEndpoints.c_str() + pos), 3) == 0 + || TC_Port::strncasecmp("ssl", (sEndpoints.c_str() + pos), 3) == 0) + { + string ep = TC_Common::trim(string(sEndpoints.c_str() + startPos, sepPos - startPos)); + if(!ep.empty()) { + vEndpoints.push_back(ep); + } + startPos = pos; + } + + flag = false; + } + } + + string ep = sEndpoints.substr(startPos); + + if(!ep.empty()) { + vEndpoints.push_back(ep); + } + + return vEndpoints; +} + + /*************************************TC_TCPClient**************************************/ TC_ClientSocket::TC_ClientSocket() : _port(0),_timeout(3000) diff --git a/util/src/tc_port.cpp b/util/src/tc_port.cpp index 25cd635..7f447a5 100755 --- a/util/src/tc_port.cpp +++ b/util/src/tc_port.cpp @@ -272,6 +272,155 @@ std::string TC_Port::exec(const char* cmd, std::string &err) return fileData; } +int64_t TC_Port::forkExec(const string& sExePath, const string& sPwdPath, const string& sRollLogPath, const vector& vOptions) +{ + vector vEnvs; + + if (sExePath.empty()) + { + throw TC_Port_Exception("[TC_Port::forkExec] server exe: " + sExePath + " is empty."); + } + +#if TARGET_PLATFORM_LINUX || TARGET_PLATFORM_IOS + if (TC_File::isFileExistEx(sExePath) && !TC_File::canExecutable(sExePath)) + { + TC_File::setExecutable(sExePath, true); + } +#endif + + // + // Current directory + // + const char *pwdCStr = sPwdPath.c_str(); + +#if TARGET_PLATFORM_WINDOWS + vector vArgs; + + vArgs.insert(vArgs.end(), vOptions.begin(), vOptions.end()); + + string path; + for (vector::const_iterator p = vArgs.begin(); p != vArgs.end(); ++p) + { + path += " " + *p; + } + + string command = sExePath + " " + path; + + TCHAR p[1024]; + strncpy_s(p, sizeof(p) / sizeof(TCHAR), command.c_str(), command.length()); + + STARTUPINFO si; + memset(&si, 0, sizeof(si)); + PROCESS_INFORMATION pi; + memset(&pi, 0, sizeof(pi)); + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; //TRUE表示显示创建的进程的窗口 + + if (!CreateProcessA( + NULL, // 指向一个NULL结尾的、用来指定可执行模块的宽字节字符串 + p, // 命令行字符串 + NULL, // 指向一个SECURITY_ATTRIBUTES结构体,这个结构体决定是否返回的句柄可以被子进程继承。 + NULL, // 如果lpProcessAttributes参数为空(NULL),那么句柄不能被继承。<同上> + false, // 指示新进程是否从调用进程处继承了句柄。 + CREATE_NEW_CONSOLE|CREATE_DEFAULT_ERROR_MODE | NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, // 指定附加的、用来控制优先类和进程的创建的标 + NULL, // 指向一个新进程的环境块。如果此参数为空,新进程使用调用进程的环境 + pwdCStr, // 指定子进程的工作路径 + &si, // 决定新进程的主窗体如何显示的STARTUPINFO结构体 + &pi // 接收新进程的识别信息的PROCESS_INFORMATION结构体 + )) + { + string err = TC_Exception::parseError(TC_Exception::getSystemCode()); + + throw TC_Port_Exception("[TC_Port::forkExec] CreateProcessA exception:" + err); + } + + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + return pi.dwProcessId; + +#else + vector vArgs; + vArgs.push_back(sExePath); + vArgs.insert(vArgs.end(), vOptions.begin(), vOptions.end()); + + int argc = static_cast(vArgs.size()); + char **argv = static_cast(malloc((argc + 1) * sizeof(char *))); + int i = 0; + for (vector::const_iterator p = vArgs.begin(); p != vArgs.end(); ++p, ++i) + { + assert(i < argc); + argv[i] = strdup(p->c_str()); + } + assert(i == argc); + argv[argc] = 0; + + pid_t pid = fork(); + if (pid == -1) + { + throw TC_Port_Exception("[TC_Port::forkExec] fork exception"); + } + + if (pid == 0) + { + int maxFd = static_cast(sysconf(_SC_OPEN_MAX)); + for (int fd = 3; fd < maxFd; ++fd) + { + close(fd); + } + + //server stdcout 日志在滚动日志显示 + if (!sRollLogPath.empty()) + { + TC_File::makeDirRecursive(TC_File::extractFilePath(sRollLogPath)); +#if TARGET_PLATFORM_IOS + if ((freopen(sRollLogPath.c_str(), "ab", stdout)) != NULL && (freopen(sRollLogPath.c_str(), "ab", stderr)) != NULL) +#else + if ((freopen64(sRollLogPath.c_str(), "ab", stdout)) != NULL && (freopen64(sRollLogPath.c_str(), "ab", stderr)) != NULL) +#endif + { + cout << argv[0] << " redirect stdout and stderr to " << sRollLogPath << endl; + } + else + { + //重定向失败 直接退出 + exit(0); + } + } + else + { + cout << argv[0] << " cannot redirect stdout and stderr to log file sRollLogPath is empty" << endl; + } + +// for_each(vEnvs.begin(), vEnvs.end(), EnvVal()); + + if (strlen(pwdCStr) != 0) + { + if (chdir(pwdCStr) == -1) + { + cerr << argv[0] << " cannot change working directory to " << pwdCStr << "|errno=" << errno << endl; + } + } + + if (execvp(argv[0], argv) == -1) + { + cerr << "cannot execute " << argv[0] << "|errno=" << strerror(errno) << endl; + } + exit(0); + } + else + { + for (i = 0; argv[i]; i++) + { + free(argv[i]); + } + free(argv); + } + return pid; +#endif +} + + shared_ptr TC_Port::_sigInfo = std::make_shared();