53 |
53 |
54 private: // this is a purely static class. No need for constructors! |
54 private: // this is a purely static class. No need for constructors! |
55 get_datatype_info_c(void) {}; |
55 get_datatype_info_c(void) {}; |
56 ~get_datatype_info_c(void) {}; |
56 ~get_datatype_info_c(void) {}; |
57 |
57 |
58 |
58 |
59 public: |
59 public: |
60 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
60 static bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
61 static bool is_type_valid(symbol_c *type); |
61 static bool is_type_valid(symbol_c *type); |
62 |
62 |
63 static bool is_ANY_REAL_literal(symbol_c *type_symbol); /* Can't we do away with this?? */ |
63 static bool is_ANY_REAL_literal(symbol_c *type_symbol); /* Can't we do away with this?? */ |
70 static bool is_enumerated (symbol_c *type_symbol); |
70 static bool is_enumerated (symbol_c *type_symbol); |
71 static bool is_array (symbol_c *type_symbol); |
71 static bool is_array (symbol_c *type_symbol); |
72 static bool is_structure (symbol_c *type_symbol); |
72 static bool is_structure (symbol_c *type_symbol); |
73 |
73 |
74 |
74 |
75 |
|
76 static bool is_ANY_ELEMENTARY (symbol_c *type_symbol); |
75 static bool is_ANY_ELEMENTARY (symbol_c *type_symbol); |
77 static bool is_ANY_SAFEELEMENTARY (symbol_c *type_symbol); |
76 static bool is_ANY_SAFEELEMENTARY (symbol_c *type_symbol); |
78 static bool is_ANY_ELEMENTARY_compatible (symbol_c *type_symbol); |
77 static bool is_ANY_ELEMENTARY_compatible (symbol_c *type_symbol); |
79 |
78 |
80 static bool is_ANY_MAGNITUDE (symbol_c *type_symbol); |
79 static bool is_ANY_MAGNITUDE (symbol_c *type_symbol); |
131 |
130 |
132 static bool is_ANY_STRING (symbol_c *type_symbol); |
131 static bool is_ANY_STRING (symbol_c *type_symbol); |
133 static bool is_ANY_SAFESTRING (symbol_c *type_symbol); |
132 static bool is_ANY_SAFESTRING (symbol_c *type_symbol); |
134 static bool is_ANY_STRING_compatible (symbol_c *type_symbol); |
133 static bool is_ANY_STRING_compatible (symbol_c *type_symbol); |
135 |
134 |
|
135 |
|
136 |
|
137 |
|
138 public: |
|
139 /* object used to identify an entry in the abstract syntax tree with an invalid data type */ |
|
140 /* This is only used from stage3 onwards. Stages 1 and 2 will never create any instances of invalid_type_name_c */ |
|
141 static invalid_type_name_c invalid_type_name; |
|
142 |
|
143 /**********************/ |
|
144 /* B.1.3 - Data types */ |
|
145 /**********************/ |
|
146 /***********************************/ |
|
147 /* B 1.3.1 - Elementary Data Types */ |
|
148 /***********************************/ |
|
149 static real_type_name_c lreal_type_name; |
|
150 static real_type_name_c real_type_name; |
|
151 |
|
152 static lint_type_name_c lint_type_name; |
|
153 static dint_type_name_c dint_type_name; |
|
154 static int_type_name_c int_type_name; |
|
155 static sint_type_name_c sint_type_name; |
|
156 |
|
157 static ulint_type_name_c ulint_type_name; |
|
158 static udint_type_name_c udint_type_name; |
|
159 static uint_type_name_c uint_type_name; |
|
160 static usint_type_name_c usint_type_name; |
|
161 |
|
162 static lword_type_name_c lword_type_name; |
|
163 static dword_type_name_c dword_type_name; |
|
164 static word_type_name_c word_type_name; |
|
165 static byte_type_name_c byte_type_name; |
|
166 static bool_type_name_c bool_type_name; |
|
167 |
|
168 static wstring_type_name_c wstring_type_name; |
|
169 static string_type_name_c string_type_name; |
|
170 |
|
171 static dt_type_name_c dt_type_name; |
|
172 static date_type_name_c date_type_name; |
|
173 static tod_type_name_c tod_type_name; |
|
174 static time_type_name_c time_type_name; |
|
175 |
|
176 |
|
177 /******************************************************/ |
|
178 /* Extensions to the base standard as defined in */ |
|
179 /* "Safety Software Technical Specification, */ |
|
180 /* Part 1: Concepts and Function Blocks, */ |
|
181 /* Version 1.0 – Official Release" */ |
|
182 /* by PLCopen - Technical Committee 5 - 2006-01-31 */ |
|
183 /******************************************************/ |
|
184 static safereal_type_name_c safelreal_type_name; |
|
185 static safereal_type_name_c safereal_type_name; |
|
186 |
|
187 static safelint_type_name_c safelint_type_name; |
|
188 static safedint_type_name_c safedint_type_name; |
|
189 static safeint_type_name_c safeint_type_name; |
|
190 static safesint_type_name_c safesint_type_name; |
|
191 |
|
192 static safeulint_type_name_c safeulint_type_name; |
|
193 static safeudint_type_name_c safeudint_type_name; |
|
194 static safeuint_type_name_c safeuint_type_name; |
|
195 static safeusint_type_name_c safeusint_type_name; |
|
196 |
|
197 static safelword_type_name_c safelword_type_name; |
|
198 static safedword_type_name_c safedword_type_name; |
|
199 static safeword_type_name_c safeword_type_name; |
|
200 static safebyte_type_name_c safebyte_type_name; |
|
201 static safebool_type_name_c safebool_type_name; |
|
202 |
|
203 static safewstring_type_name_c safewstring_type_name; |
|
204 static safestring_type_name_c safestring_type_name; |
|
205 |
|
206 static safedt_type_name_c safedt_type_name; |
|
207 static safedate_type_name_c safedate_type_name; |
|
208 static safetod_type_name_c safetod_type_name; |
|
209 static safetime_type_name_c safetime_type_name; |
136 }; |
210 }; |
137 |
211 |