60 static symbol_c *get_id (symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! Does not work for elementary datatypes!*/ |
60 static symbol_c *get_id (symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! Does not work for elementary datatypes!*/ |
61 static const char *get_id_str(symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! */ |
61 static const char *get_id_str(symbol_c *datatype); /* get the identifier (name) of the datatype); returns NULL if anonymous datatype! */ |
62 |
62 |
63 static symbol_c *get_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 (returns the type that is being referenced/pointed to) |
63 static symbol_c *get_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 (returns the type that is being referenced/pointed to) |
64 |
64 |
65 /* Returns true if both datatypes are identicial. |
65 /* Returns true if both datatypes are equivalent (not necessarily equal!). |
66 * WARING: When handling REF_TO datatypes, it may return 'true' even though |
66 * WARNING: May return true even though the datatypes are not the same/identicial!!! |
67 * the datatypes are not identicial. This occurs when at least one of the |
67 * This occurs when at least one of the datatypes is of a generic |
68 * datatypes if a ref_to_any_c, which os equivalent to a (void *), and the |
68 * datatype (or a REF_TO a generic datatype). |
69 * other datatype is any REF_TO datatype (including a ref_to_any_c). |
69 * (Generic dataypes: ANY, ANY_INT, ANY_NUM, ...) |
|
70 * NOTE: Currently only the ANY generic datatype is implemented! |
|
71 * NOTE: Currently stage1_2 only allows the use of the ANY keyword when in conjuntion with |
|
72 * the REF_TO keyword (i.e. REF_TO ANY), so when handling non REF_TO datatypes, |
|
73 * this function will currently only return true if the dataypes are identicial. |
70 */ |
74 */ |
71 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
75 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
72 static bool is_type_valid(symbol_c *type); |
76 static bool is_type_valid(symbol_c *type); |
73 |
77 |
74 static bool is_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 |
78 static bool is_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 |