summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/all.dsw82
-rw-r--r--cpp/src/IcePack/Grammer.y14
-rw-r--r--cpp/src/IcePack/Parser.cpp18
-rw-r--r--cpp/src/IcePack/Scanner.l18
-rw-r--r--cpp/src/IcePack/dummyinclude/unistd.h4
-rw-r--r--cpp/src/IcePack/icepackC.dsp96
-rw-r--r--cpp/src/IcePack/icepackS.dsp4
-rw-r--r--cpp/src/Slice/slice.dsp2
-rwxr-xr-xcpp/test/IcePack/simple/run.py2
9 files changed, 187 insertions, 53 deletions
diff --git a/cpp/all.dsw b/cpp/all.dsw
index 541c1fd02f6..197ecd38710 100644
--- a/cpp/all.dsw
+++ b/cpp/all.dsw
@@ -69,6 +69,18 @@ Package=<4>
###############################################################################
+Project: "Slice"=.\src\Slice\Slice.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "all"=.\all.dsp - Package Owner=<4>
Package=<5>
@@ -185,35 +197,11 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name simpleS
End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "slice2cpp"=.\src\slice2cpp\slice2cpp.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
Begin Project Dependency
- Project_Dep_Name Slice
+ Project_Dep_Name asyncFHTC
End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "slice2docbook"=.\src\slice2docbook\slice2docbook.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
Begin Project Dependency
- Project_Dep_Name Slice
+ Project_Dep_Name asyncFHTS
End Project Dependency
}}}
@@ -486,18 +474,6 @@ Package=<4>
###############################################################################
-Project: "Slice"=.\src\Slice\Slice.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
Project: "pickleR"=.\demo\Ice\pickle\pickleR.dsp - Package Owner=<4>
Package=<5>
@@ -606,6 +582,36 @@ Package=<4>
###############################################################################
+Project: "slice2cpp"=.\src\slice2cpp\slice2cpp.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name Slice
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "slice2docbook"=.\src\slice2docbook\slice2docbook.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name Slice
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "valueC"=.\demo\Ice\value\valueC.dsp - Package Owner=<4>
Package=<5>
diff --git a/cpp/src/IcePack/Grammer.y b/cpp/src/IcePack/Grammer.y
index 782754764af..24dc8a9b0e8 100644
--- a/cpp/src/IcePack/Grammer.y
+++ b/cpp/src/IcePack/Grammer.y
@@ -25,6 +25,7 @@ yyerror(const char* s)
%}
+%token ICE_PACK_EXIT
%token ICE_PACK_ADD
%token ICE_PACK_REMOVE
%token ICE_PACK_SHUTDOWN
@@ -38,6 +39,10 @@ start
: commands
{
}
+|
+{
+}
+;
// ----------------------------------------------------------------------
commands
@@ -48,15 +53,16 @@ commands
| command
{
}
-|
-{
-}
;
// ----------------------------------------------------------------------
command
// ----------------------------------------------------------------------
-: ICE_PACK_ADD references ';'
+: ICE_PACK_EXIT ';'
+{
+ return 0;
+}
+| ICE_PACK_ADD references ';'
{
parser->add($2);
}
diff --git a/cpp/src/IcePack/Parser.cpp b/cpp/src/IcePack/Parser.cpp
index 58fbbeb4734..55f1c56f612 100644
--- a/cpp/src/IcePack/Parser.cpp
+++ b/cpp/src/IcePack/Parser.cpp
@@ -11,6 +11,12 @@
#include <Ice/Ice.h>
#include <IcePack/Parser.h>
+#ifdef WIN32
+# include <io.h>
+# define isatty _isatty
+# define fileno _fileno
+#endif
+
using namespace std;
using namespace Ice;
using namespace IcePack;
@@ -101,6 +107,8 @@ IcePack::Parser::continueLine()
char*
IcePack::Parser::getPrompt()
{
+ assert(!yycommands && isatty(fileno(yyin)));
+
if (_continue)
{
_continue = false;
@@ -198,13 +206,14 @@ IcePack::Parser::parse(FILE* file, bool debug)
assert(!parser);
parser = this;
+ yyin = file;
+ yycommands = 0;
+
_currentFile = "<standard input>";
_currentLine = 0;
_continue = false;
nextLine();
- yyin = file;
- yycommands = 0;
int status = yyparse();
parser = 0;
@@ -220,13 +229,14 @@ IcePack::Parser::parse(const std::string& commands, bool debug)
assert(!parser);
parser = this;
+ yyin = 0;
+ yycommands = commands.c_str();
+
_currentFile = "<command line>";
_currentLine = 0;
_continue = false;
nextLine();
- yyin = 0;
- yycommands = commands.c_str();
int status = yyparse();
parser = 0;
diff --git a/cpp/src/IcePack/Scanner.l b/cpp/src/IcePack/Scanner.l
index 62be428235a..3064f49ae83 100644
--- a/cpp/src/IcePack/Scanner.l
+++ b/cpp/src/IcePack/Scanner.l
@@ -14,6 +14,14 @@
#include <IcePack/Parser.h>
#include <IcePack/Grammer.h>
+#ifdef WIN32
+# include <io.h>
+# define isatty _isatty
+# define fileno _fileno
+// '_isatty' : inconsistent dll linkage. dllexport assumed.
+# pragma warning( disable : 4273 )
+#endif
+
using namespace std;
using namespace Ice;
using namespace IcePack;
@@ -111,6 +119,10 @@ if (yycommands) \
} \
else if (yy_current_buffer->yy_is_interactive) \
{ \
+ if (isatty(fileno(yyin))) \
+ { \
+ cout << parser->getPrompt() << flush; \
+ } \
int c = '*', n; \
for (n = 0; n < maxSize && (c = getc(yyin)) != EOF && c != '\n'; ++n ) \
{ \
@@ -208,6 +220,10 @@ L [a-zA-Z_]
}
}
+"quit"|"exit" {
+ return ICE_PACK_EXIT;
+}
+
"add" {
return ICE_PACK_ADD;
}
@@ -220,7 +236,7 @@ L [a-zA-Z_]
return ICE_PACK_SHUTDOWN;
}
-\"[^\"\n]+(:[^\"\n]+)+\" {
+\[[^\[\]{NL}]+(:[^\[\]{NL}]+)+\] {
yylval.empty();
yylval.push_back(yytext);
return ICE_PACK_REFERENCE;
diff --git a/cpp/src/IcePack/dummyinclude/unistd.h b/cpp/src/IcePack/dummyinclude/unistd.h
new file mode 100644
index 00000000000..92d53d10b9b
--- /dev/null
+++ b/cpp/src/IcePack/dummyinclude/unistd.h
@@ -0,0 +1,4 @@
+//
+// Files generated by flex need unistd.h, which is not available on
+// Windows. Thus this dummy file.
+//
diff --git a/cpp/src/IcePack/icepackC.dsp b/cpp/src/IcePack/icepackC.dsp
index 45497d1a593..e201841da40 100644
--- a/cpp/src/IcePack/icepackC.dsp
+++ b/cpp/src/IcePack/icepackC.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "." /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".." /I "../../include" /I "dummyinclude" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "." /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I ".." /I "../../include" /I "dummyinclude" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -89,14 +89,106 @@ LINK32=link.exe
SOURCE=.\Client.cpp
# End Source File
+# Begin Source File
+
+SOURCE=.\Grammer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Parser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Scanner.cpp
+# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\Grammer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Parser.h
+# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\Grammer.y
+
+!IF "$(CFG)" == "IcePackC - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\Grammer.y
+
+BuildCmds= \
+ bison -dvt Grammer.y \
+ move Grammer.tab.c Grammer.cpp \
+ move Grammer.tab.h Grammer.h \
+
+
+"Grammer.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Grammer.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "IcePackC - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\Grammer.y
+
+BuildCmds= \
+ bison -dvt Grammer.y \
+ move Grammer.tab.c Grammer.cpp \
+ move Grammer.tab.h Grammer.h \
+
+
+"Grammer.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Grammer.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\Scanner.l
+
+!IF "$(CFG)" == "IcePackC - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\Scanner.l
+
+"Scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ flex Scanner.l
+ move lex.yy.c Scanner.cpp
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "IcePackC - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\Scanner.l
+
+"Scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ flex Scanner.l
+ move lex.yy.c Scanner.cpp
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
# End Group
# End Target
# End Project
diff --git a/cpp/src/IcePack/icepackS.dsp b/cpp/src/IcePack/icepackS.dsp
index 53b8ae7ca99..1c542e6474b 100644
--- a/cpp/src/IcePack/icepackS.dsp
+++ b/cpp/src/IcePack/icepackS.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "." /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".." /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "." /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I ".." /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/cpp/src/Slice/slice.dsp b/cpp/src/Slice/slice.dsp
index 6b51cac1c3e..fbc63c2948c 100644
--- a/cpp/src/Slice/slice.dsp
+++ b/cpp/src/Slice/slice.dsp
@@ -148,7 +148,6 @@ SOURCE=..\..\include\Slice\Parser.h
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
# Begin Source File
SOURCE=.\Grammer.y
@@ -221,5 +220,6 @@ InputPath=.\Scanner.l
!ENDIF
# End Source File
+# End Group
# End Target
# End Project
diff --git a/cpp/test/IcePack/simple/run.py b/cpp/test/IcePack/simple/run.py
index 2772753b7ab..b38976ce044 100755
--- a/cpp/test/IcePack/simple/run.py
+++ b/cpp/test/IcePack/simple/run.py
@@ -37,7 +37,7 @@ print "ok"
print "registering server with icepack...",
icePackAdminPipe = os.popen(icePackAdmin + \
r' "--Ice.Adapter.Admin.Endpoints=tcp -p 12347 -t 2000"' + \
- r' -e "add \"test:tcp -p 12345 -t 2000\""')
+ r' -e "add [test:tcp -p 12345 -t 2000]"')
icePackAdminPipe.close()
print "ok"