public void process(AssignmentStatment assignmentStatment) { VaribleStatment varibleStatment = (VaribleStatment)assignmentStatment.getTokensList()[0]; if (varibleStatment.getTokensList().Count == 1) // для переменной { _isArrayElementLeft = false; _leftOp = (Token)varibleStatment.getTokensList()[0]; Program.varibleName = _leftOp.value; SemanticAnalizer.initVarible(_leftOp.value); _rightOp = getRightOp(assignmentStatment.getTokensList()[1]); } else //элемент массива { _isArrayElementLeft = true; _leftOp = (Token)varibleStatment.getTokensList()[0]; Program.varibleName = _leftOp.value; _elementIndex = (Token)varibleStatment.getTokensList()[2]; List <Token> rightOp = getRightOp(assignmentStatment.getTokensList()[1]); SemanticAnalizer.checkArrayOnOutOfRange(rightOp); } //SemanticAnalizer.checkDivByZero(_rightOp); //SemanticAnalizer.checkArrayOnOutOfRange(_rightOp); generate(); }
static public string visit(AssignmentStatment assignmentStatment) { return(Constants.ASSIGNMENT_STATMENT); }