#include "basic.hpp"
#include "analyze.hpp"
#include "string.hpp"
Go to the source code of this file.
◆ hash()
Computes a hash value for a pointer.
- Parameters
-
- Returns
- The hash value.
Definition at line 17 of file basic.cpp.
17 {
18 return ((
int) ((intptr_t)
ptr)) + (((int) ((intptr_t)
ptr)) % 19);
19}
The list class represents a linked list.
◆ tm_throw()
Function used to throw an exception with a specified error message.
- Parameters
-
msg | The error message to throw with the exception. |
Definition at line 27 of file basic.cpp.
27 {
29
31 cout <<
"-------------------------------------------------\n";
33 cout <<
"-------------------------------------------------\n";
35}
string the_exception
Global variable used to store the current exception message.
◆ handle_exceptions()
void handle_exceptions |
( |
| ) |
|
Function used to handle exceptions by displaying and clearing the exception message.
- Note
- if catching an exception throwed by tm_throw, this function must be appended after catch(){...} block.
Definition at line 38 of file basic.cpp.
38 {
40
41
44 }
45}
int N(array< T > a)
Get the length of the array.
◆ new_type_identifier()
int new_type_identifier |
( |
| ) |
|
Generates a new type identifier.
- Returns
- The new type identifier.
Definition at line 53 of file basic.cpp.
53 {
54 static int id= 0;
55 id--;
56 return id;
57}
◆ operator<<()
Output operator for display control options.
- Parameters
-
out | The output stream to write to. |
ctrl | The display control option. |
- Returns
- The output stream.
Definition at line 61 of file basic.cpp.
62 {
63 int i;
66 out << " ";
68 break;
70 out << "\b\b";
72 break;
75 out << "-";
77 out << "\n";
79 out << " ";
80 break;
81 }
82 return out;
83}
static int current_indent
◆ the_exception
Global variable used to store the current exception message.
Definition at line 22 of file basic.cpp.
◆ the_report
◆ current_indent