public void Visit(VariableAssignmentStatement statement) { var leftArgs = VisitChild(statement.Left); var rightArgs = VisitChild(statement.Right); Type leftType = Type.GetType(leftArgs.Scope.CodeDomReference.BaseType); Type rightType = Type.GetType(rightArgs.Scope.CodeDomReference.BaseType); 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); }