public void VisitNode(AssignmentExpr node) { String RHS_Type; Utilities.TypeVisitAllChildren(node); Attributes a = new Attributes("Assignment"); AssignmentTypeDescriptor ATD = new AssignmentTypeDescriptor(); // Get Qualified Name List <QualifiedName> matchingChildren = Utilities.GetChildren(node, typeof(QualifiedName)).Cast <QualifiedName>().ToList(); ATD.LHS_Type = Utilities.attrToType(matchingChildren[0].attrRef); RHS_Type = ATD.LHS_Type; a.typeInfo = ATD; node.attrRef = a; // Error type if problem with assignment if (IsAssignable(ATD.LHS_Type, node, ref RHS_Type) == false) { Error(String.Format("Warning! Cannot assign {0} to {1}", RHS_Type, ATD.LHS_Type)); node.attrRef.typeInfo = new ErrorTypeDescriptor(); } ATD.RHS_Type = RHS_Type; }
protected void VisitNode(AssignmentExpr node) { Utilities.CodeGenVisitAllChildren(node, this); }