summaryrefslogtreecommitdiff
path: root/cpp/demo/Manual/lifecycle
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Manual/lifecycle')
-rw-r--r--cpp/demo/Manual/lifecycle/Filesystem.ice6
-rw-r--r--cpp/demo/Manual/lifecycle/FilesystemI.cpp44
-rw-r--r--cpp/demo/Manual/lifecycle/Grammar.cpp370
-rw-r--r--cpp/demo/Manual/lifecycle/Grammar.h43
-rw-r--r--cpp/demo/Manual/lifecycle/Grammar.y3
-rw-r--r--cpp/demo/Manual/lifecycle/Makefile4
-rw-r--r--cpp/demo/Manual/lifecycle/Makefile.mak4
-rw-r--r--cpp/demo/Manual/lifecycle/Scanner.cpp51
-rw-r--r--cpp/demo/Manual/lifecycle/Scanner.l3
9 files changed, 283 insertions, 245 deletions
diff --git a/cpp/demo/Manual/lifecycle/Filesystem.ice b/cpp/demo/Manual/lifecycle/Filesystem.ice
index f3b3412a59b..bd925f659d0 100644
--- a/cpp/demo/Manual/lifecycle/Filesystem.ice
+++ b/cpp/demo/Manual/lifecycle/Filesystem.ice
@@ -44,8 +44,8 @@ module Filesystem {
interface Directory extends Node
{
idempotent NodeDescSeq list();
- idempotent NodeDesc find(string name) throws NoSuchName;
- File* createFile(string name) throws NameInUse;
- Directory* createDirectory(string name) throws NameInUse;
+ idempotent NodeDesc find(string nm) throws NoSuchName;
+ File* createFile(string nm) throws NameInUse;
+ Directory* createDirectory(string nm) throws NameInUse;
};
};
diff --git a/cpp/demo/Manual/lifecycle/FilesystemI.cpp b/cpp/demo/Manual/lifecycle/FilesystemI.cpp
index 982e72311db..86b2533e343 100644
--- a/cpp/demo/Manual/lifecycle/FilesystemI.cpp
+++ b/cpp/demo/Manual/lifecycle/FilesystemI.cpp
@@ -40,8 +40,8 @@ FilesystemI::NodeI::id() const
// NodeI constructor.
-FilesystemI::NodeI::NodeI(const string& name, const DirectoryIPtr& parent)
- : _name(name), _parent(parent), _destroyed(false)
+FilesystemI::NodeI::NodeI(const string& nm, const DirectoryIPtr& parent)
+ : _name(nm), _parent(parent), _destroyed(false)
{
//
// Create an identity. The root directory has the fixed identity "RootDir".
@@ -108,8 +108,8 @@ FilesystemI::FileI::destroy(const Current& c)
// FileI constructor.
-FilesystemI::FileI::FileI(const string& name, const DirectoryIPtr& parent)
- : NodeI(name, parent)
+FilesystemI::FileI::FileI(const string& nm, const DirectoryIPtr& parent)
+ : NodeI(nm, parent)
{
}
@@ -140,7 +140,7 @@ FilesystemI::DirectoryI::list(const Current& c)
// Slice Directory::find() operation.
NodeDesc
-FilesystemI::DirectoryI::find(const string& name, const Current& c)
+FilesystemI::DirectoryI::find(const string& nm, const Current& c)
{
IceUtil::Mutex::Lock lock(_m);
@@ -149,15 +149,15 @@ FilesystemI::DirectoryI::find(const string& name, const Current& c)
throw ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation);
}
- Contents::const_iterator pos = _contents.find(name);
+ Contents::const_iterator pos = _contents.find(nm);
if(pos == _contents.end())
{
- throw NoSuchName(name);
+ throw NoSuchName(nm);
}
NodeIPtr p = pos->second;
NodeDesc d;
- d.name = name;
+ d.name = nm;
d.type = FilePtr::dynamicCast(p) ? FileType : DirType;
d.proxy = NodePrx::uncheckedCast(c.adapter->createProxy(p->id()));
return d;
@@ -166,7 +166,7 @@ FilesystemI::DirectoryI::find(const string& name, const Current& c)
// Slice Directory::createFile() operation.
FilePrx
-FilesystemI::DirectoryI::createFile(const string& name, const Current& c)
+FilesystemI::DirectoryI::createFile(const string& nm, const Current& c)
{
IceUtil::Mutex::Lock lock(_m);
@@ -175,21 +175,21 @@ FilesystemI::DirectoryI::createFile(const string& name, const Current& c)
throw ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation);
}
- if(name.empty() || _contents.find(name) != _contents.end())
+ if(nm.empty() || _contents.find(nm) != _contents.end())
{
- throw NameInUse(name);
+ throw NameInUse(nm);
}
- FileIPtr f = new FileI(name, this);
+ FileIPtr f = new FileI(nm, this);
ObjectPrx node = c.adapter->add(f, f->id());
- _contents[name] = f;
+ _contents[nm] = f;
return FilePrx::uncheckedCast(node);
}
// Slice Directory::createDirectory() operation.
DirectoryPrx
-FilesystemI::DirectoryI::createDirectory(const string& name, const Current& c)
+FilesystemI::DirectoryI::createDirectory(const string& nm, const Current& c)
{
IceUtil::Mutex::Lock lock(_m);
@@ -198,14 +198,14 @@ FilesystemI::DirectoryI::createDirectory(const string& name, const Current& c)
throw ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation);
}
- if(name.empty() || _contents.find(name) != _contents.end())
+ if(nm.empty() || _contents.find(nm) != _contents.end())
{
- throw NameInUse(name);
+ throw NameInUse(nm);
}
- DirectoryIPtr d = new DirectoryI(name, this);
+ DirectoryIPtr d = new DirectoryI(nm, this);
ObjectPrx node = c.adapter->add(d, d->id());
- _contents[name] = d;
+ _contents[nm] = d;
return DirectoryPrx::uncheckedCast(node);
}
@@ -241,18 +241,18 @@ FilesystemI::DirectoryI::destroy(const Current& c)
// DirectoryI constructor.
-FilesystemI::DirectoryI::DirectoryI(const string& name, const DirectoryIPtr& parent)
- : NodeI(name, parent)
+FilesystemI::DirectoryI::DirectoryI(const string& nm, const DirectoryIPtr& parent)
+ : NodeI(nm, parent)
{
}
// Remove the entry from the _contents map.
void
-FilesystemI::DirectoryI::removeEntry(const string& name)
+FilesystemI::DirectoryI::removeEntry(const string& nm)
{
IceUtil::Mutex::Lock lock(_m);
- Contents::iterator i = _contents.find(name);
+ Contents::iterator i = _contents.find(nm);
if(i != _contents.end())
{
_contents.erase(i);
diff --git a/cpp/demo/Manual/lifecycle/Grammar.cpp b/cpp/demo/Manual/lifecycle/Grammar.cpp
index b65090aaa38..3fed0da3e14 100644
--- a/cpp/demo/Manual/lifecycle/Grammar.cpp
+++ b/cpp/demo/Manual/lifecycle/Grammar.cpp
@@ -1,24 +1,23 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* 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
+
+ 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 2, or (at your option)
- any later version.
-
+ the Free Software Foundation, either version 3 of the License, 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +28,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. */
@@ -47,7 +46,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.4.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -55,49 +54,20 @@
/* Pure parsers. */
#define YYPURE 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-
+/* Push parsers. */
+#define YYPUSH 0
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- TOK_HELP = 258,
- TOK_EXIT = 259,
- TOK_STRING = 260,
- TOK_LIST = 261,
- TOK_LIST_RECURSIVE = 262,
- TOK_CREATE_FILE = 263,
- TOK_CREATE_DIR = 264,
- TOK_PWD = 265,
- TOK_CD = 266,
- TOK_CAT = 267,
- TOK_WRITE = 268,
- TOK_RM = 269
- };
-#endif
-/* Tokens. */
-#define TOK_HELP 258
-#define TOK_EXIT 259
-#define TOK_STRING 260
-#define TOK_LIST 261
-#define TOK_LIST_RECURSIVE 262
-#define TOK_CREATE_FILE 263
-#define TOK_CREATE_DIR 264
-#define TOK_PWD 265
-#define TOK_CD 266
-#define TOK_CAT 267
-#define TOK_WRITE 268
-#define TOK_RM 269
+/* Pull parsers. */
+#define YYPULL 1
+/* Using locations. */
+#define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
+
+/* Line 189 of yacc.c */
#line 1 "Grammar.y"
@@ -110,6 +80,7 @@
//
// **********************************************************************
+#include <IceUtil/PushDisableWarnings.h>
#include <Parser.h>
#ifdef _MSC_VER
@@ -136,6 +107,9 @@ yyerror(const char* s)
+/* Line 189 of yacc.c */
+#line 112 "Grammar.tab.c"
+
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
@@ -154,20 +128,43 @@ yyerror(const char* s)
# define YYTOKEN_TABLE 0
#endif
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ TOK_HELP = 258,
+ TOK_EXIT = 259,
+ TOK_STRING = 260,
+ TOK_LIST = 261,
+ TOK_LIST_RECURSIVE = 262,
+ TOK_CREATE_FILE = 263,
+ TOK_CREATE_DIR = 264,
+ TOK_PWD = 265,
+ TOK_CD = 266,
+ TOK_CAT = 267,
+ TOK_WRITE = 268,
+ TOK_RM = 269
+ };
+#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
-
/* Copy the second part of user declarations. */
-/* Line 216 of yacc.c. */
-#line 171 "Grammar.tab.c"
+/* Line 264 of yacc.c */
+#line 168 "Grammar.tab.c"
#ifdef short
# undef short
@@ -242,14 +239,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int i)
+YYID (int yyi)
#else
static int
-YYID (i)
- int i;
+YYID (yyi)
+ int yyi;
#endif
{
- return i;
+ return yyi;
}
#endif
@@ -330,9 +327,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -366,12 +363,12 @@ union yyalloc
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) \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
@@ -456,9 +453,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 58, 58, 62, 69, 72, 80, 84, 88, 92,
- 96, 100, 104, 108, 112, 116, 120, 124, 128, 133,
- 141, 146
+ 0, 59, 59, 63, 70, 73, 81, 85, 89, 93,
+ 97, 101, 105, 109, 113, 117, 121, 125, 129, 134,
+ 142, 147
};
#endif
@@ -746,17 +743,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+ yytype_int16 *yybottom;
+ yytype_int16 *yytop;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
@@ -790,11 +790,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- fprintf (stderr, " $%d = ", yyi + 1);
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, "\n");
}
}
@@ -1074,10 +1074,8 @@ yydestruct (yymsg, yytype, yyvaluep)
break;
}
}
-
/* Prevent warnings from -Wmissing-prototypes. */
-
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1096,10 +1094,9 @@ int yyparse ();
-
-/*----------.
-| yyparse. |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1123,74 +1120,75 @@ yyparse ()
#endif
#endif
{
- /* The look-ahead symbol. */
+/* The lookahead symbol. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
+/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
-/* Number of syntax errors so far. */
-int yynerrs;
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- 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.
+ /* Number of syntax errors so far. */
+ int yynerrs;
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
+ /* The stacks and their tools:
+ `yyss': related to states.
+ `yyvs': related to semantic values.
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ Refer to the stacks thru 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;
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
+ YYSIZE_T yystacksize;
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken;
/* 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];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
+ yytoken = 0;
+ yyss = yyssa;
+ 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;
@@ -1220,7 +1218,6 @@ int yynerrs;
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
@@ -1228,7 +1225,6 @@ int yynerrs;
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
-
&yystacksize);
yyss = yyss1;
@@ -1251,9 +1247,8 @@ int yynerrs;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1264,7 +1259,6 @@ int yynerrs;
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1274,6 +1268,9 @@ int yynerrs;
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
goto yybackup;
/*-----------.
@@ -1282,16 +1279,16 @@ int yynerrs;
yybackup:
/* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ lookahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to look-ahead token. */
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1323,20 +1320,16 @@ yybackup:
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the look-ahead token. */
+ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1376,115 +1369,149 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 59 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 60 "Grammar.y"
{
;}
break;
case 3:
-#line 62 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 63 "Grammar.y"
{
;}
break;
case 4:
-#line 70 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 71 "Grammar.y"
{
;}
break;
case 5:
-#line 73 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 74 "Grammar.y"
{
;}
break;
case 6:
-#line 81 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 82 "Grammar.y"
{
parser->usage();
;}
break;
case 7:
-#line 85 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 86 "Grammar.y"
{
return 0;
;}
break;
case 8:
-#line 89 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 90 "Grammar.y"
{
parser->list(false);
;}
break;
case 9:
-#line 93 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 94 "Grammar.y"
{
parser->list(true);
;}
break;
case 10:
-#line 97 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 98 "Grammar.y"
{
parser->createFile((yyvsp[(2) - (2)]));
;}
break;
case 11:
-#line 101 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 102 "Grammar.y"
{
parser->createDir((yyvsp[(2) - (2)]));
;}
break;
case 12:
-#line 105 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 106 "Grammar.y"
{
parser->pwd();
;}
break;
case 13:
-#line 109 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 110 "Grammar.y"
{
parser->cd("/");
;}
break;
case 14:
-#line 113 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 114 "Grammar.y"
{
parser->cd((yyvsp[(2) - (2)]).front());
;}
break;
case 15:
-#line 117 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 118 "Grammar.y"
{
parser->cat((yyvsp[(2) - (2)]).front());
;}
break;
case 16:
-#line 121 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 122 "Grammar.y"
{
parser->write((yyvsp[(2) - (2)]));
;}
break;
case 17:
-#line 125 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 126 "Grammar.y"
{
parser->destroy((yyvsp[(2) - (2)]));
;}
break;
case 18:
-#line 129 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 130 "Grammar.y"
{
parser->usage();
yyerrok;
@@ -1492,13 +1519,17 @@ yyreduce:
break;
case 19:
-#line 134 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 135 "Grammar.y"
{
;}
break;
case 20:
-#line 142 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 143 "Grammar.y"
{
(yyval) = (yyvsp[(2) - (2)]);
(yyval).push_front((yyvsp[(1) - (2)]).front());
@@ -1506,15 +1537,18 @@ yyreduce:
break;
case 21:
-#line 147 "Grammar.y"
+
+/* Line 1455 of yacc.c */
+#line 148 "Grammar.y"
{
(yyval) = (yyvsp[(1) - (1)]);
;}
break;
-/* Line 1267 of yacc.c. */
-#line 1518 "Grammar.tab.c"
+
+/* Line 1455 of yacc.c */
+#line 1552 "Grammar.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1525,7 +1559,6 @@ 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. */
@@ -1590,7 +1623,7 @@ yyerrlab:
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
+ /* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -1607,7 +1640,7 @@ yyerrlab:
}
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -1664,9 +1697,6 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
*++yyvsp = yylval;
@@ -1691,7 +1721,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -1702,7 +1732,7 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
+ if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
@@ -1728,6 +1758,10 @@ yyreturn:
}
-#line 152 "Grammar.y"
+/* Line 1675 of yacc.c */
+#line 153 "Grammar.y"
+
+
+#include <IceUtil/PushDisableWarnings.h>
diff --git a/cpp/demo/Manual/lifecycle/Grammar.h b/cpp/demo/Manual/lifecycle/Grammar.h
index b5b8e41ade4..ca5a99150f6 100644
--- a/cpp/demo/Manual/lifecycle/Grammar.h
+++ b/cpp/demo/Manual/lifecycle/Grammar.h
@@ -1,24 +1,23 @@
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* 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
+
+ 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 2, or (at your option)
- any later version.
-
+ the Free Software Foundation, either version 3 of the License, 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -29,10 +28,11 @@
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. */
+
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -53,29 +53,16 @@
TOK_RM = 269
};
#endif
-/* Tokens. */
-#define TOK_HELP 258
-#define TOK_EXIT 259
-#define TOK_STRING 260
-#define TOK_LIST 261
-#define TOK_LIST_RECURSIVE 262
-#define TOK_CREATE_FILE 263
-#define TOK_CREATE_DIR 264
-#define TOK_PWD 265
-#define TOK_CD 266
-#define TOK_CAT 267
-#define TOK_WRITE 268
-#define TOK_RM 269
-
#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
+
diff --git a/cpp/demo/Manual/lifecycle/Grammar.y b/cpp/demo/Manual/lifecycle/Grammar.y
index 7c3cb792f11..9e17eb2a8e7 100644
--- a/cpp/demo/Manual/lifecycle/Grammar.y
+++ b/cpp/demo/Manual/lifecycle/Grammar.y
@@ -9,6 +9,7 @@
//
// **********************************************************************
+#include <IceUtil/PushDisableWarnings.h>
#include <Parser.h>
#ifdef _MSC_VER
@@ -150,3 +151,5 @@ strings
;
%%
+
+#include <IceUtil/PushDisableWarnings.h>
diff --git a/cpp/demo/Manual/lifecycle/Makefile b/cpp/demo/Manual/lifecycle/Makefile
index 543c669ca80..cd2a03bfabc 100644
--- a/cpp/demo/Manual/lifecycle/Makefile
+++ b/cpp/demo/Manual/lifecycle/Makefile
@@ -9,6 +9,10 @@
top_srcdir = ../../..
+ifeq ($(shell test -f $(top_srcdir)/../.gitignore && echo 0),0)
+MAXWARN = yes
+endif
+
CLIENT = client
SERVER = server
diff --git a/cpp/demo/Manual/lifecycle/Makefile.mak b/cpp/demo/Manual/lifecycle/Makefile.mak
index 073d7540dfd..a7ca4d97001 100644
--- a/cpp/demo/Manual/lifecycle/Makefile.mak
+++ b/cpp/demo/Manual/lifecycle/Makefile.mak
@@ -9,6 +9,10 @@
top_srcdir = ..\..\..
+!if exist ($(top_srcdir)\..\.gitignore)
+MAXWARN = yes
+!endif
+
CLIENT = client.exe
SERVER = server.exe
diff --git a/cpp/demo/Manual/lifecycle/Scanner.cpp b/cpp/demo/Manual/lifecycle/Scanner.cpp
index dd7b3732602..044f0be4e15 100644
--- a/cpp/demo/Manual/lifecycle/Scanner.cpp
+++ b/cpp/demo/Manual/lifecycle/Scanner.cpp
@@ -497,6 +497,7 @@ char *yytext;
//
// **********************************************************************
+#include <IceUtil/PushDisableWarnings.h>
#include <Parser.h>
#include <Grammar.h>
@@ -541,7 +542,7 @@ using namespace std;
#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize)
-#line 544 "lex.yy.c"
+#line 545 "lex.yy.c"
#define INITIAL 0
@@ -723,10 +724,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 64 "Scanner.l"
+#line 65 "Scanner.l"
-#line 729 "lex.yy.c"
+#line 730 "lex.yy.c"
if ( !(yy_init) )
{
@@ -811,7 +812,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 66 "Scanner.l"
+#line 67 "Scanner.l"
{
// C++-style comment
int c;
@@ -824,7 +825,7 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 76 "Scanner.l"
+#line 77 "Scanner.l"
{
// C-style comment
while(true)
@@ -852,77 +853,77 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 101 "Scanner.l"
+#line 102 "Scanner.l"
{
return TOK_HELP;
}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 105 "Scanner.l"
+#line 106 "Scanner.l"
{
return TOK_EXIT;
}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 109 "Scanner.l"
+#line 110 "Scanner.l"
{
return TOK_LIST;
}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 113 "Scanner.l"
+#line 114 "Scanner.l"
{
return TOK_LIST_RECURSIVE;
}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 117 "Scanner.l"
+#line 118 "Scanner.l"
{
return TOK_CREATE_FILE;
}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 121 "Scanner.l"
+#line 122 "Scanner.l"
{
return TOK_CREATE_DIR;
}
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 125 "Scanner.l"
+#line 126 "Scanner.l"
{
return TOK_PWD;
}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 129 "Scanner.l"
+#line 130 "Scanner.l"
{
return TOK_CD;
}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 133 "Scanner.l"
+#line 134 "Scanner.l"
{
return TOK_CAT;
}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 137 "Scanner.l"
+#line 138 "Scanner.l"
{
return TOK_WRITE;
}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 141 "Scanner.l"
+#line 142 "Scanner.l"
{
return TOK_RM;
}
@@ -930,7 +931,7 @@ YY_RULE_SETUP
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
-#line 145 "Scanner.l"
+#line 146 "Scanner.l"
{
size_t len = strlen(yytext);
for(size_t i = 0; i < len; ++i)
@@ -945,14 +946,14 @@ YY_RULE_SETUP
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
-#line 156 "Scanner.l"
+#line 157 "Scanner.l"
{
return ';';
}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 160 "Scanner.l"
+#line 161 "Scanner.l"
{
// "..."-type strings
string s;
@@ -1029,7 +1030,7 @@ YY_RULE_SETUP
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 234 "Scanner.l"
+#line 235 "Scanner.l"
{
// '...'-type strings
string s;
@@ -1057,7 +1058,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 259 "Scanner.l"
+#line 260 "Scanner.l"
{
// Simple strings
string s;
@@ -1084,10 +1085,10 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 283 "Scanner.l"
+#line 284 "Scanner.l"
ECHO;
YY_BREAK
-#line 1090 "lex.yy.c"
+#line 1091 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -2081,7 +2082,9 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 283 "Scanner.l"
+#line 284 "Scanner.l"
+#include <IceUtil/PopDisableWarnings.h>
+
diff --git a/cpp/demo/Manual/lifecycle/Scanner.l b/cpp/demo/Manual/lifecycle/Scanner.l
index c2e42f0eb65..b2292cfbe3c 100644
--- a/cpp/demo/Manual/lifecycle/Scanner.l
+++ b/cpp/demo/Manual/lifecycle/Scanner.l
@@ -9,6 +9,7 @@
//
// **********************************************************************
+#include <IceUtil/PushDisableWarnings.h>
#include <Parser.h>
#include <Grammar.h>
@@ -281,3 +282,5 @@ NL [\n]
}
%%
+
+#include <IceUtil/PopDisableWarnings.h>