summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePack/Parser.h')
-rw-r--r--cpp/src/IcePack/Parser.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/cpp/src/IcePack/Parser.h b/cpp/src/IcePack/Parser.h
index 42282a010c2..d957978dd1b 100644
--- a/cpp/src/IcePack/Parser.h
+++ b/cpp/src/IcePack/Parser.h
@@ -14,12 +14,24 @@
#include <IcePack/Admin.h>
#include <list>
-#define YYSTYPE std::list<std::string>
-
-extern int yynerrs;
+//
+// Stuff for flex and bison
+//
+#define YYSTYPE std::list<std::string>
+#define YY_DECL int yylex(YYSTYPE* yylvalp)
+YY_DECL;
int yyparse();
-int yylex();
+
+//
+// I must set the initial stack depth to the maximum stack depth to
+// disable bison stack resizing. The bison stack resizing routines use
+// simple malloc/alloc/memcpy calls, which do not work for the
+// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
+// assignment operator, etc.
+//
+#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
+#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
namespace IcePack
{
@@ -57,6 +69,7 @@ public:
void getAll();
void shutdown();
+ void getInput(char*, int, int);
void nextLine();
void continueLine();
char* getPrompt();
@@ -75,9 +88,11 @@ private:
Parser(const Ice::CommunicatorPtr&, const IcePack::AdminPrx&);
+ const char* _commands;
Ice::CommunicatorPtr _communicator;
IcePack::AdminPrx _admin;
bool _continue;
+ int _errors;
int _currentLine;
std::string _currentFile;
};