public void Visit(VariableAssignmentStatement statement) { var leftArgs = VisitChild(statement.Left); var rightArgs = VisitChild(statement.Right); Type leftType = leftArgs.Scope.CodeDomReference.GenerateType(); Type rightType = rightArgs.Scope.CodeDomReference.GenerateType(); if (leftType != rightType && leftType != null) { var leftPrimitive = TablePrimitive.FromType(leftType); rightArgs.CodeExpression = leftPrimitive.ToNative(rightArgs.CodeExpression); } var assignment = new CodeAssignStatement(leftArgs.CodeExpression, rightArgs.CodeExpression); _codeStack.Peek().Scope = rightArgs.Scope; _codeStack.Peek().ParentStatements.Add(assignment); }
public void Visit(VariableAssignmentStatement statement, CommonTree tree) { Parent(tree).Children.Add(statement); SetLine(statement, tree); VisitChildren(tree); }