From eb39f9c113fb0d6810d4e4d3d67af6b7f026bec9 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Thu, 2 Sep 2004 15:47:00 +0000 Subject: adding Python translator --- cpp/include/Slice/PythonUtil.h | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 cpp/include/Slice/PythonUtil.h (limited to 'cpp/include/Slice/PythonUtil.h') diff --git a/cpp/include/Slice/PythonUtil.h b/cpp/include/Slice/PythonUtil.h new file mode 100644 index 00000000000..2235611a057 --- /dev/null +++ b/cpp/include/Slice/PythonUtil.h @@ -0,0 +1,50 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2004 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef SLICE_PYTHON_UTIL_H +#define SLICE_PYTHON_UTIL_H + +#include +#include + +namespace Slice +{ +namespace Python +{ + +// +// Generate Python code for a translation unit. +// +SLICE_API void generate(const Slice::UnitPtr&, IceUtil::Output&); + +// +// Split up a string using whitespace delimiters. +// +SLICE_API bool splitString(const std::string&, std::vector&); + +// +// Convert a scoped name into a Python name. +// +SLICE_API std::string scopedToName(const std::string&); + +// +// Check the given identifier against Python's list of reserved words. If it matches +// a reserved word, then an escaped version is returned with a leading underscore. +// +SLICE_API std::string fixIdent(const std::string&); + +// +// Emit a comment header. +// +SLICE_API void printHeader(IceUtil::Output&); + +} +} + +#endif -- cgit v1.2.3