MicroModelicaCCompiler
4.5.3
|
Go to the documentation of this file.
32 Error::Error() : _errors(), _warnings(), _num_errors(0), _num_warnings(0), _std_def() {}
48 msg <<
"Line: " << pos <<
" Class: " <<
_class_name << endl;
49 msg <<
typeString(t) <<
"(" << hex << uppercase << code <<
")" << endl;
50 va_start(ap, message);
51 vsnprintf((
char *)local, size, message.c_str(), ap);
69 cout <<
"File: " <<
_std_def << endl;
71 map<unsigned int, string>::iterator it;
88 return "FATAL ERROR: ";
98 switch (module_code) {
100 message.append(
"Abstract Syntax Tree: ");
103 message.append(
"Intermediate Representation: ");
106 message.append(
"Code Generator: ");
109 message.append(
"Pretty Printer: ");
112 message.append(
"Error: ");
115 message.append(
"Parser: ");
118 switch (message_code) {
120 message.append(
"Variable not found.\n");
123 message.append(
"Variable not defined.\n");
126 message.append(
"Can not open file.\n");
129 message.append(
"Can not parse file.\n");
132 message.append(
"Wrong variable type.\n");
135 message.append(
"Wrong expression type.\n");
138 message.append(
"Unknown scanner type.\n");
141 message.append(
"Unknown operator type.\n");
144 message.append(
"Unknown operation.\n");
147 message.append(
"Unknown expression.\n");
150 message.append(
"Unknown type.\n");
153 message.append(
"Array initialization not implemented.\n");
156 message.append(
"Array wrong number of init values.\n");
159 message.append(
"Array of type CONSTANT not allowed.\n");
162 message.append(
"Array size expected.\n");
165 message.append(
"Can not assign initial values to algebraic variables.\n");
168 message.append(
"Algebraic variables definitions must use previously defined variables.\n");
171 message.append(
"Can not assign initial values to output variables.\n");
174 message.append(
"Can not assign a simple variable inside a for loop.\n");
177 message.append(
"Can not define a new variable inside a for loop.\n");
180 message.append(
"Can not use a function call in an index defintion.\n");
183 message.append(
"Can not use a range expression in an index defintion.\n");
186 message.append(
"Index out of range.\n");
189 message.append(
"Algebraic variable size is zero.\n");
192 message.append(
"Expecting generic event definition.\n");
195 message.append(
"Event not defined.\n");
198 message.append(
"Symbol not recognized.\n");
201 message.append(
"Symbolic derivative can not be generated (External functions?).\nTry using numerical integration.\n");
204 message.append(
"Equation not defined.\n");
207 message.append(
"No equation defined in generic definition.\n");
210 message.append(
"Unkown equation type.\n");
213 message.append(
"Event not found.\n");
216 message.append(
"Unknown error.\n");
219 message.append(
"Missing output variable definition.\n");
222 message.append(
"Missing sample period definition.\n");
225 message.append(
"Function call, wrong number of arguments.\n");
228 message.append(
"Sampled output, can not output generic expressions, only state or dicrete variables are allowed.\n");
231 message.append(
"Handler redefinition.\n");
234 message.append(
"Constant variable definition inside for loop.\n");
237 message.append(
"Definition not allowed in MicroModelica.\n");
240 message.append(
"Class definition.\n");
243 message.append(
"Annotation not found.\n");
246 message.append(
"Function definition not found.\n");
249 message.append(
"Wrong variable type.\n");
#define EM_DEFINITION_NOT_ALLOWED
#define EM_ANNOTATION_NOT_FOUND
std::map< unsigned int, std::string > _errors
void setFile(std::string s)
#define EM_VARIABLE_NOT_DEFINED
std::map< unsigned int, std::string > _warnings
#define EM_CLASS_DEFINITION
std::string printCode(int code)
void setClassName(std::string class_name)
void add(int pos, unsigned int code, ER_Type t, const std::string message,...)
#define EM_WRONG_VARIABLE_TYPE
#define EM_VARIABLE_NOT_FOUND
#define EM_CANT_OPEN_FILE
#define EM_FUNCTION_NOT_FOUND
std::string typeString(ER_Type t)
#define EM_UNKNOWN_OPERATION
#define EM_ARRAY_INIT_VAL