@@ -115,27 +115,60 @@ class languaget:public messaget
115
115
116
116
// conversion of expressions
117
117
118
+ // / Formats the given expression in a language-specific way
119
+ // / \param expr: the expression to format
120
+ // / \param code: the formatted expression
121
+ // / \param ns: a namespace
122
+ // / \return false if conversion succeeds
118
123
virtual bool from_expr (
119
124
const exprt &expr,
120
125
std::string &code,
121
126
const namespacet &ns);
122
127
128
+ // / Formats the given type in a language-specific way
129
+ // / \param type: the type to format
130
+ // / \param code: the formatted type
131
+ // / \param ns: a namespace
132
+ // / \return false if conversion succeeds
123
133
virtual bool from_type (
124
134
const typet &type,
125
135
std::string &code,
126
136
const namespacet &ns);
127
137
138
+ // / Formats the given expression as a JSON object in a language-specific way
139
+ // / \param expr: the expression to format
140
+ // / \param ns: a namespace
141
+ // / \return the JSON object
128
142
virtual json_objectt json (const exprt &, const namespacet &);
129
143
144
+ // / Formats the given type as a JSON object in a language-specific way
145
+ // / \param type: the type to format
146
+ // / \param ns: a namespace
147
+ // / \return the JSON object
130
148
virtual json_objectt json (const typet &, const namespacet &);
131
149
150
+ // / Formats the given source location as a JSON object
151
+ // / in a language-specific way
152
+ // / \param source_location: the source location to format
153
+ // / \return the JSON object
132
154
virtual json_objectt json (const source_locationt &);
133
155
156
+ // / Encodes the given type in a language-specific way
157
+ // / \param type: the type to encode
158
+ // / \param name: the encoded type
159
+ // / \param ns: a namespace
160
+ // / \return false if the conversion succeeds
134
161
virtual bool type_to_name (
135
162
const typet &type,
136
163
std::string &name,
137
164
const namespacet &ns);
138
165
166
+ // / Parses the given string into an expression
167
+ // / \param code: the string to parse
168
+ // / \param module: prefix to be used for identifiers
169
+ // / \param expr: the parsed expression
170
+ // / \param ns: a namespace
171
+ // / \return false if the conversion succeeds
139
172
virtual bool to_expr (
140
173
const std::string &code,
141
174
const std::string &module,
0 commit comments