1 /* |
|
2 * (c) 2003 Mario de Sousa |
|
3 * |
|
4 * Offered to the public under the terms of the GNU General Public License |
|
5 * as published by the Free Software Foundation; either version 2 of the |
|
6 * License, or (at your option) any later version. |
|
7 * |
|
8 * This program is distributed in the hope that it will be useful, but |
|
9 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
11 * Public License for more details. |
|
12 * |
|
13 * This code is made available on the understanding that it will not be |
|
14 * used in safety-critical situations without a full and competent review. |
|
15 */ |
|
16 |
|
17 /* |
|
18 * An IEC 61131-3 IL and ST compiler. |
|
19 * |
|
20 * Based on the |
|
21 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
22 * |
|
23 */ |
|
24 |
|
25 |
|
26 /* |
|
27 * Conversion of basic abstract syntax constructs. |
|
28 * |
|
29 * This is part of the 4th stage that generates |
|
30 * a c++ source program equivalent to the IL and ST |
|
31 * code. |
|
32 */ |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 //#include <stdio.h> /* required for NULL */ |
|
40 //#include <string> |
|
41 //#include <iostream> |
|
42 |
|
43 //#include "../../util/symtable.hh" |
|
44 |
|
45 //#include "generate_cc.hh" |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 class generate_cc_base_c: public iterator_visitor_c { |
|
60 |
|
61 protected: |
|
62 stage4out_c &s4o; |
|
63 |
|
64 private: |
|
65 /* Unlike programs that are mapped onto C++ classes, Function Blocks are mapped onto a data structure type |
|
66 * and a separate function conatining the code. This function is passed a pointer to an instance of the data |
|
67 * structure. This means that the code inside the functions must insert a pointer to the data structure whenever |
|
68 * it wishes to access a Function Block variable. |
|
69 * The variable_prefix_ variable will contain the correct string which needs to be prefixed to all variable accesses. |
|
70 * This string is set with the set_variable_prefix() member function. |
|
71 */ |
|
72 const char *variable_prefix_; |
|
73 |
|
74 |
|
75 |
|
76 public: |
|
77 generate_cc_base_c(stage4out_c *s4o_ptr): s4o(*s4o_ptr) {variable_prefix_ = NULL;} |
|
78 ~generate_cc_base_c(void) {} |
|
79 |
|
80 void set_variable_prefix(const char *variable_prefix) {variable_prefix_ = variable_prefix;} |
|
81 void print_variable_prefix(void) { |
|
82 if (variable_prefix_ != NULL) |
|
83 s4o.print(variable_prefix_); |
|
84 } |
|
85 |
|
86 void *print_token(token_c *token, int offset = 0) { |
|
87 return s4o.printupper((token->value)+offset); |
|
88 } |
|
89 |
|
90 void *print_literal(symbol_c *type, symbol_c *value) { |
|
91 s4o.print("__"); |
|
92 type->accept(*this); |
|
93 s4o.print("_LITERAL("); |
|
94 value->accept(*this); |
|
95 s4o.print(")"); |
|
96 return NULL; |
|
97 } |
|
98 |
|
99 void *print_striped_token(token_c *token, int offset = 0) { |
|
100 std::string str = ""; |
|
101 for (unsigned int i = offset; i < strlen(token->value); i++) |
|
102 if (token->value[i] != '_') |
|
103 str += token->value[i]; |
|
104 return s4o.printupper(str); |
|
105 } |
|
106 |
|
107 void *print_striped_binary_token(token_c *token, unsigned int offset = 0) { |
|
108 /* convert the binary value to hexadecimal format... */ |
|
109 unsigned char value, bit_mult; |
|
110 unsigned int i; |
|
111 int total_bits; |
|
112 char str[2] = {'A', '\0'}; /* since the s4o object is not prepared to print out one character at a time... */ |
|
113 |
|
114 s4o.print("0x"); |
|
115 |
|
116 total_bits = 0; |
|
117 for (i = offset; i < strlen(token->value); i++) |
|
118 if (token->value[i] != '_') |
|
119 total_bits++; |
|
120 |
|
121 value = 0; |
|
122 bit_mult = (unsigned char)1 << (((total_bits+3)%4)+1); |
|
123 for (i = offset; i < strlen(token->value); i++) { |
|
124 if (token->value[i] != '_') { |
|
125 bit_mult /= 2; |
|
126 value += bit_mult * ((token->value[i] == '0')? 0:1); |
|
127 if (bit_mult == 1) { |
|
128 str[0] = (value <= 9)? (char)'0' + value : (char)'A' + value; |
|
129 s4o.print(str); |
|
130 bit_mult = 0x10; |
|
131 value = 0; |
|
132 } |
|
133 } |
|
134 } |
|
135 |
|
136 return NULL; |
|
137 } |
|
138 |
|
139 void *print_list(list_c *list, |
|
140 std::string pre_elem_str = "", |
|
141 std::string inter_elem_str = "", |
|
142 std::string post_elem_str = "", |
|
143 visitor_c *visitor = NULL) { |
|
144 if (visitor == NULL) visitor = this; |
|
145 |
|
146 if (list->n > 0) { |
|
147 //std::cout << "generate_cc_base_c::print_list(n = " << list->n << ") 000\n"; |
|
148 s4o.print(pre_elem_str); |
|
149 list->elements[0]->accept(*visitor); |
|
150 } |
|
151 |
|
152 for(int i = 1; i < list->n; i++) { |
|
153 //std::cout << "generate_cc_base_c::print_list " << i << "\n"; |
|
154 s4o.print(inter_elem_str); |
|
155 list->elements[i]->accept(*visitor); |
|
156 } |
|
157 |
|
158 if (list->n > 0) |
|
159 s4o.print(post_elem_str); |
|
160 |
|
161 return NULL; |
|
162 } |
|
163 |
|
164 |
|
165 void *print_binary_expression(symbol_c *l_exp, |
|
166 symbol_c *r_exp, |
|
167 const char *operation) { |
|
168 s4o.print("("); |
|
169 l_exp->accept(*this); |
|
170 s4o.print(operation); |
|
171 r_exp->accept(*this); |
|
172 s4o.print(")"); |
|
173 return NULL; |
|
174 } |
|
175 |
|
176 void *print_unary_expression(symbol_c *exp, |
|
177 const char *operation) { |
|
178 s4o.print(operation); |
|
179 s4o.print("("); |
|
180 exp->accept(*this); |
|
181 s4o.print(")"); |
|
182 return NULL; |
|
183 } |
|
184 |
|
185 void *print_binary_function(const char *function, |
|
186 symbol_c *l_exp, |
|
187 symbol_c *r_exp) { |
|
188 s4o.print(function); |
|
189 s4o.print("("); |
|
190 l_exp->accept(*this); |
|
191 s4o.print(", "); |
|
192 r_exp->accept(*this); |
|
193 s4o.print(")"); |
|
194 return NULL; |
|
195 } |
|
196 |
|
197 void *print_compare_function(const char *function, |
|
198 symbol_c *compare_type, |
|
199 symbol_c *l_exp, |
|
200 symbol_c *r_exp) { |
|
201 s4o.print(function); |
|
202 compare_type->accept(*this); |
|
203 s4o.print("(2, "); |
|
204 l_exp->accept(*this); |
|
205 s4o.print(", "); |
|
206 r_exp->accept(*this); |
|
207 s4o.print(")"); |
|
208 return NULL; |
|
209 } |
|
210 |
|
211 /***************************/ |
|
212 /* 2.1.6 - Pragmas */ |
|
213 /***************************/ |
|
214 /* Do not use print_token() as it will change everything into uppercase */ |
|
215 void *visit(pragma_c *symbol) {return s4o.print(symbol->value);} |
|
216 |
|
217 |
|
218 /***************************/ |
|
219 /* B 0 - Programming Model */ |
|
220 /***************************/ |
|
221 /* leave for derived classes... */ |
|
222 |
|
223 |
|
224 |
|
225 /*************************/ |
|
226 /* B.1 - Common elements */ |
|
227 /*************************/ |
|
228 /*******************************************/ |
|
229 /* B 1.1 - Letters, digits and identifiers */ |
|
230 /*******************************************/ |
|
231 void *visit(identifier_c *symbol) {return print_token(symbol);} |
|
232 |
|
233 /*********************/ |
|
234 /* B 1.2 - Constants */ |
|
235 /*********************/ |
|
236 /* originally empty... */ |
|
237 |
|
238 /******************************/ |
|
239 /* B 1.2.1 - Numeric Literals */ |
|
240 /******************************/ |
|
241 void *visit(real_c *symbol) {return print_striped_token(symbol);} |
|
242 void *visit(integer_c *symbol) {return print_striped_token(symbol);} |
|
243 void *visit(binary_integer_c *symbol) {return print_striped_binary_token(symbol, 2);} |
|
244 void *visit(octal_integer_c *symbol) {s4o.print("0"); return print_striped_token(symbol, 2);} |
|
245 void *visit(hex_integer_c *symbol) {s4o.print("0x"); return print_striped_token(symbol, 3);} |
|
246 |
|
247 void *visit(numeric_literal_c *symbol) {return print_literal(symbol->type, symbol->value);} |
|
248 void *visit(integer_literal_c *symbol) {return print_literal(symbol->type, symbol->value);} |
|
249 void *visit(real_literal_c *symbol) {return print_literal(symbol->type, symbol->value);} |
|
250 void *visit(bit_string_literal_c *symbol) {return print_literal(symbol->type, symbol->value);} |
|
251 void *visit(boolean_literal_c *symbol) {return print_literal(symbol->type, symbol->value);} |
|
252 |
|
253 /* helper class for boolean_literal_c */ |
|
254 void *visit(boolean_true_c *symbol) {s4o.print("TRUE"); return NULL;} |
|
255 void *visit(boolean_false_c *symbol) {s4o.print("FALSE"); return NULL;} |
|
256 |
|
257 /*******************************/ |
|
258 /* B.1.2.2 Character Strings */ |
|
259 /*******************************/ |
|
260 void *visit(double_byte_character_string_c *symbol) { |
|
261 // TO DO ... |
|
262 ERROR; |
|
263 return print_token(symbol); |
|
264 } |
|
265 |
|
266 void *visit(single_byte_character_string_c *symbol) { |
|
267 std::string str = ""; |
|
268 unsigned int count = 0; |
|
269 str += '"'; |
|
270 /* we ignore the first and last bytes, they will be the character ' */ |
|
271 for (unsigned int i = 1; i < strlen(symbol->value) - 1; i++) { |
|
272 char c = symbol->value[i]; |
|
273 if ((c == '\\') || (c == '"')) |
|
274 {str += '\\'; str += c; count ++; continue;} |
|
275 if (c != '$') |
|
276 {str += c; count++; continue;} |
|
277 /* this should be safe, since the code has passed the syntax parser!! */ |
|
278 c = symbol->value[++i]; |
|
279 switch (c) { |
|
280 case '$': |
|
281 case '\'': |
|
282 {str += c; count++; continue;} |
|
283 case 'L': |
|
284 case 'l': |
|
285 {str += "\x0A"; /* LF */; count++; continue;} |
|
286 case 'N': |
|
287 case 'n': |
|
288 {str += "\\x0A"; /* NL */; count++; continue;} |
|
289 case 'P': |
|
290 case 'p': |
|
291 {str += "\\f"; /* FF */; count++; continue;} |
|
292 case 'R': |
|
293 case 'r': |
|
294 {str += "\\r"; /* CR */; count++; continue;} |
|
295 case 'T': |
|
296 case 't': |
|
297 {str += "\\t"; /* tab */; count++; continue;} |
|
298 default: { |
|
299 if (isxdigit(c)) { |
|
300 /* this should be safe, since the code has passed the syntax parser!! */ |
|
301 char c2 = symbol->value[++i]; |
|
302 if (isxdigit(c2)) { |
|
303 str += '\\'; str += 'x'; str += c; str += c2; |
|
304 count++; continue; |
|
305 } |
|
306 } |
|
307 } |
|
308 /* otherwise we have an invalid string!! */ |
|
309 /* This should not have got through the syntax parser! */ |
|
310 ERROR; |
|
311 } /* switch() */ |
|
312 } /* for() */ |
|
313 |
|
314 str += '"'; |
|
315 s4o.print("(STRING){"); |
|
316 s4o.print_integer(count); |
|
317 s4o.print(","); |
|
318 s4o.print(str); |
|
319 s4o.print("}"); |
|
320 return NULL; |
|
321 } |
|
322 |
|
323 |
|
324 /***************************/ |
|
325 /* B 1.2.3 - Time Literals */ |
|
326 /***************************/ |
|
327 |
|
328 /************************/ |
|
329 /* B 1.2.3.1 - Duration */ |
|
330 /************************/ |
|
331 /* The following output is actually the parameters to the constructor of the TIME class! */ |
|
332 |
|
333 /* SYM_REF0(neg_time_c) */ |
|
334 void *visit(neg_time_c *symbol) {s4o.print("-1"); /* negative time value */; return NULL;} |
|
335 |
|
336 |
|
337 /* SYM_REF2(duration_c, neg, interval) */ |
|
338 void *visit(duration_c *symbol) { |
|
339 TRACE("duration_c"); |
|
340 s4o.print("__time_to_timespec("); |
|
341 if (NULL == symbol->neg) |
|
342 s4o.print("1"); /* positive time value */ |
|
343 else |
|
344 symbol->neg->accept(*this); /* this will print '-1' :-) */ |
|
345 |
|
346 s4o.print(", "); |
|
347 |
|
348 symbol->interval->accept(*this); |
|
349 if (typeid(*symbol->interval) == typeid(hours_c)) {s4o.print(", 0");} |
|
350 if (typeid(*symbol->interval) == typeid(minutes_c)) {s4o.print(", 0, 0");} |
|
351 if (typeid(*symbol->interval) == typeid(seconds_c)) {s4o.print(", 0, 0, 0");} |
|
352 if (typeid(*symbol->interval) == typeid(milliseconds_c)) {s4o.print(", 0, 0, 0, 0");} |
|
353 s4o.print(")"); |
|
354 return NULL; |
|
355 } |
|
356 |
|
357 |
|
358 /* SYM_TOKEN(fixed_point_c) */ |
|
359 void *visit(fixed_point_c *symbol) {return print_token(symbol);} |
|
360 |
|
361 |
|
362 /* SYM_REF2(days_c, days, hours) */ |
|
363 void *visit(days_c *symbol) { |
|
364 TRACE("days_c"); |
|
365 if (NULL == symbol->hours) |
|
366 s4o.print("0, 0, 0, 0"); /* milliseconds, seconds, minutes, hours */ |
|
367 else |
|
368 symbol->hours->accept(*this); |
|
369 |
|
370 s4o.print(", "); |
|
371 |
|
372 symbol->days->accept(*this); |
|
373 return NULL; |
|
374 } |
|
375 |
|
376 |
|
377 /* SYM_REF2(hours_c, hours, minutes) */ |
|
378 void *visit(hours_c *symbol) { |
|
379 TRACE("hours_c"); |
|
380 if (NULL == symbol->minutes) |
|
381 s4o.print("0, 0, 0"); /* milliseconds, seconds, minutes */ |
|
382 else |
|
383 symbol->minutes->accept(*this); |
|
384 |
|
385 s4o.print(", "); |
|
386 |
|
387 symbol->hours->accept(*this); |
|
388 return NULL; |
|
389 } |
|
390 |
|
391 |
|
392 /* SYM_REF2(minutes_c, minutes, seconds) */ |
|
393 void *visit(minutes_c *symbol) { |
|
394 TRACE("minutes_c"); |
|
395 if (NULL == symbol->seconds) |
|
396 s4o.print("0, 0"); /* milliseconds, seconds */ |
|
397 else |
|
398 symbol->seconds->accept(*this); |
|
399 |
|
400 s4o.print(", "); |
|
401 |
|
402 symbol->minutes->accept(*this); |
|
403 return NULL; |
|
404 } |
|
405 |
|
406 |
|
407 /* SYM_REF2(seconds_c, seconds, milliseconds) */ |
|
408 void *visit(seconds_c *symbol) { |
|
409 TRACE("seconds_c"); |
|
410 if (NULL == symbol->milliseconds) |
|
411 s4o.print("0"); /* milliseconds */ |
|
412 else |
|
413 symbol->milliseconds->accept(*this); |
|
414 |
|
415 s4o.print(", "); |
|
416 |
|
417 symbol->seconds->accept(*this); |
|
418 return NULL; |
|
419 } |
|
420 |
|
421 |
|
422 /* SYM_REF2(milliseconds_c, milliseconds, unused) */ |
|
423 void *visit(milliseconds_c *symbol) { |
|
424 TRACE("milliseconds_c"); |
|
425 symbol->milliseconds->accept(*this); |
|
426 return NULL; |
|
427 } |
|
428 |
|
429 /************************************/ |
|
430 /* B 1.2.3.2 - Time of day and Date */ |
|
431 /************************************/ |
|
432 |
|
433 /* SYM_REF2(time_of_day_c, daytime, unused) */ |
|
434 void *visit(time_of_day_c *symbol) { |
|
435 TRACE("time_of_day_c"); |
|
436 s4o.print("__tod_to_timespec("); |
|
437 symbol->daytime->accept(*this); |
|
438 s4o.print(")"); |
|
439 return NULL; |
|
440 } |
|
441 |
|
442 |
|
443 /* SYM_REF4(daytime_c, day_hour, day_minute, day_second, unused) */ |
|
444 void *visit(daytime_c *symbol) { |
|
445 TRACE("daytime_c"); |
|
446 symbol->day_second->accept(*this); |
|
447 s4o.print(", "); |
|
448 symbol->day_minute->accept(*this); |
|
449 s4o.print(", "); |
|
450 symbol->day_hour->accept(*this); |
|
451 return NULL; |
|
452 } |
|
453 |
|
454 |
|
455 /* SYM_REF2(date_c, date_literal, unused) */ |
|
456 void *visit(date_c *symbol) { |
|
457 TRACE("date_c"); |
|
458 s4o.print("__date_to_timespec("); |
|
459 symbol->date_literal->accept(*this); |
|
460 s4o.print(")"); |
|
461 return NULL; |
|
462 } |
|
463 |
|
464 |
|
465 /* SYM_REF4(date_literal_c, year, month, day, unused) */ |
|
466 void *visit(date_literal_c *symbol) { |
|
467 TRACE("date_literal_c"); |
|
468 symbol->day->accept(*this); |
|
469 s4o.print(", "); |
|
470 symbol->month->accept(*this); |
|
471 s4o.print(", "); |
|
472 symbol->year->accept(*this); |
|
473 return NULL; |
|
474 } |
|
475 |
|
476 |
|
477 /* SYM_REF2(date_and_time_c, date_literal, daytime) */ |
|
478 void *visit(date_and_time_c *symbol) { |
|
479 TRACE("date_and_time_c"); |
|
480 s4o.print("__dt_to_timespec("); |
|
481 symbol->daytime->accept(*this); |
|
482 s4o.print(", "); |
|
483 symbol->date_literal->accept(*this); |
|
484 s4o.print(")"); |
|
485 return NULL; |
|
486 } |
|
487 |
|
488 |
|
489 /**********************/ |
|
490 /* B.1.3 - Data types */ |
|
491 /**********************/ |
|
492 /***********************************/ |
|
493 /* B 1.3.1 - Elementary Data Types */ |
|
494 /***********************************/ |
|
495 void *visit(time_type_name_c *symbol) {s4o.print("TIME"); return NULL;} |
|
496 void *visit(bool_type_name_c *symbol) {s4o.print("BOOL"); return NULL;} |
|
497 void *visit(sint_type_name_c *symbol) {s4o.print("SINT"); return NULL;} |
|
498 void *visit(int_type_name_c *symbol) {s4o.print("INT"); return NULL;} |
|
499 void *visit(dint_type_name_c *symbol) {s4o.print("DINT"); return NULL;} |
|
500 void *visit(lint_type_name_c *symbol) {s4o.print("LINT"); return NULL;} |
|
501 void *visit(usint_type_name_c *symbol) {s4o.print("USINT"); return NULL;} |
|
502 void *visit(uint_type_name_c *symbol) {s4o.print("UINT"); return NULL;} |
|
503 void *visit(udint_type_name_c *symbol) {s4o.print("UDINT"); return NULL;} |
|
504 void *visit(ulint_type_name_c *symbol) {s4o.print("ULINT"); return NULL;} |
|
505 void *visit(real_type_name_c *symbol) {s4o.print("REAL"); return NULL;} |
|
506 void *visit(lreal_type_name_c *symbol) {s4o.print("LREAL"); return NULL;} |
|
507 void *visit(date_type_name_c *symbol) {s4o.print("DATE"); return NULL;} |
|
508 void *visit(tod_type_name_c *symbol) {s4o.print("TOD"); return NULL;} |
|
509 void *visit(dt_type_name_c *symbol) {s4o.print("DT"); return NULL;} |
|
510 void *visit(byte_type_name_c *symbol) {s4o.print("BYTE"); return NULL;} |
|
511 void *visit(word_type_name_c *symbol) {s4o.print("WORD"); return NULL;} |
|
512 void *visit(lword_type_name_c *symbol) {s4o.print("LWORD"); return NULL;} |
|
513 void *visit(dword_type_name_c *symbol) {s4o.print("DWORD"); return NULL;} |
|
514 void *visit(string_type_name_c *symbol) {s4o.print("STRING"); return NULL;} |
|
515 void *visit(wstring_type_name_c *symbol) {s4o.print("WSTRING"); return NULL;} |
|
516 |
|
517 /********************************/ |
|
518 /* B.1.3.2 - Generic data types */ |
|
519 /********************************/ |
|
520 /* originally empty... */ |
|
521 |
|
522 /********************************/ |
|
523 /* B 1.3.3 - Derived data types */ |
|
524 /********************************/ |
|
525 /* leave for derived classes... */ |
|
526 |
|
527 /*********************/ |
|
528 /* B 1.4 - Variables */ |
|
529 /*********************/ |
|
530 void *visit(symbolic_variable_c *symbol) { |
|
531 TRACE("symbolic_variable_c"); |
|
532 this->print_variable_prefix(); |
|
533 symbol->var_name->accept(*this); |
|
534 return NULL; |
|
535 } |
|
536 |
|
537 /********************************************/ |
|
538 /* B.1.4.1 Directly Represented Variables */ |
|
539 /********************************************/ |
|
540 void *visit(direct_variable_c *symbol) { |
|
541 TRACE("direct_variable_c"); |
|
542 /* Do not use print_token() as it will change everything into uppercase */ |
|
543 return s4o.printlocation(symbol->value); |
|
544 } |
|
545 |
|
546 |
|
547 |
|
548 /*************************************/ |
|
549 /* B.1.4.2 Multi-element Variables */ |
|
550 /*************************************/ |
|
551 #if 0 |
|
552 /* subscripted_variable '[' subscript_list ']' */ |
|
553 SYM_REF2(array_variable_c, subscripted_variable, subscript_list) |
|
554 |
|
555 /* subscript_list ',' subscript */ |
|
556 SYM_LIST(subscript_list_c) |
|
557 #endif |
|
558 |
|
559 /* record_variable '.' field_selector */ |
|
560 /* WARNING: input and/or output variables of function blocks |
|
561 * may be accessed as fields of a structured variable! |
|
562 * Code handling a structured_variable_c must take |
|
563 * this into account! |
|
564 */ |
|
565 // SYM_REF2(structured_variable_c, record_variable, field_selector) |
|
566 void *visit(structured_variable_c *symbol) { |
|
567 TRACE("structured_variable_c"); |
|
568 |
|
569 symbol->record_variable->accept(*this); |
|
570 s4o.print("."); |
|
571 symbol->field_selector->accept(*this); |
|
572 return NULL; |
|
573 } |
|
574 |
|
575 /******************************************/ |
|
576 /* B 1.4.3 - Declaration & Initialisation */ |
|
577 /******************************************/ |
|
578 /* leave for derived classes... */ |
|
579 |
|
580 /**************************************/ |
|
581 /* B.1.5 - Program organization units */ |
|
582 /**************************************/ |
|
583 /***********************/ |
|
584 /* B 1.5.1 - Functions */ |
|
585 /***********************/ |
|
586 /* leave for derived classes... */ |
|
587 |
|
588 /*****************************/ |
|
589 /* B 1.5.2 - Function Blocks */ |
|
590 /*****************************/ |
|
591 /* leave for derived classes... */ |
|
592 |
|
593 /**********************/ |
|
594 /* B 1.5.3 - Programs */ |
|
595 /**********************/ |
|
596 /* leave for derived classes... */ |
|
597 |
|
598 /*********************************************/ |
|
599 /* B.1.6 Sequential function chart elements */ |
|
600 /*********************************************/ |
|
601 |
|
602 /********************************/ |
|
603 /* B 1.7 Configuration elements */ |
|
604 /********************************/ |
|
605 /* leave for derived classes... */ |
|
606 |
|
607 /****************************************/ |
|
608 /* B.2 - Language IL (Instruction List) */ |
|
609 /****************************************/ |
|
610 /***********************************/ |
|
611 /* B 2.1 Instructions and Operands */ |
|
612 /***********************************/ |
|
613 /* leave for derived classes... */ |
|
614 |
|
615 /*******************/ |
|
616 /* B 2.2 Operators */ |
|
617 /*******************/ |
|
618 /* leave for derived classes... */ |
|
619 |
|
620 |
|
621 /***************************************/ |
|
622 /* B.3 - Language ST (Structured Text) */ |
|
623 /***************************************/ |
|
624 /***********************/ |
|
625 /* B 3.1 - Expressions */ |
|
626 /***********************/ |
|
627 /* leave for derived classes... */ |
|
628 |
|
629 /********************/ |
|
630 /* B 3.2 Statements */ |
|
631 /********************/ |
|
632 /* leave for derived classes... */ |
|
633 |
|
634 /*********************************/ |
|
635 /* B 3.2.1 Assignment Statements */ |
|
636 /*********************************/ |
|
637 /* leave for derived classes... */ |
|
638 |
|
639 /*****************************************/ |
|
640 /* B 3.2.2 Subprogram Control Statements */ |
|
641 /*****************************************/ |
|
642 /* leave for derived classes... */ |
|
643 |
|
644 /********************************/ |
|
645 /* B 3.2.3 Selection Statements */ |
|
646 /********************************/ |
|
647 /* leave for derived classes... */ |
|
648 |
|
649 /********************************/ |
|
650 /* B 3.2.4 Iteration Statements */ |
|
651 /********************************/ |
|
652 /* leave for derived classes... */ |
|
653 |
|
654 }; /* class generate_cc_basic_c */ |
|
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|