From 997c78b8c2911a3787d9ca9b4b10e587cb8cbb2d Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Thu, 25 Jul 2002 23:09:48 +0000 Subject: Changed Slice parser to disallow leading underscore for identifiers. Changed Slice parser to reject identifiers beginning with "Ice", unless the --ice option is used. Changed Slice parser to disallow identifiers that have a trailing "Operations", "Holder", "Helper", "Prx", or "Ptr", to avoid clashes with language mappings. Fixed tests and remaining code base to work correctly with the changed rules. --- cpp/src/slice2cpp/Main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cpp/src/slice2cpp/Main.cpp') diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 5eb13c1a3a5..db69a5f8396 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -31,6 +31,7 @@ usage(const char* n) "--dll-export SYMBOL Use SYMBOL for DLL exports.\n" "--impl Generate sample implementations.\n" "-d, --debug Print debug messages.\n" + "--ice Permit `Ice' prefix (for building Ice source code only)\n" ; } @@ -44,6 +45,7 @@ main(int argc, char* argv[]) string dllExport; bool impl = false; bool debug = false; + bool ice = false; int idx = 1; while(idx < argc) @@ -95,6 +97,15 @@ main(int argc, char* argv[]) } --argc; } + else if(strcmp(argv[idx], "--ice") == 0) + { + ice = true; + for(int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + } else if(strcmp(argv[idx], "--include-dir") == 0) { if(idx + 1 >= argc) @@ -210,7 +221,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - UnitPtr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false, ice); int parseStatus = unit->parse(cppHandle, debug); #ifdef _WIN32 -- cgit v1.2.3