stage3/fill_candidate_datatypes.hh
changeset 465 b52ec62773db
parent 464 319ee8b218f3
child 472 d26759a2274a
equal deleted inserted replaced
464:319ee8b218f3 465:b52ec62773db
    58 
    58 
    59     /* This variable was created to pass information from
    59     /* This variable was created to pass information from
    60      * fill_candidate_datatypes_c::visit(case_statement_c *symbol) function to
    60      * fill_candidate_datatypes_c::visit(case_statement_c *symbol) function to
    61      * fill_candidate_datatypes_c::visit(case_list_c *symbol) function.
    61      * fill_candidate_datatypes_c::visit(case_list_c *symbol) function.
    62      */
    62      */
    63     symbol_c *case_expression_type;
    63 //     symbol_c *case_expression_type;
    64 
    64 
    65     /* In IL code, once we find a type mismatch error, it is best to
    65     /* In IL code, once we find a type mismatch error, it is best to
    66      * ignore any further errors until the end of the logical operation,
    66      * ignore any further errors until the end of the logical operation,
    67      * i.e. until the next LD.
    67      * i.e. until the next LD.
    68      * However, we cannot clear the il_error flag on all LD operations,
    68      * However, we cannot clear the il_error flag on all LD operations,
    69      * as these may also be used within parenthesis. LD operations
    69      * as these may also be used within parenthesis. LD operations
    70      * within parenthesis may not clear the error flag.
    70      * within parenthesis may not clear the error flag.
    71      * We therefore need a counter to know how deep inside a parenthesis
    71      * We therefore need a counter to know how deep inside a parenthesis
    72      * structure we are.
    72      * structure we are.
    73      */
    73      */
    74     int  il_parenthesis_level;
    74 //     int  il_parenthesis_level;
    75     bool error_found;
    75 //     bool error_found;
    76 
    76 
    77     /* the current data type of the data stored in the IL stack, i.e. the default variable */
    77     /* the current data type of the data stored in the IL stack, i.e. the default variable */
    78     symbol_c *prev_il_instruction;
    78     symbol_c *prev_il_instruction;
    79     /* the current IL operand being analyzed - its symbol and its data type */
    79     /* the current IL operand being analyzed - its symbol and its data type */
    80     symbol_c *il_operand_type;
    80     symbol_c *il_operand_type;
    88     void handle_function_call(symbol_c *fcall, generic_function_call_t fcall_data);
    88     void handle_function_call(symbol_c *fcall, generic_function_call_t fcall_data);
    89     void handle_implicit_il_fb_call(symbol_c *il_instruction, const char *param_name, symbol_c *&called_fb_declaration);
    89     void handle_implicit_il_fb_call(symbol_c *il_instruction, const char *param_name, symbol_c *&called_fb_declaration);
    90     
    90     
    91     /* a helper function... */
    91     /* a helper function... */
    92     symbol_c *base_type(symbol_c *symbol);    
    92     symbol_c *base_type(symbol_c *symbol);    
       
    93     
       
    94     /* add a data type to a candidate data type list, while guaranteeing no duplicate entries! */
       
    95     /* Returns true if it really did add the datatype to the list, or false if it was already present in the list! */
       
    96     bool add_datatype_to_candidate_list(symbol_c *symbol, symbol_c *datatype);
    93     
    97     
    94     
    98     
    95   public:
    99   public:
    96     fill_candidate_datatypes_c(symbol_c *ignore);
   100     fill_candidate_datatypes_c(symbol_c *ignore);
    97     virtual ~fill_candidate_datatypes_c(void);
   101     virtual ~fill_candidate_datatypes_c(void);