1 /* |
1 /* |
2 * matiec - a compiler for the programming languages defined in IEC 61131-3 |
2 * matiec - a compiler for the programming languages defined in IEC 61131-3 |
3 * |
3 * |
4 * Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) |
4 * Copyright (C) 2003-2012 Mario de Sousa (msousa@fe.up.pt) |
5 * Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
5 * Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
6 * |
6 * |
7 * This program is free software: you can redistribute it and/or modify |
7 * This program is free software: you can redistribute it and/or modify |
8 * it under the terms of the GNU General Public License as published by |
8 * it under the terms of the GNU General Public License as published by |
9 * the Free Software Foundation, either version 3 of the License, or |
9 * the Free Software Foundation, either version 3 of the License, or |
58 |
58 |
59 public: |
59 public: |
60 search_base_type_c(void); |
60 search_base_type_c(void); |
61 |
61 |
62 public: |
62 public: |
63 void *visit(identifier_c *type_name); |
63 symbol_c *get_basetype_decl(symbol_c *symbol); |
|
64 symbol_c *get_basetype_id (symbol_c *symbol); |
64 bool type_is_subrange(symbol_c* type_decl); |
65 bool type_is_subrange(symbol_c* type_decl); |
65 bool type_is_enumerated(symbol_c* type_decl); |
66 bool type_is_enumerated(symbol_c* type_decl); |
66 |
67 |
67 public: |
68 public: |
68 /*********************/ |
69 /*************************/ |
69 /* B 1.2 - Constants */ |
70 /* B.1 - Common elements */ |
70 /*********************/ |
71 /*************************/ |
71 |
72 /*******************************************/ |
72 /******************************/ |
73 /* B 1.1 - Letters, digits and identifiers */ |
73 /* B 1.2.1 - Numeric Literals */ |
74 /*******************************************/ |
74 /******************************/ |
75 void *visit(identifier_c *type_name); |
|
76 |
|
77 |
|
78 /*********************/ |
|
79 /* B 1.2 - Constants */ |
|
80 /*********************/ |
|
81 /******************************/ |
|
82 /* B 1.2.1 - Numeric Literals */ |
|
83 /******************************/ |
75 /* Numeric literals without any explicit type cast have unknown data type, |
84 /* Numeric literals without any explicit type cast have unknown data type, |
76 * so we continue considering them as their own basic data types until |
85 * so we continue considering them as their own basic data types until |
77 * they can be resolved (for example, when using '30+x' where 'x' is a LINT variable, the |
86 * they can be resolved (for example, when using '30+x' where 'x' is a LINT variable, the |
78 * numeric literal '30' must then be considered a LINT so the ADD function may be called |
87 * numeric literal '30' must then be considered a LINT so the ADD function may be called |
79 * with all inputs of the same data type. |
88 * with all inputs of the same data type. |
225 /*****************************/ |
234 /*****************************/ |
226 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
235 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
227 // SYM_REF3(function_block_declaration_c, fblock_name, var_declarations, fblock_body) |
236 // SYM_REF3(function_block_declaration_c, fblock_name, var_declarations, fblock_body) |
228 void *visit(function_block_declaration_c *symbol); |
237 void *visit(function_block_declaration_c *symbol); |
229 |
238 |
|
239 /*********************************************/ |
|
240 /* B.1.6 Sequential function chart elements */ |
|
241 /*********************************************/ |
|
242 /* INITIAL_STEP step_name ':' action_association_list END_STEP */ |
|
243 // SYM_REF2(initial_step_c, step_name, action_association_list) |
|
244 void *visit(initial_step_c *symbol); |
|
245 |
|
246 /* STEP step_name ':' action_association_list END_STEP */ |
|
247 // SYM_REF2(step_c, step_name, action_association_list) |
|
248 void *visit(step_c *symbol); |
|
249 |
|
250 |
230 }; // search_base_type_c |
251 }; // search_base_type_c |
231 |
252 |
232 |
253 |
233 |
254 |
234 |
255 |