public virtual CompilerTypeInformation getCompilerTypeInformation(Type type) { CompilerTypeInformation compilerTypeInformation = compilerTypeInformations[type]; if (compilerTypeInformation == null) { compilerTypeInformation = defaultCompilerTypeInformation; } return(compilerTypeInformation); }
public CompilerTypeManager() { compilerTypeInformations = new Dictionary <Type, CompilerTypeInformation>(); defaultCompilerTypeInformation = new CompilerTypeInformation(null, null, "%s"); addCompilerTypeInformation(typeof(int), new CompilerTypeInformation(Type.getInternalName(typeof(Integer)), "(I)V", "0x%X")); addCompilerTypeInformation(typeof(bool), new CompilerTypeInformation(Type.getInternalName(typeof(bool)), "(Z)V", "%b")); addCompilerTypeInformation(typeof(long), new CompilerTypeInformation(Type.getInternalName(typeof(Long)), "(J)V", "0x%X")); addCompilerTypeInformation(typeof(short), new CompilerTypeInformation(Type.getInternalName(typeof(Short)), "(S)V", "0x%X")); addCompilerTypeInformation(typeof(float), new CompilerTypeInformation(Type.getInternalName(typeof(Float)), "(F)V", "%f")); addCompilerTypeInformation(typeof(string), new CompilerTypeInformation(null, null, "'%s'")); }
private void addCompilerTypeInformation(Type type, CompilerTypeInformation compilerTypeInformation) { compilerTypeInformations[type] = compilerTypeInformation; }