1 26 27 package org.objectweb.openccm.pss.generator.common.lib; 28 29 import org.objectweb.openccm.ast.api.TypeKind; 31 import org.objectweb.openccm.ast.api.DeclarationKind; 32 import org.objectweb.openccm.ast.api.PsdlTypeRef; 33 34 35 42 43 public class PSDLTools 44 { 45 46 52 58 61 62 public PSDLTools() 63 { 64 } 65 66 72 78 85 public static boolean 86 isAbstractStorageType(PsdlTypeRef type) 87 { 88 org.objectweb.openccm.ast.api.StorageTypeBase st_base = null; 89 90 st_base = type.getStorageTypeBase(); 91 if ( (st_base != null) 92 && (st_base.getDeclKind() == DeclarationKind.dk_abstract_storage_type) ) 93 { 94 return true; 95 } 96 return false; 97 } 98 99 106 public static boolean 107 isImmutable(PsdlTypeRef type) 108 { 109 org.objectweb.openccm.ast.api.TypeRef idl_type = null; 110 111 idl_type = type.getTypeRef(); 112 if (idl_type != null) 113 { 114 TypeKind tk = idl_type.getTypeKind(); 115 116 if ( (tk == TypeKind.tk_null) 117 || (tk == TypeKind.tk_void) 118 || (tk == TypeKind.tk_short) 119 || (tk == TypeKind.tk_ushort) 120 || (tk == TypeKind.tk_long) 121 || (tk == TypeKind.tk_ulong) 122 || (tk == TypeKind.tk_longlong) 123 || (tk == TypeKind.tk_ulonglong) 124 || (tk == TypeKind.tk_float) 125 || (tk == TypeKind.tk_double) 126 || (tk == TypeKind.tk_longdouble) 127 || (tk == TypeKind.tk_boolean) 128 || (tk == TypeKind.tk_char) 129 || (tk == TypeKind.tk_wchar) 130 || (tk == TypeKind.tk_octet) 131 || (tk == TypeKind.tk_string) 132 || (tk == TypeKind.tk_wstring) 133 || (tk == TypeKind.tk_fixed) ) 134 { 135 return true; 136 } 137 } 138 return false; 139 } 140 141 148 public static boolean 149 isAbstractStorageTypeReference(PsdlTypeRef type) 150 { 151 org.objectweb.openccm.ast.api.StorageTypeBase st_base = null; 152 153 st_base = type.getStorageTypeBase(); 154 if ( type.isRef() && 155 (st_base.getDeclKind() == DeclarationKind.dk_abstract_storage_type) 156 ) 157 return true; 158 return false; 159 } 160 } 161 | Popular Tags |