Start implement lvalue check in IL instruction.
authorManuele Conti <conti.ma@alice.it>
Sat, 21 Apr 2012 17:42:07 +0200
changeset 527 1d83209aabfe
parent 526 6e610449861a
child 528 6510ee2eaab9
Start implement lvalue check in IL instruction.
stage3/lvalue_check.cc
stage3/lvalue_check.hh
--- 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) */
 /***************************************/
--- 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) */
     /***************************************/