64 */ |
64 */ |
65 const char *current_filename = NULL; |
65 const char *current_filename = NULL; |
66 |
66 |
67 |
67 |
68 /******************************************************/ |
68 /******************************************************/ |
69 /* whether we are suporting safe extensions */ |
69 /* whether we are supporting safe extensions */ |
70 /* as defined in PLCopen - Technical Committee 5 */ |
70 /* as defined in PLCopen - Technical Committee 5 */ |
71 /* Safety Software Technical Specification, */ |
71 /* Safety Software Technical Specification, */ |
72 /* Part 1: Concepts and Function Blocks, */ |
72 /* Part 1: Concepts and Function Blocks, */ |
73 /* Version 1.0 – Official Release */ |
73 /* Version 1.0 – Official Release */ |
74 /******************************************************/ |
74 /******************************************************/ |
75 bool safe_extensions_ = false; |
75 bool safe_extensions_ = false; |
76 bool get_opt_safe_extensions() {return safe_extensions_;} |
76 bool get_opt_safe_extensions() {return safe_extensions_;} |
|
77 |
|
78 /******************************************************/ |
|
79 /* whether we are supporting conversion functions */ |
|
80 /* for enumerate data types */ |
|
81 /******************************************************/ |
|
82 bool conversion_functions_ = false; |
|
83 |
77 |
84 |
78 /****************************************************/ |
85 /****************************************************/ |
79 /* Controlling the entry to the body_state in flex. */ |
86 /* Controlling the entry to the body_state in flex. */ |
80 /****************************************************/ |
87 /****************************************************/ |
81 static int goto_body_state__ = 0; |
88 static int goto_body_state__ = 0; |
302 * These callback functions will get their data from local (to this file) global variables... |
309 * These callback functions will get their data from local (to this file) global variables... |
303 * We now set those variables... |
310 * We now set those variables... |
304 */ |
311 */ |
305 |
312 |
306 safe_extensions_ = options.safe_extensions; |
313 safe_extensions_ = options.safe_extensions; |
|
314 conversion_functions_ = options.conversion_functions; |
307 int ret = stage2__(filename, options.includedir, tree_root_ref, options.full_token_loc); |
315 int ret = stage2__(filename, options.includedir, tree_root_ref, options.full_token_loc); |
308 derived_conversion_functions_c derived_conversion_functions(*tree_root_ref); |
316 |
309 std::string source_code = derived_conversion_functions.get_declaration(*tree_root_ref); |
317 if (conversion_functions_) { |
310 ret = sstage2__(source_code.c_str(), tree_root_ref, false); |
318 derived_conversion_functions_c derived_conversion_functions(*tree_root_ref); |
|
319 std::string source_code = derived_conversion_functions.get_declaration(*tree_root_ref); |
|
320 ret = sstage2__(source_code.c_str(), tree_root_ref, false); |
|
321 } |
311 return ret; |
322 return ret; |
312 } |
323 } |
313 |
324 |