Cadabra
Computer algebra system for field theory problems
CdbPython.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <string>
5 
6 namespace cadabra {
7 
8  std::string escape_quotes(const std::string&);
9 
16 
17  std::string cdb2python(const std::string&, bool display);
18 
19  std::string cdb2python_string(const std::string&, bool display);
20 
27 
28  int is_python_code_complete(const std::string&, std::string& error);
29 
34  class ConvertData {
35  public:
36  ConvertData();
37  ConvertData(const std::string&, const std::string&, const std::string&, const std::string&);
38 
39  std::string lhs, rhs, op, indent;
40  };
41 
56 
57  std::pair<std::string, std::string> convert_line(const std::string&, ConvertData& cv, bool display); //std::string& lhs, std::string& rhs, std::string& op, std::string& indent, bool display);
58 
67 
68  #ifndef CDBPYTHON_NO_NOTEBOOK
69 
70  std::string cnb2python(const std::string&, bool for_standalone);
71 
72  #endif
73  }
Object to store pre-parsing intermediate results.
Definition: CdbPython.hh:34
std::string op
Definition: CdbPython.hh:39
std::string lhs
Definition: CdbPython.hh:39
std::string indent
Definition: CdbPython.hh:39
ConvertData()
Definition: CdbPython.cc:187
std::string rhs
Definition: CdbPython.hh:39
std::string cnb2python(const std::string &, bool for_standalone)
Convert a Cadabra notebook file to pure Python.
Definition: CdbPython.cc:350
std::string cdb2python(const std::string &, bool display)
Convert a block of Cadabra notation into pure Python.
Definition: CdbPython.cc:25
std::pair< std::string, std::string > convert_line(const std::string &, ConvertData &cv, bool display)
Detect Cadabra expression statements and rewrite to Python form.
Definition: CdbPython.cc:197
def display(obj, delay_send=False)
Generic display function which handles local as well as remote clients.
Definition: cadabra2_defaults.py:211
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
std::string cdb2python_string(const std::string &, bool display)
Definition: CdbPython.cc:59
int is_python_code_complete(const std::string &, std::string &error)
Test whether a block of Python code is complete or requires more input lines.
Definition: CdbPython.cc:138
std::string escape_quotes(const std::string &)
Definition: CdbPython.cc:17
const char error[]
Definition: Snoop.hh:365