diff options
author | Michi Henning <michi@zeroc.com> | 2002-07-03 07:10:52 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2002-07-03 07:10:52 +0000 |
commit | 37c4f8540cace7cbe8b2f8beed1c4b212a6aee7a (patch) | |
tree | 9541623911af6c81c787fabfe1e6a624d085b290 /cpp/src/slice2cpp | |
parent | fixes (diff) | |
download | ice-37c4f8540cace7cbe8b2f8beed1c4b212a6aee7a.tar.bz2 ice-37c4f8540cace7cbe8b2f8beed1c4b212a6aee7a.tar.xz ice-37c4f8540cace7cbe8b2f8beed1c4b212a6aee7a.zip |
More work on constant definitions. For C++, code is generated now (not
quite correct yet for enums and long long). The other code generators
(java, xsl, etc.) ignore constants for now. Semantic checks are in
place, apart from enums.
Still more work to do -- this is just an intermediate check-in. (About to
test this on Windows too...)
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 7 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 5309d054b4c..8c133248975 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -929,6 +929,13 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) } void +Slice::Gen::TypesVisitor::visitConstDef(const ConstDefPtr& p) +{ + H << sp; + H << nl << "const " << inputTypeToString(p->type()) << " " << p->name() << " = " << p->value() << ";"; +} + +void Slice::Gen::TypesVisitor::emitExceptionBase(const ExceptionPtr& base, const std::string& call) { if(base) diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index 71ca45f81cc..fe9c67cd27b 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -64,6 +64,7 @@ private: virtual void visitSequence(const SequencePtr&); virtual void visitDictionary(const DictionaryPtr&); virtual void visitEnum(const EnumPtr&); + virtual void visitConstDef(const ConstDefPtr&); virtual void visitDataMember(const DataMemberPtr&); private: |