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. |
|
66 * WARING: When handling REF_TO datatypes, it may return 'true' even though |
|
67 * the datatypes are not identicial. This occurs when at least one of the |
|
68 * datatypes if a ref_to_any_c, which os equivalent to a (void *), and the |
|
69 * other datatype is any REF_TO datatype (including a ref_to_any_c). |
|
70 */ |
65 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
71 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
66 static bool is_type_valid(symbol_c *type); |
72 static bool is_type_valid(symbol_c *type); |
67 |
73 |
68 static bool is_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 |
74 static bool is_ref_to (symbol_c *type_symbol); // Defined in IEC 61131-3 v3 |
69 static bool is_sfc_initstep (symbol_c *type_symbol); |
75 static bool is_sfc_initstep (symbol_c *type_symbol); |
75 static bool is_structure (symbol_c *type_symbol); |
81 static bool is_structure (symbol_c *type_symbol); |
76 |
82 |
77 static bool is_ANY_REAL_literal(symbol_c *type_symbol); /* Can't we do away with this?? */ |
83 static bool is_ANY_REAL_literal(symbol_c *type_symbol); /* Can't we do away with this?? */ |
78 static bool is_ANY_INT_literal (symbol_c *type_symbol); /* Can't we do away with this?? */ |
84 static bool is_ANY_INT_literal (symbol_c *type_symbol); /* Can't we do away with this?? */ |
79 |
85 |
|
86 static bool is_ANY_generic_type (symbol_c *type_symbol); |
|
87 |
|
88 //static bool is_ANY_ELEMENTARY_generic_type (symbol_c *type_symbol); |
80 static bool is_ANY_ELEMENTARY (symbol_c *type_symbol); |
89 static bool is_ANY_ELEMENTARY (symbol_c *type_symbol); |
81 static bool is_ANY_SAFEELEMENTARY (symbol_c *type_symbol); |
90 static bool is_ANY_SAFEELEMENTARY (symbol_c *type_symbol); |
82 static bool is_ANY_ELEMENTARY_compatible (symbol_c *type_symbol); |
91 static bool is_ANY_ELEMENTARY_compatible (symbol_c *type_symbol); |
83 |
92 |
|
93 //static bool is_ANY_MAGNITUDE_generic_type (symbol_c *type_symbol); |
84 static bool is_ANY_MAGNITUDE (symbol_c *type_symbol); |
94 static bool is_ANY_MAGNITUDE (symbol_c *type_symbol); |
85 static bool is_ANY_SAFEMAGNITUDE (symbol_c *type_symbol); |
95 static bool is_ANY_SAFEMAGNITUDE (symbol_c *type_symbol); |
86 static bool is_ANY_MAGNITUDE_compatible (symbol_c *type_symbol); |
96 static bool is_ANY_MAGNITUDE_compatible (symbol_c *type_symbol); |
87 |
97 |
88 static bool is_ANY_signed_MAGNITUDE (symbol_c *type_symbol); |
98 static bool is_ANY_signed_MAGNITUDE (symbol_c *type_symbol); |
89 static bool is_ANY_signed_SAFEMAGNITUDE (symbol_c *type_symbol); |
99 static bool is_ANY_signed_SAFEMAGNITUDE (symbol_c *type_symbol); |
90 static bool is_ANY_signed_MAGNITUDE_compatible (symbol_c *type_symbol); |
100 static bool is_ANY_signed_MAGNITUDE_compatible (symbol_c *type_symbol); |
91 |
101 |
|
102 //static bool is_ANY_NUM_generic_type (symbol_c *type_symbol); |
92 static bool is_ANY_NUM (symbol_c *type_symbol); |
103 static bool is_ANY_NUM (symbol_c *type_symbol); |
93 static bool is_ANY_SAFENUM (symbol_c *type_symbol); |
104 static bool is_ANY_SAFENUM (symbol_c *type_symbol); |
94 static bool is_ANY_NUM_compatible (symbol_c *type_symbol); |
105 static bool is_ANY_NUM_compatible (symbol_c *type_symbol); |
95 |
106 |
96 static bool is_ANY_signed_NUM (symbol_c *type_symbol); |
107 static bool is_ANY_signed_NUM (symbol_c *type_symbol); |
97 static bool is_ANY_signed_SAFENUM (symbol_c *type_symbol); |
108 static bool is_ANY_signed_SAFENUM (symbol_c *type_symbol); |
98 static bool is_ANY_signed_NUM_compatible (symbol_c *type_symbol); |
109 static bool is_ANY_signed_NUM_compatible (symbol_c *type_symbol); |
99 |
110 |
|
111 //static bool is_ANY_INT_generic_type (symbol_c *type_symbol); |
100 static bool is_ANY_INT (symbol_c *type_symbol); |
112 static bool is_ANY_INT (symbol_c *type_symbol); |
101 static bool is_ANY_SAFEINT (symbol_c *type_symbol); |
113 static bool is_ANY_SAFEINT (symbol_c *type_symbol); |
102 static bool is_ANY_INT_compatible (symbol_c *type_symbol); |
114 static bool is_ANY_INT_compatible (symbol_c *type_symbol); |
103 |
115 |
104 static bool is_ANY_signed_INT (symbol_c *type_symbol); |
116 static bool is_ANY_signed_INT (symbol_c *type_symbol); |
107 |
119 |
108 static bool is_ANY_unsigned_INT (symbol_c *type_symbol); |
120 static bool is_ANY_unsigned_INT (symbol_c *type_symbol); |
109 static bool is_ANY_unsigned_SAFEINT (symbol_c *type_symbol); |
121 static bool is_ANY_unsigned_SAFEINT (symbol_c *type_symbol); |
110 static bool is_ANY_unsigned_INT_compatible (symbol_c *type_symbol); |
122 static bool is_ANY_unsigned_INT_compatible (symbol_c *type_symbol); |
111 |
123 |
|
124 //static bool is_ANY_REAL_generic_type (symbol_c *type_symbol); |
112 static bool is_ANY_REAL (symbol_c *type_symbol); |
125 static bool is_ANY_REAL (symbol_c *type_symbol); |
113 static bool is_ANY_SAFEREAL (symbol_c *type_symbol); |
126 static bool is_ANY_SAFEREAL (symbol_c *type_symbol); |
114 static bool is_ANY_REAL_compatible (symbol_c *type_symbol); |
127 static bool is_ANY_REAL_compatible (symbol_c *type_symbol); |
115 |
128 |
116 static bool is_ANY_nBIT (symbol_c *type_symbol); |
129 static bool is_ANY_nBIT (symbol_c *type_symbol); |
119 |
132 |
120 static bool is_BOOL (symbol_c *type_symbol); |
133 static bool is_BOOL (symbol_c *type_symbol); |
121 static bool is_SAFEBOOL (symbol_c *type_symbol); |
134 static bool is_SAFEBOOL (symbol_c *type_symbol); |
122 static bool is_BOOL_compatible (symbol_c *type_symbol); |
135 static bool is_BOOL_compatible (symbol_c *type_symbol); |
123 |
136 |
|
137 //static bool is_ANY_BIT_generic_type (symbol_c *type_symbol); |
124 static bool is_ANY_BIT (symbol_c *type_symbol); |
138 static bool is_ANY_BIT (symbol_c *type_symbol); |
125 static bool is_ANY_SAFEBIT (symbol_c *type_symbol); |
139 static bool is_ANY_SAFEBIT (symbol_c *type_symbol); |
126 static bool is_ANY_BIT_compatible (symbol_c *type_symbol); |
140 static bool is_ANY_BIT_compatible (symbol_c *type_symbol); |
127 |
141 |
|
142 //static bool is_ANY_DATE_generic_type (symbol_c *type_symbol); |
128 static bool is_ANY_DATE (symbol_c *type_symbol); |
143 static bool is_ANY_DATE (symbol_c *type_symbol); |
129 static bool is_ANY_SAFEDATE (symbol_c *type_symbol); |
144 static bool is_ANY_SAFEDATE (symbol_c *type_symbol); |
130 static bool is_ANY_DATE_compatible (symbol_c *type_symbol); |
145 static bool is_ANY_DATE_compatible (symbol_c *type_symbol); |
131 |
146 |
132 static bool is_TIME (symbol_c *type_symbol); |
147 static bool is_TIME (symbol_c *type_symbol); |
133 static bool is_SAFETIME (symbol_c *type_symbol); |
148 static bool is_SAFETIME (symbol_c *type_symbol); |
134 static bool is_TIME_compatible (symbol_c *type_symbol); |
149 static bool is_TIME_compatible (symbol_c *type_symbol); |
135 |
150 |
|
151 //static bool is_ANY_STRING_generic_type (symbol_c *type_symbol); |
136 static bool is_ANY_STRING (symbol_c *type_symbol); |
152 static bool is_ANY_STRING (symbol_c *type_symbol); |
137 static bool is_ANY_SAFESTRING (symbol_c *type_symbol); |
153 static bool is_ANY_SAFESTRING (symbol_c *type_symbol); |
138 static bool is_ANY_STRING_compatible (symbol_c *type_symbol); |
154 static bool is_ANY_STRING_compatible (symbol_c *type_symbol); |
139 |
155 |
140 |
156 |