hqlwcpp.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef HQLWCPP_HPP
  14. #define HQLWCPP_HPP
  15. #ifdef HQLCPP_EXPORTS
  16. #define HQLCPP_API DECL_EXPORT
  17. #else
  18. #define HQLCPP_API DECL_IMPORT
  19. #endif
  20. interface IHqlCppInstance;
  21. interface HQLCPP_API ISectionWriter : public IInterface
  22. {
  23. public:
  24. virtual void generateSection(unsigned indent, IAtom * section, unsigned pass) = 0;
  25. virtual void noteLines(size32_t count) = 0;
  26. virtual void setOutput(IFile * out, IIOStream * outStream) = 0;
  27. };
  28. interface HQLCPP_API ITemplateExpander : public IInterface
  29. {
  30. public:
  31. virtual void generate(ISectionWriter & writer, unsigned pass, IProperties * properties = NULL) = 0;
  32. };
  33. extern HQLCPP_API StringBuffer & generateExprCpp(StringBuffer & out, IHqlExpression * expr, CompilerType compiler);
  34. extern HQLCPP_API StringBuffer & generateTypeCpp(StringBuffer & out, ITypeInfo * type, const char * name, CompilerType compiler);
  35. bool generateFunctionPrototype(StringBuffer & out, IHqlExpression * funcdef, CompilerType compiler);
  36. void generateFunctionReturnType(StringBuffer & prefix, StringBuffer & params, ITypeInfo * retType, IHqlExpression * attrs, CompilerType compiler);
  37. extern HQLCPP_API ITemplateExpander * createTemplateExpander(IFile * output, const char * filename, const char *dir);
  38. extern HQLCPP_API ISectionWriter * createCppWriter(IHqlCppInstance & _instance, CompilerType compiler);
  39. extern bool isTypePassedByAddress(ITypeInfo * type);
  40. #endif