/// <summary> /// Creates new TypeValue from given ClassDecl /// </summary> /// <param name="declaration">Class declaration</param> /// <returns>new TypeValue</returns> public TypeValue CreateType(ClassDecl declaration) { var type = new TypeValue(declaration); _statistics.Report(Statistic.CreatedTypeValues); return(type); }
/// <inheritdoc /> public virtual void VisitNativeTypeValue(TypeValue value) { VisitTypeValue(value); }
/// <summary> /// Resolves all possible methods for given methodName /// NOTE: /// Multiple declarations for single functionName can happen for example because of branch merging /// </summary> /// <param name="methodName">Name of resolved method</param> /// <param name="selfType">Type where static method is resolved</param> /// <returns>Resolved methods</returns> protected abstract IEnumerable <FunctionValue> resolveStaticMethod(TypeValue selfType, QualifiedName methodName);
/// <summary> /// Resolve methods with given name for possible value /// </summary> /// <param name="value">Type of the object</param> /// <param name="methodName">Name of resolved methods</param> /// <param name="objectMethods">Methods available for thisObject</param> /// <returns>Resolved methods</returns> public abstract IEnumerable <FunctionValue> ResolveMethods(TypeValue value, QualifiedName methodName, IEnumerable <FunctionValue> objectMethods);
/// <summary> /// Initialize object of given type /// </summary> /// <param name="createdObject">Created object that has to be initialized</param> /// <param name="type">Desired type of initialized object</param> protected abstract void initializeObject(ObjectValue createdObject, TypeValue type);
/// <summary> /// Declare given type into global context /// </summary> /// <param name="declaration">Declared type</param> protected abstract void declareGlobal(TypeValue declaration);
/// <inheritdoc /> public IEnumerable <FunctionValue> ResolveStaticMethod(TypeValue type, QualifiedName methodName) { return(resolveStaticMethod(type, methodName)); }
/// <inheritdoc /> public void DeclareGlobal(TypeValue type) { _statistics.Report(Statistic.DeclaredTypes); declareGlobal(type); }