public NVTypeNode DoSemanticChecks(ErrorHandler errs, Scope currentScope, NVTypeNode currentType) { currentType = ResolveNamedTypeNodes(errs, currentScope, currentType); // Check to see if the current node is an empty placeholder selector if (_id.Name == "") { return currentType; } if (currentType == null) { //TODO: Uncomment this when support for objects passed through the property bag is much better //AddSemanticError(errs, "Type of identifier unknown", _pos, ErrorSeverity.Warning); return null; } if (!(currentType is NVClassNode)) { AddSemanticError(errs, string.Format( "Cannot apply identifier selector to type '{0}', the type must be a class type", currentType.Name), _pos, ErrorSeverity.Warning); return currentType; } // Check if the member exists _id = ((NVClassNode)currentType).FindMember(errs, _pos, _id.Name); if (_id == null) { return currentType; } _id.Type = ResolveNamedTypeNodes(errs, currentScope, _id.Type); _type = _id.Type; return _type; }
public NVTypeNode DoSemanticChecks(ErrorHandler errs, Scope currentScope, NVTypeNode currentType) { currentType = ResolveNamedTypeNodes(errs, currentScope, currentType); // Check to see if the current node is an empty placeholder selector if (_id.Name == "") { return(currentType); } if (currentType == null) { //TODO: Uncomment this when support for objects passed through the property bag is much better //AddSemanticError(errs, "Type of identifier unknown", _pos, ErrorSeverity.Warning); return(null); } if (!(currentType is NVClassNode)) { AddSemanticError(errs, string.Format( "Cannot apply identifier selector to type '{0}', the type must be a class type", currentType.Name), _pos, ErrorSeverity.Warning); return(currentType); } // Check if the member exists _id = ((NVClassNode)currentType).FindMember(errs, _pos, _id.Name); if (_id == null) { return(currentType); } _id.Type = ResolveNamedTypeNodes(errs, currentScope, _id.Type); _type = _id.Type; return(_type); }
public NVTypeNode ResolveNamedTypeNodes(ErrorHandler errs, Scope currentScope, NVTypeNode type) { if (type is NVNamedTypeNode) { NVIdNode newType = currentScope.Find(type.Name); if (newType != null) { return (NVTypeNode)newType; } AddSemanticError(errs, string.Format("The type name '{0}' could not be found", type.Name), _pos, ErrorSeverity.Warning); } return type; }
public NVTypeNode ResolveNamedTypeNodes(ErrorHandler errs, Scope currentScope, NVTypeNode type) { if (type is NVNamedTypeNode) { NVIdNode newType = currentScope.Find(type.Name); if (newType != null) { return((NVTypeNode)newType); } AddSemanticError(errs, string.Format("The type name '{0}' could not be found", type.Name), _pos, ErrorSeverity.Warning); } return(type); }
public NVMethodNode(/*Attribute att,*/ string name, NVTypeNode returnType /*, List<ParNode> parameters*/) : base(name) { _type = returnType; }
public NVMethodNode(/*Attribute att,*/ string name, NVTypeNode returnType/*, List<ParNode> parameters*/) : base(name) { _type = returnType; }