1043 SYM_REF1(neg_expression_c, exp) |
1043 SYM_REF1(neg_expression_c, exp) |
1044 SYM_REF1(not_expression_c, exp) |
1044 SYM_REF1(not_expression_c, exp) |
1045 |
1045 |
1046 /* formal_param_list -> may be NULL ! */ |
1046 /* formal_param_list -> may be NULL ! */ |
1047 /* nonformal_param_list -> may be NULL ! */ |
1047 /* nonformal_param_list -> may be NULL ! */ |
1048 /* NOTE: The parameter 'called_function_declaration' is used to pass data between the stage 3 and stage 4. |
1048 /* NOTES: |
|
1049 * The parameter 'called_function_declaration'... |
|
1050 * ...is used to pass data between the stage 3 and stage 4. |
1049 * The IEC 61131-3 standard allows for overloaded standard functions. This means that some |
1051 * The IEC 61131-3 standard allows for overloaded standard functions. This means that some |
1050 * function calls are not completely defined by the name of the function being called, |
1052 * function calls are not completely defined by the name of the function being called, |
1051 * and need to be disambiguated with using the data types of the parameters being passed. |
1053 * and need to be disambiguated with using the data types of the parameters being passed. |
1052 * Stage 3 does this to verify semantic correctness. |
1054 * Stage 3 does this to verify semantic correctness. |
1053 * Stage 4 also needs to do this in order to determine which function to call. |
1055 * Stage 4 also needs to do this in order to determine which function to call. |
1054 * It does not make sense to determine the exact function being called twice (once in stage 3, |
1056 * It does not make sense to determine the exact function being called twice (once in stage 3, |
1055 * and again in stage 4), so stage 3 will store this info in the parameter called_function_declaration |
1057 * and again in stage 4), so stage 3 will store this info in the parameter called_function_declaration |
1056 * for stage 4 to use it later on. |
1058 * for stage 4 to use it later on. |
1057 */ |
1059 * The parameter 'candidate_functions'... |
1058 SYM_REF3(function_invocation_c, function_name, formal_param_list, nonformal_param_list, symbol_c *called_function_declaration; int extensible_param_count;) |
1060 * ...is used to pass data between two passes within stage 3 |
|
1061 * (actually between fill_candidate_datatypes_c and narrow_candidate_datatypes_c). |
|
1062 * It is used to store all the functions that may be legally called with the current parameters |
|
1063 * being used in this function invocation. Note that the standard includes some standard functions |
|
1064 * that have the exact same input parameter types, but return different data types. |
|
1065 * In order to determine which of these functions should be called, we first create a list |
|
1066 * of all possible functions, and then narrow down the list (hopefully down to 1 function) |
|
1067 * once we know the data type that the function invocation must return (this will take into |
|
1068 * account the expression in which the function invocation is inserted/occurs). |
|
1069 * The parameter 'extensible_param_count'... |
|
1070 * ...is used to pass data between the stage 3 and stage 4. |
|
1071 * The IEC 61131-3 standard allows for extensible standard functions. This means that some |
|
1072 * standard functions may be called with a variable number of paramters. Stage 3 will store |
|
1073 * in extensible_param_count the number of parameters being passed to the extensible parameter. |
|
1074 */ |
|
1075 SYM_REF3(function_invocation_c, function_name, formal_param_list, nonformal_param_list, symbol_c *called_function_declaration; int extensible_param_count; std::vector <symbol_c *> candidate_functions;) |
1059 |
1076 |
1060 |
1077 |
1061 /********************/ |
1078 /********************/ |
1062 /* B 3.2 Statements */ |
1079 /* B 3.2 Statements */ |
1063 /********************/ |
1080 /********************/ |