# HG changeset patch # User Manuele Conti # Date 1335022927 -7200 # Node ID 1d83209aabfe8f469485d2bf64af1f6ae720f53c # Parent 6e610449861a16bfe88c36485bd89a1c8ea648d3 Start implement lvalue check in IL instruction. diff -r 6e610449861a -r 1d83209aabfe stage3/lvalue_check.cc --- a/stage3/lvalue_check.cc Sat Apr 21 17:43:55 2012 +0200 +++ b/stage3/lvalue_check.cc Sat Apr 21 17:42:07 2012 +0200 @@ -362,6 +362,59 @@ return NULL; } +/****************************************/ +/* B.2 - Language IL (Instruction List) */ +/****************************************/ +/***********************************/ +/* B 2.1 Instructions and Operands */ +/***********************************/ +void *lvalue_check_c::visit(il_instruction_c *symbol) { + symbol->il_instruction->accept(*this); + return NULL; +} + +void *lvalue_check_c::visit(il_simple_operation_c *symbol) { + /* recursive call to fill the candidate data types list */ + current_il_operand = symbol->il_operand; + symbol->il_simple_operator->accept(*this); + current_il_operand = NULL; + return NULL; +} + + +/*******************/ +/* B 2.2 Operators */ +/*******************/ +void *lvalue_check_c::visit(ST_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + +void *lvalue_check_c::visit(STN_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + +void *lvalue_check_c::visit(S_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + +void *lvalue_check_c::visit(R_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + +void *lvalue_check_c::visit(S1_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + +void *lvalue_check_c::visit(R1_operator_c *symbol) { + verify_is_lvalue(current_il_operand); + return NULL; +} + /***************************************/ /* B.3 - Language ST (Structured Text) */ /***************************************/ diff -r 6e610449861a -r 1d83209aabfe stage3/lvalue_check.hh --- a/stage3/lvalue_check.hh Sat Apr 21 17:43:55 2012 +0200 +++ b/stage3/lvalue_check.hh Sat Apr 21 17:42:07 2012 +0200 @@ -83,6 +83,25 @@ /**********************/ void *visit(program_declaration_c *symbol); + /****************************************/ + /* B.2 - Language IL (Instruction List) */ + /****************************************/ + /***********************************/ + /* B 2.1 Instructions and Operands */ + /***********************************/ + void *visit(il_instruction_c *symbol); + void *visit(il_simple_operation_c *symbol); + + /*******************/ + /* B 2.2 Operators */ + /*******************/ + void *visit(ST_operator_c *symbol); + void *visit(STN_operator_c *symbol); + void *visit(S_operator_c *symbol); + void *visit(R_operator_c *symbol); + void *visit(S1_operator_c *symbol); + void *visit(R1_operator_c *symbol); + /***************************************/ /* B.3 - Language ST (Structured Text) */ /***************************************/