/** * Converts a String name of a type into an IType. * * @param typeString the type name to parse * @return the parsed type * @throws IllegalArgumentException if the type string doesn't correspond to any known IType */ public static IType parseType( String typeString ) throws IllegalArgumentException { return CommonServices.getTypeSystem().parseType(typeString); }
public static void pushTypeLoader( IModule module, ITypeLoader loader ) { CommonServices.getTypeSystem().pushTypeLoader(module, loader); } public static void removeTypeLoader( Class<? extends ITypeLoader> loader )
public static void popSymTableCtx() { CommonServices.getTypeSystem().popSymTableCtx(); } public static ISymbolTable getSymTableCtx()
public static IType parseType( String typeString, TypeVarToTypeMap actualParamByVarName ) throws IllegalArgumentException { return CommonServices.getTypeSystem().parseType(typeString, actualParamByVarName); } public static IType parseType( String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap ) throws IllegalArgumentException
public static IErrorType getErrorType() { return CommonServices.getTypeSystem().getErrorType(); } public static IErrorType getErrorType( String strErrantName )
/** * Refresh just the specified type i.e., a gosu editor calls this on changes */ public static void refresh(ITypeRef typeRef) { CommonServices.getTypeSystem().refresh(typeRef); }
/** * Returns all type names in the system for all type loaders. * @return all type names in the system. */ public static Set<? extends CharSequence> getAllTypeNames() { return CommonServices.getTypeSystem().getAllTypeNames(); }
public static IFunctionType getOrCreateFunctionType( IMethodInfo mi ) { return CommonServices.getTypeSystem().getOrCreateFunctionType(mi); } public static IFunctionType getOrCreateFunctionType( String strFunctionName, IType retType, IType[] paramTypes )
public static void inferTypeVariableTypesFromGenParamTypeAndConcreteType( IType genParamType, IType argType, TypeVarToTypeMap map, boolean bReverse ) { if( bReverse ) { CommonServices.getTypeSystem().inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse( genParamType, argType, map ); } else { CommonServices.getTypeSystem().inferTypeVariableTypesFromGenParamTypeAndConcreteType( genParamType, argType, map ); } }
public static void pushIncludeAll() { CommonServices.getTypeSystem().pushIncludeAll(); } public static void popIncludeAll()
public static IErrorType getErrorType( String strErrantName ) { return CommonServices.getTypeSystem().getErrorType( strErrantName ); } public static IErrorType getErrorType( ParseResultsException pe )
public static void pushSymTableCtx( ISymbolTable ctx ) { CommonServices.getTypeSystem().pushSymTableCtx(ctx); } public static void popSymTableCtx()
protected void createStandardTypeLoaders() { CommonServices.getTypeSystem().pushTypeLoader( this, new GosuClassTypeLoader( this, _fileRepository ) ); if( ILanguageLevel.Util.STANDARD_GOSU() ) { CommonServices.getTypeSystem().pushTypeLoader( this, new PropertiesTypeLoader( this ) ); } if( ILanguageLevel.Util.DYNAMIC_TYPE() ) { CommonServices.getTypeSystem().pushTypeLoader( this, new DynamicTypeLoader( this ) ); } }
public static IType get(Class javaClass, IModule module) { TypeSystem.pushModule(module); try { return CommonServices.getTypeSystem().get( javaClass ); } finally { TypeSystem.popModule(module); } }
public static void shutdown(IExecutionEnvironment execEnv) { try { TypeSystem.pushModule( execEnv.getGlobalModule() ); CommonServices.getTypeSystem().shutdown(); } finally { // TypeSystem.popModule( execEnv.getGlobalModule()); } }
public static IType getByFullName( String fullyQualifiedName, IModule module ) { TypeSystem.pushModule(module); try { return CommonServices.getTypeSystem().getByFullName(fullyQualifiedName); } finally { TypeSystem.popModule(module); } }
public static IType getFromObject( Object object, IModule module) { pushModule(module); try { return CommonServices.getTypeSystem().getFromObject(object); } finally { popModule(module); } }
@Override protected void createStandardTypeLoaders() { CommonServices.getTypeSystem().pushTypeLoader( this, new GosuClassTypeLoader( this, getFileRepository( ) ) ); if( ILanguageLevel.Util.DYNAMIC_TYPE() ) { CommonServices.getTypeSystem().pushTypeLoader( this, new DynamicTypeLoader( this ) ); } if( ILanguageLevel.Util.STANDARD_GOSU() ) { CommonServices.getTypeSystem().pushTypeLoader( this, new PropertiesTypeLoader( this ) ); } createGlobalTypeloaders( ); }
@Override protected void createStandardTypeLoaders() { FileSystemGosuClassRepository repository = new FileSystemGosuClassRepository(this); CommonServices.getTypeSystem().pushTypeLoader(this, new GosuClassTypeLoader(this, repository)); createGlobalTypeloaders(); }
private IGosuProgramInternal makeProgramClass( ISymbolTable symTable, StringSourceFileHandle sfh ) { IModule module = TypeSystem.getCurrentModule(); module = module == null ? TypeSystem.getGlobalModule() : module; GosuClassTypeLoader defaultClassLoader = CommonServices.getTypeSystem().getTypeLoader( GosuClassTypeLoader.class, module ); //GosuClassTypeLoader defaultClassLoader = GosuClassTypeLoader.getDefaultClassLoader(); return (IGosuProgramInternal) defaultClassLoader.makeNewClass(sfh, symTable); }