codegen.h
1 #ifndef SYMENGINE_CODEGEN_H
2 #define SYMENGINE_CODEGEN_H
3 
4 #include <symengine/visitor.h>
5 #include <symengine/printers/strprinter.h>
6 #include <symengine/symengine_exception.h>
7 
8 namespace SymEngine
9 {
10 
11 class CodePrinter : public BaseVisitor<CodePrinter, StrPrinter>
12 {
13 public:
14  using StrPrinter::apply;
15  using StrPrinter::bvisit;
16  using StrPrinter::str_;
17  void bvisit(const Basic &x);
18  void bvisit(const Complex &x);
19  void bvisit(const Dummy &x);
20  void bvisit(const Interval &x);
21  void bvisit(const Contains &x);
22  void bvisit(const Piecewise &x);
23  void bvisit(const Rational &x);
24  void bvisit(const EmptySet &x);
25  void bvisit(const FiniteSet &x);
26  void bvisit(const Reals &x);
27  void bvisit(const Rationals &x);
28  void bvisit(const Integers &x);
29  void bvisit(const UniversalSet &x);
30  void bvisit(const Abs &x);
31  void bvisit(const Ceiling &x);
32  void bvisit(const Truncate &x);
33  void bvisit(const Max &x);
34  void bvisit(const Min &x);
35  void bvisit(const Constant &x);
36  void bvisit(const NaN &x);
37  void bvisit(const Equality &x);
38  void bvisit(const Unequality &x);
39  void bvisit(const LessThan &x);
40  void bvisit(const StrictLessThan &x);
41  void bvisit(const UnivariateSeries &x);
42  void bvisit(const Derivative &x);
43  void bvisit(const Subs &x);
44  void bvisit(const GaloisField &x);
45 };
46 
47 class C89CodePrinter : public BaseVisitor<C89CodePrinter, CodePrinter>
48 {
49 public:
50  using CodePrinter::apply;
51  using CodePrinter::bvisit;
52  using CodePrinter::str_;
53  void bvisit(const Infty &x);
54  void _print_pow(std::ostringstream &o, const RCP<const Basic> &a,
55  const RCP<const Basic> &b) override;
56 };
57 
58 class C99CodePrinter : public BaseVisitor<C99CodePrinter, C89CodePrinter>
59 {
60 public:
61  using C89CodePrinter::apply;
62  using C89CodePrinter::bvisit;
63  using C89CodePrinter::str_;
64  void bvisit(const Infty &x);
65  void _print_pow(std::ostringstream &o, const RCP<const Basic> &a,
66  const RCP<const Basic> &b) override;
67  void bvisit(const Gamma &x);
68  void bvisit(const LogGamma &x);
69 };
70 
71 class JSCodePrinter : public BaseVisitor<JSCodePrinter, CodePrinter>
72 {
73 public:
74  using CodePrinter::apply;
75  using CodePrinter::bvisit;
76  using CodePrinter::str_;
77  void bvisit(const Constant &x);
78  void _print_pow(std::ostringstream &o, const RCP<const Basic> &a,
79  const RCP<const Basic> &b) override;
80  void bvisit(const Abs &x);
81  void bvisit(const Sin &x);
82  void bvisit(const Cos &x);
83  void bvisit(const Max &x);
84  void bvisit(const Min &x);
85 };
86 } // namespace SymEngine
87 
88 #endif // SYMENGINE_CODEGEN_H
The lowest unit of symbolic representation.
Definition: basic.h:97
Complex Class.
Definition: complex.h:33
Rational Class.
Definition: rational.h:16
UnivariateSeries Class.
Main namespace for SymEngine package.
Definition: add.cpp:19