Changeset 2aa064d78a2c1162da70e2413b7c386278a1473d
- Timestamp:
- 06/28/09 23:36:51 (9 months ago)
- git-author:
- mb0 <mb0@mb0.org> / 2009-06-15T21:28:28Z+0200
- Parents:
- b32f7a496c511e07158f0d0752addedc2b378328
- Children:
- 5c182b6e475d5851c54cdb2117f25af21723b62a
- git-committer:
- mb0 <mb0@mb0.org> / 2009-06-28T23:36:51Z+0200
- Files:
-
- 1 added
- 1 removed
- 28 modified
-
org.axdt.as3/src/org/axdt/as3/imp/builders/AS3Builder.java (modified) (4 diffs)
-
org.axdt.as3/src/org/axdt/as3/imp/parser/ResolvingVisitor.java (modified) (10 diffs)
-
org.axdt.as3/src/org/axdt/as3/util/AS3Util.java (modified) (1 diff)
-
org.axdt.axdoc.model/model/AXDoc.ecore (modified) (4 diffs)
-
org.axdt.axdoc.model/model/AXDocXML.xsd (modified) (3 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXDocPackage.java (modified) (7 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXEntryType.java (modified) (7 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXIndexNode.java (modified) (1 diff)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXMember.java (modified) (2 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXMemberHolder.java (modified) (1 diff)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXType.java (modified) (2 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXDocPackageImpl.java (modified) (7 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXEntryImpl.java (modified) (4 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXIndexImpl.java (modified) (1 diff)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXIndexNodeImpl.java (modified) (1 diff)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXMemberImpl.java (modified) (11 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXTypeImpl.java (modified) (9 diffs)
-
org.axdt.axdoc.model/src/org/axdt/axdoc/model/util/AXUtil.java (modified) (2 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/AXDocRegularTest.java (modified) (1 diff)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXEntryTest.java (modified) (2 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXIndexNodeTest.java (modified) (4 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXIndexTest.java (modified) (3 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXRootTest.java (modified) (1 diff)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/coffeetime/ASDocFormatTest.java (modified) (2 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/util/AXDocParserTest.java (deleted)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/model/util/AXDocUtilTest.java (modified) (2 diffs)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/util/AXDocParserTest.java (added)
-
org.axdt.axdoc.test/src/org/axdt/axdoc/util/Index0rTest.java (modified) (1 diff)
-
org.axdt.axdoc/src/org/axdt/axdoc/util/AXDocParser.java (modified) (2 diffs)
-
org.axdt.axdoc/src/org/axdt/axdoc/util/Index0r.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
org.axdt.as3/src/org/axdt/as3/imp/builders/AS3Builder.java
r364575f r2aa064d 3 3 import java.util.ArrayList; 4 4 import java.util.Arrays; 5 import java.util.HashMap;6 5 import java.util.List; 7 6 import java.util.Map; … … 42 41 public static final String PROBLEM_MARKER_ID = AS3Plugin.PLUGIN_ID + ".imp.builder.problem"; 43 42 public static final Language LANGUAGE = LanguageRegistry.findLanguage(AS3Plugin.LANGUAGE); 44 private HashMap<IPath, AS3ParseController> files;45 43 private boolean isFullBuild = false; 46 44 private List<AS3ParseController> astnodes; … … 48 46 public AS3Builder() { 49 47 super(); 50 files = new HashMap<IPath, AS3ParseController>();51 48 } 52 49 … … 174 171 @SuppressWarnings("unchecked") 175 172 private AS3ParseController getParseController(IFile file) { 176 IPath path = file.getFullPath(); 177 AS3ParseController controller = files.get(path); 178 if (controller == null) { 179 controller = new AS3ParseController(); 180 IAnnotationTypeInfo typeInfo = controller.getAnnotationTypeInfo(); 181 List<List<String>> lists = Arrays.asList(typeInfo.getProblemMarkerTypes()); 182 boolean found = false; 183 for (List<String> list:lists) { 184 if (list.contains(getErrorMarkerID())) { 185 found = true; 186 break; 187 } 188 } 189 if (!found) typeInfo.addProblemMarkerType(getErrorMarkerID()); 190 MarkerCreator marker = new MarkerCreator(file, controller, PROBLEM_MARKER_ID); 191 IPath relativePath = file.getProjectRelativePath(); 192 try { 193 ISourceProject sourceProject = ModelFactory.open(file.getProject()); 194 controller.initialize(relativePath, sourceProject, marker); 195 files.put(relativePath, controller); 196 } catch (ModelException e) { 197 getPlugin().logException("Cannot create parse controller", e); 198 } 173 AS3ParseController controller = new AS3ParseController(); 174 IAnnotationTypeInfo typeInfo = controller.getAnnotationTypeInfo(); 175 List<List<String>> lists = Arrays.asList(typeInfo.getProblemMarkerTypes()); 176 boolean found = false; 177 for (List<String> list:lists) { 178 if (list.contains(getErrorMarkerID())) { 179 found = true; 180 break; 181 } 182 } 183 if (!found) typeInfo.addProblemMarkerType(getErrorMarkerID()); 184 MarkerCreator marker = new MarkerCreator(file, controller, PROBLEM_MARKER_ID); 185 IPath relativePath = file.getProjectRelativePath(); 186 try { 187 ISourceProject sourceProject = ModelFactory.open(file.getProject()); 188 controller.initialize(relativePath, sourceProject, marker); 189 } catch (ModelException e) { 190 getPlugin().logException("Cannot create parse controller", e); 199 191 } 200 192 return controller; -
org.axdt.as3/src/org/axdt/as3/imp/parser/ResolvingVisitor.java
r25b5d22 r2aa064d 1 1 package org.axdt.as3.imp.parser; 2 2 3 import java.util.ArrayList; 4 import java.util.Arrays; 5 3 6 import lpg.runtime.IAst; 4 7 5 8 import org.axdt.as3.AS3Plugin; 9 import org.axdt.as3.imp.parser.Ast.ASTNode; 6 10 import org.axdt.as3.imp.parser.Ast.AssignmentExpression; 7 11 import org.axdt.as3.imp.parser.Ast.Block; 8 12 import org.axdt.as3.imp.parser.Ast.ClassDefinition; 9 13 import org.axdt.as3.imp.parser.Ast.ExpressionStatement; 14 import org.axdt.as3.imp.parser.Ast.ExtendsList; 10 15 import org.axdt.as3.imp.parser.Ast.FunctionDefinition; 11 16 import org.axdt.as3.imp.parser.Ast.FunctionExpression; 12 17 import org.axdt.as3.imp.parser.Ast.IName; 18 import org.axdt.as3.imp.parser.Ast.IPostfixExpression; 19 import org.axdt.as3.imp.parser.Ast.ITypeExpression_allowin; 20 import org.axdt.as3.imp.parser.Ast.ITypeExpression_noin; 21 import org.axdt.as3.imp.parser.Ast.Ident; 13 22 import org.axdt.as3.imp.parser.Ast.ImportDirective; 23 import org.axdt.as3.imp.parser.Ast.Inheritance; 14 24 import org.axdt.as3.imp.parser.Ast.InterfaceDefinition; 15 25 import org.axdt.as3.imp.parser.Ast.Name; 16 26 import org.axdt.as3.imp.parser.Ast.PackageDefinition; 27 import org.axdt.as3.imp.parser.Ast.ResultType; 28 import org.axdt.as3.imp.parser.Ast.TypeExpressionList; 29 import org.axdt.as3.imp.parser.Ast.TypedIdentifier; 17 30 import org.axdt.as3.imp.parser.Ast.VariableBinding; 18 31 import org.axdt.as3.util.AS3Util; 32 import org.axdt.axdoc.model.AXEntry; 19 33 import org.axdt.axdoc.model.AXIndex; 20 import org.axdt.axdoc.model.AX IndexNode;34 import org.axdt.axdoc.model.AXRoot; 21 35 import org.axdt.axdoc.util.Index0r; 22 36 import org.axdt.common.preferences.AxdtPreferences; … … 25 39 private Index0r index0r; 26 40 private boolean addDebugErrors; 41 private ArrayList<AXIndex> importedPackages; 42 private ArrayList<AXEntry> importedTypes; 43 private String expectedPackageName; 27 44 28 45 public ResolvingVisitor(AS3ParseController parseController) { … … 30 47 addDebugErrors = AS3Plugin.getDefault() != null && AxdtPreferences.doDebug(); 31 48 index0r = Index0r.getInstance(); 32 } 33 49 expectedPackageName = AS3Util.getExpectedPackageName(getFile()); 50 resetImportCache(); 51 } 52 protected void resetImportCache() { 53 importedPackages = new ArrayList<AXIndex>(); 54 importedTypes = new ArrayList<AXEntry>(); 55 for (AXRoot root:index0r.getRoots()) { 56 // if has toplevel entries 57 if (root.getEntries().size() > 0) { 58 // add as default import 59 importedPackages.add(root); 60 } 61 } 62 AXIndex[] sameIndexes = index0r.findPackage(expectedPackageName); 63 for (AXIndex index:sameIndexes) { 64 importedPackages.add(index); 65 } 66 } 67 protected AXEntry resolveType(String name) { 68 for (AXEntry entry:importedTypes) { 69 if (entry.getName().equals(name)) 70 return entry; 71 } 72 for (AXIndex index:importedPackages) { 73 for (AXEntry entry:index.getTypes()) { 74 if (entry.getName().equals(name)) { 75 return entry; 76 } 77 } 78 } 79 return null; 80 } 81 protected String resolveType(ITypeExpression_noin type) { 82 return type instanceof ASTNode ? resolveNode((ASTNode) type) : null; 83 } 84 protected String resolveType(ITypeExpression_allowin type) { 85 return type instanceof ASTNode ? resolveNode((ASTNode) type) : null; 86 } 87 protected String resolveType(IPostfixExpression type) { 88 return type instanceof ASTNode ? resolveNode((ASTNode) type) : null; 89 } 90 protected String resolveNode(ASTNode type) { 91 if (type == null) 92 return null; 93 String typeName = type.toString(); 94 AXEntry entry = resolveType(typeName); 95 if (entry == null) { 96 if (!typeName.equals("*")) 97 emitError((ASTNode)type, "could not resolve type"); 98 return null; 99 } 100 String id = entry.getId(); 101 if (type instanceof Ident) { 102 ((Ident)type).setDeclaration(id); 103 } else if (addDebugErrors) { 104 emitError((ASTNode)type, "todo: not expected other than ident"); 105 } 106 return id; 107 } 108 protected void resolveTypes(TypeExpressionList list) { 109 if (list != null) { 110 for (int i=0; i < list.size();i++) { 111 ITypeExpression_allowin superInterface = list.getTypeExpression_allowinAt(i); 112 resolveNode((ASTNode)superInterface); 113 } 114 } 115 } 34 116 @Override 35 117 public boolean visit(Block n) { … … 39 121 @Override 40 122 public boolean visit(PackageDefinition n) { 41 String packageName = AS3Util.getExpectedPackageName(getFile()); 123 String packageName = AS3Util.getExpectedPackageName(getFile()); 124 // is not inside a valid source path 125 if (packageName == null) { 126 emitError(n, "file should be inside a configured source path"); 127 return false; 128 } 42 129 // check if name corresponds with folder names 43 130 if (n.getName() != null) { … … 56 143 emitError(n.getLeftIToken(), "package name sould be: "+ packageName); 57 144 } 58 // TODO check if split[0] is a valid source path 59 return true; 145 return true; 146 } 147 @Override 148 public void endVisit(PackageDefinition n) { 149 resetImportCache(); 60 150 } 61 151 @Override … … 69 159 if (findPackage.length>=1) { 70 160 foundDeclaration = true; 161 importedPackages.addAll(Arrays.asList(findPackage)); 71 162 name.getIdent().setDeclaration(findPackage[0].getId()); 72 163 } else if (addDebugErrors) { … … 78 169 } 79 170 } else { 80 AX IndexNode[] findMember = index0r.findMember(name.getQualifier().toString(), name.getIdent().toString());171 AXEntry[] findMember = index0r.findMember(name.getQualifier().toString(), name.getIdent().toString()); 81 172 if (findMember.length>=1) { 82 173 foundDeclaration = true; 174 importedTypes.addAll(Arrays.asList(findMember)); 83 175 name.getIdent().setDeclaration(findMember[0].getId()); 84 176 } else if (addDebugErrors) { … … 101 193 return true; 102 194 } 103 195 @Override 196 public boolean visit(Inheritance n) { 197 ClassDefinition parent = (ClassDefinition) n.getParent(); 198 ITypeExpression_allowin superClass = n.getExtends(); 199 resolveType(superClass); 200 resolveTypes(n.getImplements()); 201 return false; 202 } 104 203 @Override 105 204 public boolean visit(InterfaceDefinition n) { … … 108 207 checkPackageDirectiveName(name); 109 208 return true; 209 } 210 @Override 211 public boolean visit(ExtendsList n) { 212 InterfaceDefinition parent = (InterfaceDefinition) n.getParent(); 213 resolveTypes(n.getExtends()); 214 return false; 110 215 } 111 216 private void checkTypeName(Name name) { … … 128 233 } 129 234 } 130 131 @Override 132 public boolean visit(FunctionDefinition n) { 133 return false; 134 } 135 136 @Override 137 public boolean visit(FunctionExpression n) { 138 return false; 139 } 140 141 @Override 142 public boolean visit(VariableBinding n) { 143 return false; 144 } 145 @Override 146 public boolean visit(AssignmentExpression n) { 147 return false; 148 } 149 @Override 150 public boolean visit(ExpressionStatement n) { 151 return false; 152 } 235 236 public boolean visit(TypedIdentifier n) { 237 if (n != null) 238 resolveNode(n.getType()); 239 return false; 240 } 241 public boolean visit(ResultType n) { 242 if (n != null) 243 resolveType(n.getType()); 244 return false; 245 } 246 153 247 } -
org.axdt.as3/src/org/axdt/as3/util/AS3Util.java
r69d1ca8 r2aa064d 55 55 } 56 56 } 57 return "";57 return null; 58 58 } 59 59 } -
org.axdt.axdoc.model/model/AXDoc.ecore
r2d81bf0 r2aa064d 13 13 eSuperTypes="#//AXNode"> 14 14 <eStructuralFeatures xsi:type="ecore:EReference" name="members" upperBound="-1" 15 eType="#//AXMember" containment="true" resolveProxies="false" eKeys="#//AXNode/name #//AXMember/function"/>15 eType="#//AXMember" containment="true" resolveProxies="false" eKeys="#//AXNode/name"/> 16 16 </eClassifiers> 17 17 <eClassifiers xsi:type="ecore:EClass" name="AXPackage" eSuperTypes="#//AXMemberHolder"> … … 20 20 </eClassifiers> 21 21 <eClassifiers xsi:type="ecore:EClass" name="AXType" eSuperTypes="#//AXMemberHolder"> 22 <eStructuralFeatures xsi:type="ecore:EAttribute" name=" interface" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>22 <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//AXEntryType"/> 23 23 </eClassifiers> 24 24 <eClassifiers xsi:type="ecore:EClass" name="AXMember" eSuperTypes="#//AXNode"> 25 <eStructuralFeatures xsi:type="ecore:EAttribute" name="var" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" 26 defaultValueLiteral="true"/> 27 <eStructuralFeatures xsi:type="ecore:EAttribute" name="function" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> 28 <eStructuralFeatures xsi:type="ecore:EAttribute" name="const" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> 29 <eStructuralFeatures xsi:type="ecore:EAttribute" name="static" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> 30 <eStructuralFeatures xsi:type="ecore:EAttribute" name="protected" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> 25 <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//AXEntryType"/> 31 26 </eClassifiers> 32 27 <eClassifiers xsi:type="ecore:EEnum" name="AXLevel"> … … 94 89 <eOperations name="getOrCreateReference" eType="#//AXNode"/> 95 90 <eOperations name="getReference" eType="#//AXNode"/> 91 <eOperations name="getAllEntries" upperBound="-1" eType="#//AXEntry"/> 92 <eOperations name="getAllTypes" upperBound="-1" eType="#//AXEntry"/> 93 <eOperations name="getAllMembers" upperBound="-1" eType="#//AXEntry"/> 94 <eOperations name="localMember" eType="#//AXEntry"> 95 <eParameters name="part" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> 96 </eOperations> 97 <eOperations name="localType" eType="#//AXEntry"> 98 <eParameters name="part" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> 99 </eOperations> 100 <eOperations name="getMembers" upperBound="-1" eType="#//AXEntry"/> 101 <eOperations name="getTypes" upperBound="-1" eType="#//AXEntry"/> 96 102 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> 97 103 <eStructuralFeatures xsi:type="ecore:EReference" name="entries" upperBound="-1" … … 110 116 <eLiterals name="METHOD" value="4" literal="m"/> 111 117 <eLiterals name="PROPERTY" value="5" literal="p"/> 112 <eLiterals name="EVENT" value="6" literal="e"/> 118 <eLiterals name="CONSTANT" value="6" literal="cp"/> 119 <eLiterals name="EVENT" value="7" literal="e"/> 113 120 </eClassifiers> 114 121 </ecore:EPackage> -
org.axdt.axdoc.model/model/AXDocXML.xsd
r2d81bf0 r2aa064d 24 24 <xsd:enumeration value="METHOD"/> 25 25 <xsd:enumeration value="PROPERTY"/> 26 <xsd:enumeration value="CONSTANT"/> 26 27 <xsd:enumeration value="EVENT"/> 27 28 </xsd:restriction> … … 55 56 <xsd:complexContent> 56 57 <xsd:extension base="axdoc:AXMemberHolder"> 57 <xsd:attribute name=" interface" type="xsd:boolean"/>58 <xsd:attribute name="type" type="axdoc:AXEntryType"/> 58 59 </xsd:extension> 59 60 </xsd:complexContent> … … 63 64 <xsd:complexContent> 64 65 <xsd:extension base="axdoc:AXNode"> 65 <xsd:attribute default="true" name="var" type="xsd:boolean"/> 66 <xsd:attribute name="function" type="xsd:boolean"/> 67 <xsd:attribute name="const" type="xsd:boolean"/> 68 <xsd:attribute name="static" type="xsd:boolean"/> 69 <xsd:attribute name="protected" type="xsd:boolean"/> 66 <xsd:attribute name="type" type="axdoc:AXEntryType"/> 70 67 </xsd:extension> 71 68 </xsd:complexContent> -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXDocPackage.java
r2d81bf0 r2aa064d 237 237 238 238 /** 239 * The feature id for the '<em><b> Interface</b></em>' attribute.240 * <!-- begin-user-doc --> 241 * <!-- end-user-doc --> 242 * @generated 243 * @ordered 244 */ 245 int AX_TYPE__ INTERFACE = AX_MEMBER_HOLDER_FEATURE_COUNT + 0;239 * The feature id for the '<em><b>Type</b></em>' attribute. 240 * <!-- begin-user-doc --> 241 * <!-- end-user-doc --> 242 * @generated 243 * @ordered 244 */ 245 int AX_TYPE__TYPE = AX_MEMBER_HOLDER_FEATURE_COUNT + 0; 246 246 247 247 /** … … 283 283 284 284 /** 285 * The feature id for the '<em><b>Var</b></em>' attribute. 286 * <!-- begin-user-doc --> 287 * <!-- end-user-doc --> 288 * @generated 289 * @ordered 290 */ 291 int AX_MEMBER__VAR = AX_NODE_FEATURE_COUNT + 0; 292 293 /** 294 * The feature id for the '<em><b>Function</b></em>' attribute. 295 * <!-- begin-user-doc --> 296 * <!-- end-user-doc --> 297 * @generated 298 * @ordered 299 */ 300 int AX_MEMBER__FUNCTION = AX_NODE_FEATURE_COUNT + 1; 301 302 /** 303 * The feature id for the '<em><b>Const</b></em>' attribute. 304 * <!-- begin-user-doc --> 305 * <!-- end-user-doc --> 306 * @generated 307 * @ordered 308 */ 309 int AX_MEMBER__CONST = AX_NODE_FEATURE_COUNT + 2; 310 311 /** 312 * The feature id for the '<em><b>Static</b></em>' attribute. 313 * <!-- begin-user-doc --> 314 * <!-- end-user-doc --> 315 * @generated 316 * @ordered 317 */ 318 int AX_MEMBER__STATIC = AX_NODE_FEATURE_COUNT + 3; 319 320 /** 321 * The feature id for the '<em><b>Protected</b></em>' attribute. 322 * <!-- begin-user-doc --> 323 * <!-- end-user-doc --> 324 * @generated 325 * @ordered 326 */ 327 int AX_MEMBER__PROTECTED = AX_NODE_FEATURE_COUNT + 4; 285 * The feature id for the '<em><b>Type</b></em>' attribute. 286 * <!-- begin-user-doc --> 287 * <!-- end-user-doc --> 288 * @generated 289 * @ordered 290 */ 291 int AX_MEMBER__TYPE = AX_NODE_FEATURE_COUNT + 0; 328 292 329 293 /** … … 334 298 * @ordered 335 299 */ 336 int AX_MEMBER_FEATURE_COUNT = AX_NODE_FEATURE_COUNT + 5;300 int AX_MEMBER_FEATURE_COUNT = AX_NODE_FEATURE_COUNT + 1; 337 301 338 302 /** … … 785 749 786 750 /** 787 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXType# isInterface <em>Interface</em>}'.788 * <!-- begin-user-doc --> 789 * <!-- end-user-doc --> 790 * @return the meta object for the attribute '<em> Interface</em>'.791 * @see org.axdt.axdoc.model.AXType# isInterface()751 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXType#getType <em>Type</em>}'. 752 * <!-- begin-user-doc --> 753 * <!-- end-user-doc --> 754 * @return the meta object for the attribute '<em>Type</em>'. 755 * @see org.axdt.axdoc.model.AXType#getType() 792 756 * @see #getAXType() 793 757 * @generated 794 758 */ 795 EAttribute getAXType_ Interface();759 EAttribute getAXType_Type(); 796 760 797 761 /** … … 806 770 807 771 /** 808 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember# isVar <em>Var</em>}'.809 * <!-- begin-user-doc --> 810 * <!-- end-user-doc --> 811 * @return the meta object for the attribute '<em> Var</em>'.812 * @see org.axdt.axdoc.model.AXMember# isVar()772 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember#getType <em>Type</em>}'. 773 * <!-- begin-user-doc --> 774 * <!-- end-user-doc --> 775 * @return the meta object for the attribute '<em>Type</em>'. 776 * @see org.axdt.axdoc.model.AXMember#getType() 813 777 * @see #getAXMember() 814 778 * @generated 815 779 */ 816 EAttribute getAXMember_Var(); 817 818 /** 819 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember#isFunction <em>Function</em>}'. 820 * <!-- begin-user-doc --> 821 * <!-- end-user-doc --> 822 * @return the meta object for the attribute '<em>Function</em>'. 823 * @see org.axdt.axdoc.model.AXMember#isFunction() 824 * @see #getAXMember() 825 * @generated 826 */ 827 EAttribute getAXMember_Function(); 828 829 /** 830 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember#isConst <em>Const</em>}'. 831 * <!-- begin-user-doc --> 832 * <!-- end-user-doc --> 833 * @return the meta object for the attribute '<em>Const</em>'. 834 * @see org.axdt.axdoc.model.AXMember#isConst() 835 * @see #getAXMember() 836 * @generated 837 */ 838 EAttribute getAXMember_Const(); 839 840 /** 841 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember#isStatic <em>Static</em>}'. 842 * <!-- begin-user-doc --> 843 * <!-- end-user-doc --> 844 * @return the meta object for the attribute '<em>Static</em>'. 845 * @see org.axdt.axdoc.model.AXMember#isStatic() 846 * @see #getAXMember() 847 * @generated 848 */ 849 EAttribute getAXMember_Static(); 850 851 /** 852 * Returns the meta object for the attribute '{@link org.axdt.axdoc.model.AXMember#isProtected <em>Protected</em>}'. 853 * <!-- begin-user-doc --> 854 * <!-- end-user-doc --> 855 * @return the meta object for the attribute '<em>Protected</em>'. 856 * @see org.axdt.axdoc.model.AXMember#isProtected() 857 * @see #getAXMember() 858 * @generated 859 */ 860 EAttribute getAXMember_Protected(); 780 EAttribute getAXMember_Type(); 861 781 862 782 /** … … 1193 1113 1194 1114 /** 1195 * The meta object literal for the '<em><b> Interface</b></em>' attribute feature.1196 * <!-- begin-user-doc --> 1197 * <!-- end-user-doc --> 1198 * @generated 1199 */ 1200 EAttribute AX_TYPE__ INTERFACE = eINSTANCE.getAXType_Interface();1115 * The meta object literal for the '<em><b>Type</b></em>' attribute feature. 1116 * <!-- begin-user-doc --> 1117 * <!-- end-user-doc --> 1118 * @generated 1119 */ 1120 EAttribute AX_TYPE__TYPE = eINSTANCE.getAXType_Type(); 1201 1121 1202 1122 /** … … 1211 1131 1212 1132 /** 1213 * The meta object literal for the '<em><b>Var</b></em>' attribute feature. 1214 * <!-- begin-user-doc --> 1215 * <!-- end-user-doc --> 1216 * @generated 1217 */ 1218 EAttribute AX_MEMBER__VAR = eINSTANCE.getAXMember_Var(); 1219 1220 /** 1221 * The meta object literal for the '<em><b>Function</b></em>' attribute feature. 1222 * <!-- begin-user-doc --> 1223 * <!-- end-user-doc --> 1224 * @generated 1225 */ 1226 EAttribute AX_MEMBER__FUNCTION = eINSTANCE.getAXMember_Function(); 1227 1228 /** 1229 * The meta object literal for the '<em><b>Const</b></em>' attribute feature. 1230 * <!-- begin-user-doc --> 1231 * <!-- end-user-doc --> 1232 * @generated 1233 */ 1234 EAttribute AX_MEMBER__CONST = eINSTANCE.getAXMember_Const(); 1235 1236 /** 1237 * The meta object literal for the '<em><b>Static</b></em>' attribute feature. 1238 * <!-- begin-user-doc --> 1239 * <!-- end-user-doc --> 1240 * @generated 1241 */ 1242 EAttribute AX_MEMBER__STATIC = eINSTANCE.getAXMember_Static(); 1243 1244 /** 1245 * The meta object literal for the '<em><b>Protected</b></em>' attribute feature. 1246 * <!-- begin-user-doc --> 1247 * <!-- end-user-doc --> 1248 * @generated 1249 */ 1250 EAttribute AX_MEMBER__PROTECTED = eINSTANCE.getAXMember_Protected(); 1133 * The meta object literal for the '<em><b>Type</b></em>' attribute feature. 1134 * <!-- begin-user-doc --> 1135 * <!-- end-user-doc --> 1136 * @generated 1137 */ 1138 EAttribute AX_MEMBER__TYPE = eINSTANCE.getAXMember_Type(); 1251 1139 1252 1140 /** -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXEntryType.java
r79dd699 r2aa064d 84 84 85 85 /** 86 * The '<em><b>CONSTANT</b></em>' literal object. 87 * <!-- begin-user-doc --> 88 * <!-- end-user-doc --> 89 * @see #CONSTANT_VALUE 90 * @generated 91 * @ordered 92 */ 93 CONSTANT(6, "CONSTANT", "cp"), /** 86 94 * The '<em><b>EVENT</b></em>' literal object. 87 95 * <!-- begin-user-doc --> … … 91 99 * @ordered 92 100 */ 93 EVENT( 6, "EVENT", "e");101 EVENT(7, "EVENT", "e"); 94 102 95 103 /** … … 184 192 185 193 /** 194 * The '<em><b>CONSTANT</b></em>' literal value. 195 * <!-- begin-user-doc --> 196 * <p> 197 * If the meaning of '<em><b>CONSTANT</b></em>' literal object isn't clear, 198 * there really should be more of a description here... 199 * </p> 200 * <!-- end-user-doc --> 201 * @see #CONSTANT 202 * @model literal="cp" 203 * @generated 204 * @ordered 205 */ 206 public static final int CONSTANT_VALUE = 6; 207 208 /** 186 209 * The '<em><b>EVENT</b></em>' literal value. 187 210 * <!-- begin-user-doc --> … … 196 219 * @ordered 197 220 */ 198 public static final int EVENT_VALUE = 6;221 public static final int EVENT_VALUE = 7; 199 222 200 223 /** … … 205 228 */ 206 229 private static final AXEntryType[] VALUES_ARRAY = new AXEntryType[] { NONE, 207 CLASS, INTERFACE, CONSTRUCTOR, METHOD, PROPERTY, EVENT, };230 CLASS, INTERFACE, CONSTRUCTOR, METHOD, PROPERTY, CONSTANT, EVENT, }; 208 231 209 232 /** … … 268 291 case PROPERTY_VALUE: 269 292 return PROPERTY; 293 case CONSTANT_VALUE: 294 return CONSTANT; 270 295 case EVENT_VALUE: 271 296 return EVENT; … … 350 375 351 376 public boolean isMember() { 352 return value == METHOD_VALUE || value == PROPERTY_VALUE 353 || value == CONSTRUCTOR_VALUE; 377 return !isType(); 378 } 379 380 public boolean isFunction() { 381 return value == METHOD_VALUE || value == CONSTANT_VALUE; 354 382 } 355 383 -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXIndexNode.java
r2d81bf0 r2aa064d 160 160 AXNode getReference(); 161 161 162 /** 163 * <!-- begin-user-doc --> 164 * <!-- end-user-doc --> 165 * @model kind="operation" 166 * @generated 167 */ 168 EList<AXEntry> getAllEntries(); 169 170 /** 171 * <!-- begin-user-doc --> 172 * <!-- end-user-doc --> 173 * @model kind="operation" 174 * @generated 175 */ 176 EList<AXEntry> getAllTypes(); 177 178 /** 179 * <!-- begin-user-doc --> 180 * <!-- end-user-doc --> 181 * @model kind="operation" 182 * @generated 183 */ 184 EList<AXEntry> getAllMembers(); 185 186 /** 187 * <!-- begin-user-doc --> 188 * <!-- end-user-doc --> 189 * @model 190 * @generated 191 */ 192 AXEntry localMember(String part); 193 194 /** 195 * <!-- begin-user-doc --> 196 * <!-- end-user-doc --> 197 * @model 198 * @generated 199 */ 200 AXEntry localType(String part); 201 202 /** 203 * <!-- begin-user-doc --> 204 * <!-- end-user-doc --> 205 * @model kind="operation" 206 * @generated 207 */ 208 EList<AXEntry> getMembers(); 209 210 /** 211 * <!-- begin-user-doc --> 212 * <!-- end-user-doc --> 213 * @model kind="operation" 214 * @generated 215 */ 216 EList<AXEntry> getTypes(); 217 162 218 } // AXIndexNode -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXMember.java
r79dd699 r2aa064d 15 15 * The following features are supported: 16 16 * <ul> 17 * <li>{@link org.axdt.axdoc.model.AXMember#isVar <em>Var</em>}</li> 18 * <li>{@link org.axdt.axdoc.model.AXMember#isFunction <em>Function</em>}</li> 19 * <li>{@link org.axdt.axdoc.model.AXMember#isConst <em>Const</em>}</li> 20 * <li>{@link org.axdt.axdoc.model.AXMember#isStatic <em>Static</em>}</li> 21 * <li>{@link org.axdt.axdoc.model.AXMember#isProtected <em>Protected</em>}</li> 17 * <li>{@link org.axdt.axdoc.model.AXMember#getType <em>Type</em>}</li> 22 18 * </ul> 23 19 * </p> … … 30 26 31 27 /** 32 * Returns the value of the '<em><b> Var</b></em>' attribute.33 * The default value is <code>"true"</code>.28 * Returns the value of the '<em><b>Type</b></em>' attribute. 29 * The literals are from the enumeration {@link org.axdt.axdoc.model.AXEntryType}. 34 30 * <!-- begin-user-doc --> 35 31 * <p> 36 * If the meaning of the '<em> Var</em>' attribute isn't clear,32 * If the meaning of the '<em>Type</em>' attribute isn't clear, 37 33 * there really should be more of a description here... 38 34 * </p> 39 35 * <!-- end-user-doc --> 40 * @return the value of the '<em>Var</em>' attribute. 41 * @see #setVar(boolean) 42 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Var() 43 * @model default="true" 44 * @generated 45 */ 46 boolean isVar(); 47 48 /** 49 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember#isVar <em>Var</em>}' attribute. 50 * <!-- begin-user-doc --> 51 * <!-- end-user-doc --> 52 * @param value the new value of the '<em>Var</em>' attribute. 53 * @see #isVar() 54 * @generated 55 */ 56 void setVar(boolean value); 57 58 /** 59 * Returns the value of the '<em><b>Function</b></em>' attribute. 60 * <!-- begin-user-doc --> 61 * <p> 62 * If the meaning of the '<em>Function</em>' attribute isn't clear, 63 * there really should be more of a description here... 64 * </p> 65 * <!-- end-user-doc --> 66 * @return the value of the '<em>Function</em>' attribute. 67 * @see #setFunction(boolean) 68 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Function() 36 * @return the value of the '<em>Type</em>' attribute. 37 * @see org.axdt.axdoc.model.AXEntryType 38 * @see #setType(AXEntryType) 39 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Type() 69 40 * @model 70 41 * @generated 71 42 */ 72 boolean isFunction();43 AXEntryType getType(); 73 44 74 45 /** 75 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember# isFunction <em>Function</em>}' attribute.46 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember#getType <em>Type</em>}' attribute. 76 47 * <!-- begin-user-doc --> 77 48 * <!-- end-user-doc --> 78 * @param value the new value of the '<em>Function</em>' attribute. 79 * @see #isFunction() 49 * @param value the new value of the '<em>Type</em>' attribute. 50 * @see org.axdt.axdoc.model.AXEntryType 51 * @see #getType() 80 52 * @generated 81 53 */ 82 void setFunction(boolean value); 83 84 /** 85 * Returns the value of the '<em><b>Const</b></em>' attribute. 86 * <!-- begin-user-doc --> 87 * <p> 88 * If the meaning of the '<em>Const</em>' attribute isn't clear, 89 * there really should be more of a description here... 90 * </p> 91 * <!-- end-user-doc --> 92 * @return the value of the '<em>Const</em>' attribute. 93 * @see #setConst(boolean) 94 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Const() 95 * @model 96 * @generated 97 */ 98 boolean isConst(); 99 100 /** 101 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember#isConst <em>Const</em>}' attribute. 102 * <!-- begin-user-doc --> 103 * <!-- end-user-doc --> 104 * @param value the new value of the '<em>Const</em>' attribute. 105 * @see #isConst() 106 * @generated 107 */ 108 void setConst(boolean value); 109 110 /** 111 * Returns the value of the '<em><b>Static</b></em>' attribute. 112 * <!-- begin-user-doc --> 113 * <p> 114 * If the meaning of the '<em>Static</em>' attribute isn't clear, 115 * there really should be more of a description here... 116 * </p> 117 * <!-- end-user-doc --> 118 * @return the value of the '<em>Static</em>' attribute. 119 * @see #setStatic(boolean) 120 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Static() 121 * @model 122 * @generated 123 */ 124 boolean isStatic(); 125 126 /** 127 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember#isStatic <em>Static</em>}' attribute. 128 * <!-- begin-user-doc --> 129 * <!-- end-user-doc --> 130 * @param value the new value of the '<em>Static</em>' attribute. 131 * @see #isStatic() 132 * @generated 133 */ 134 void setStatic(boolean value); 135 136 /** 137 * Returns the value of the '<em><b>Protected</b></em>' attribute. 138 * <!-- begin-user-doc --> 139 * <p> 140 * If the meaning of the '<em>Protected</em>' attribute isn't clear, 141 * there really should be more of a description here... 142 * </p> 143 * <!-- end-user-doc --> 144 * @return the value of the '<em>Protected</em>' attribute. 145 * @see #setProtected(boolean) 146 * @see org.axdt.axdoc.model.AXDocPackage#getAXMember_Protected() 147 * @model 148 * @generated 149 */ 150 boolean isProtected(); 151 152 /** 153 * Sets the value of the '{@link org.axdt.axdoc.model.AXMember#isProtected <em>Protected</em>}' attribute. 154 * <!-- begin-user-doc --> 155 * <!-- end-user-doc --> 156 * @param value the new value of the '<em>Protected</em>' attribute. 157 * @see #isProtected() 158 * @generated 159 */ 160 void setProtected(boolean value); 54 void setType(AXEntryType value); 161 55 } // AXMember -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXMemberHolder.java
r79dd699 r2aa064d 37 37 * @return the value of the '<em>Members</em>' containment reference list. 38 38 * @see org.axdt.axdoc.model.AXDocPackage#getAXMemberHolder_Members() 39 * @model containment="true" keys="name function"39 * @model containment="true" keys="name" 40 40 * @generated 41 41 */ -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/AXType.java
r79dd699 r2aa064d 15 15 * The following features are supported: 16 16 * <ul> 17 * <li>{@link org.axdt.axdoc.model.AXType# isInterface <em>Interface</em>}</li>17 * <li>{@link org.axdt.axdoc.model.AXType#getType <em>Type</em>}</li> 18 18 * </ul> 19 19 * </p> … … 25 25 public interface AXType extends AXMemberHolder { 26 26 /** 27 * Returns the value of the '<em><b>Interface</b></em>' attribute. 27 * Returns the value of the '<em><b>Type</b></em>' attribute. 28 * The literals are from the enumeration {@link org.axdt.axdoc.model.AXEntryType}. 28 29 * <!-- begin-user-doc --> 29 30 * <p> 30 * If the meaning of the '<em> Interface</em>' attribute isn't clear,31 * If the meaning of the '<em>Type</em>' attribute isn't clear, 31 32 * there really should be more of a description here... 32 33 * </p> 33 34 * <!-- end-user-doc --> 34 * @return the value of the '<em>Interface</em>' attribute. 35 * @see #setInterface(boolean) 36 * @see org.axdt.axdoc.model.AXDocPackage#getAXType_Interface() 35 * @return the value of the '<em>Type</em>' attribute. 36 * @see org.axdt.axdoc.model.AXEntryType 37 * @see #setType(AXEntryType) 38 * @see org.axdt.axdoc.model.AXDocPackage#getAXType_Type() 37 39 * @model 38 40 * @generated 39 41 */ 40 boolean isInterface();42 AXEntryType getType(); 41 43 42 44 /** 43 * Sets the value of the '{@link org.axdt.axdoc.model.AXType# isInterface <em>Interface</em>}' attribute.45 * Sets the value of the '{@link org.axdt.axdoc.model.AXType#getType <em>Type</em>}' attribute. 44 46 * <!-- begin-user-doc --> 45 47 * <!-- end-user-doc --> 46 * @param value the new value of the '<em>Interface</em>' attribute. 47 * @see #isInterface() 48 * @param value the new value of the '<em>Type</em>' attribute. 49 * @see org.axdt.axdoc.model.AXEntryType 50 * @see #getType() 48 51 * @generated 49 52 */ 50 void set Interface(booleanvalue);53 void setType(AXEntryType value); 51 54 52 55 } // AXType -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXDocPackageImpl.java
r2d81bf0 r2aa064d 252 252 * @generated 253 253 */ 254 public EAttribute getAXType_ Interface() {254 public EAttribute getAXType_Type() { 255 255 return (EAttribute) axTypeEClass.getEStructuralFeatures().get(0); 256 256 } … … 270 270 * @generated 271 271 */ 272 public EAttribute getAXMember_ Var() {272 public EAttribute getAXMember_Type() { 273 273 return (EAttribute) axMemberEClass.getEStructuralFeatures().get(0); 274 }275 276 /**277 * <!-- begin-user-doc -->278 * <!-- end-user-doc -->279 * @generated280 */281 public EAttribute getAXMember_Function() {282 return (EAttribute) axMemberEClass.getEStructuralFeatures().get(1);283 }284 285 /**286 * <!-- begin-user-doc -->287 * <!-- end-user-doc -->288 * @generated289 */290 public EAttribute getAXMember_Const() {291 return (EAttribute) axMemberEClass.getEStructuralFeatures().get(2);292 }293 294 /**295 * <!-- begin-user-doc -->296 * <!-- end-user-doc -->297 * @generated298 */299 public EAttribute getAXMember_Static() {300 return (EAttribute) axMemberEClass.getEStructuralFeatures().get(3);301 }302 303 /**304 * <!-- begin-user-doc -->305 * <!-- end-user-doc -->306 * @generated307 */308 public EAttribute getAXMember_Protected() {309 return (EAttribute) axMemberEClass.getEStructuralFeatures().get(4);310 274 } 311 275 … … 567 531 568 532 axTypeEClass = createEClass(AX_TYPE); 569 createEAttribute(axTypeEClass, AX_TYPE__ INTERFACE);533 createEAttribute(axTypeEClass, AX_TYPE__TYPE); 570 534 571 535 axMemberEClass = createEClass(AX_MEMBER); 572 createEAttribute(axMemberEClass, AX_MEMBER__VAR); 573 createEAttribute(axMemberEClass, AX_MEMBER__FUNCTION); 574 createEAttribute(axMemberEClass, AX_MEMBER__CONST); 575 createEAttribute(axMemberEClass, AX_MEMBER__STATIC); 576 createEAttribute(axMemberEClass, AX_MEMBER__PROTECTED); 536 createEAttribute(axMemberEClass, AX_MEMBER__TYPE); 577 537 578 538 axIndexEClass = createEClass(AX_INDEX); … … 662 622 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 663 623 getAXMemberHolder_Members().getEKeys().add(this.getAXNode_Name()); 664 getAXMemberHolder_Members().getEKeys().add(this.getAXMember_Function());665 624 666 625 initEClass(axPackageEClass, AXPackage.class, "AXPackage", !IS_ABSTRACT, … … 674 633 initEClass(axTypeEClass, AXType.class, "AXType", !IS_ABSTRACT, 675 634 !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 676 initEAttribute(getAXType_Interface(), ecorePackage.getEBoolean(), 677 "interface", null, 0, 1, AXType.class, !IS_TRANSIENT, 678 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, 679 !IS_DERIVED, IS_ORDERED); 635 initEAttribute(getAXType_Type(), this.getAXEntryType(), "type", null, 636 0, 1, AXType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, 637 !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 680 638 681 639 initEClass(axMemberEClass, AXMember.class, "AXMember", !IS_ABSTRACT, 682 640 !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 683 initEAttribute(getAXMember_ Var(), ecorePackage.getEBoolean(), "var",684 "true",0, 1, AXMember.class, !IS_TRANSIENT, !IS_VOLATILE,641 initEAttribute(getAXMember_Type(), this.getAXEntryType(), "type", null, 642 0, 1, AXMember.class, !IS_TRANSIENT, !IS_VOLATILE, 685 643 IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, 686 644 IS_ORDERED); 687 initEAttribute(getAXMember_Function(), ecorePackage.getEBoolean(),688 "function", null, 0, 1, AXMember.class, !IS_TRANSIENT,689 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,690 !IS_DERIVED, IS_ORDERED);691 initEAttribute(getAXMember_Const(), ecorePackage.getEBoolean(),692 "const", null, 0, 1, AXMember.class, !IS_TRANSIENT,693 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,694 !IS_DERIVED, IS_ORDERED);695 initEAttribute(getAXMember_Static(), ecorePackage.getEBoolean(),696 "static", null, 0, 1, AXMember.class, !IS_TRANSIENT,697 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,698 !IS_DERIVED, IS_ORDERED);699 initEAttribute(getAXMember_Protected(), ecorePackage.getEBoolean(),700 "protected", null, 0, 1, AXMember.class, !IS_TRANSIENT,701 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,702 !IS_DERIVED, IS_ORDERED);703 645 704 646 initEClass(axIndexEClass, AXIndex.class, "AXIndex", !IS_ABSTRACT, … … 833 775 1, IS_UNIQUE, IS_ORDERED); 834 776 777 addEOperation(axIndexNodeEClass, this.getAXEntry(), "getAllEntries", 0, 778 -1, IS_UNIQUE, IS_ORDERED); 779 780 addEOperation(axIndexNodeEClass, this.getAXEntry(), "getAllTypes", 0, 781 -1, IS_UNIQUE, IS_ORDERED); 782 783 addEOperation(axIndexNodeEClass, this.getAXEntry(), "getAllMembers", 0, 784 -1, IS_UNIQUE, IS_ORDERED); 785 786 op = addEOperation(axIndexNodeEClass, this.getAXEntry(), "localMember", 787 0, 1, IS_UNIQUE, IS_ORDERED); 788 addEParameter(op, ecorePackage.getEString(), "part", 0, 1, IS_UNIQUE, 789 IS_ORDERED); 790 791 op = addEOperation(axIndexNodeEClass, this.getAXEntry(), "localType", 792 0, 1, IS_UNIQUE, IS_ORDERED); 793 addEParameter(op, ecorePackage.getEString(), "part", 0, 1, IS_UNIQUE, 794 IS_ORDERED); 795 796 addEOperation(axIndexNodeEClass, this.getAXEntry(), "getMembers", 0, 797 -1, IS_UNIQUE, IS_ORDERED); 798 799 addEOperation(axIndexNodeEClass, this.getAXEntry(), "getTypes", 0, -1, 800 IS_UNIQUE, IS_ORDERED); 801 835 802 // Initialize enums and add enum literals 836 803 initEEnum(axLevelEEnum, AXLevel.class, "AXLevel"); … … 852 819 addEEnumLiteral(axEntryTypeEEnum, AXEntryType.METHOD); 853 820 addEEnumLiteral(axEntryTypeEEnum, AXEntryType.PROPERTY); 821 addEEnumLiteral(axEntryTypeEEnum, AXEntryType.CONSTANT); 854 822 addEEnumLiteral(axEntryTypeEEnum, AXEntryType.EVENT); 855 823 -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXEntryImpl.java
r25b5d22 r2aa064d 401 401 return null; 402 402 String url = name; 403 if (type != null && type.isFunction()) { 404 url += "()"; 405 } 403 406 AXIndexNode parent = getParent(); 404 if (getRoot() != null && AXRootType.SOURCE.equals(getRoot().getRootType())) { 407 if (getRoot() != null 408 && AXRootType.SOURCE.equals(getRoot().getRootType())) { 405 409 url += ".as"; 406 410 } else if (getType().isType()) { … … 427 431 */ 428 432 public String getId() { 429 if (id == null && name != null) { 433 if (this.id != null) return this.id; 434 if (name != null) { 430 435 AXIndexNode parent = getParent(); 431 if (parent == null ||parent instanceof AXRoot) {432 id = name;436 if (parent == null && parent instanceof AXRoot) { 437 id = "::"+name +"#"+ getType(); 433 438 } else { 434 439 id = parent.getId(); 435 440 id += parent instanceof AXIndex ? "::" : "."; 436 id += name ;441 id += name +"#"+ getType(); 437 442 } 438 443 } … … 475 480 result = AXDocFactory.eINSTANCE.createAXMember(); 476 481 result.setName(getName()); 477 if (getType().equals(AXEntryType.METHOD)) 478 result.setFunction(true); 479 else if (getType().equals(AXEntryType.CONSTRUCTOR)) 480 result.setConst(true); 481 else if (getType().equals(AXEntryType.PROPERTY)) 482 result.setVar(true); 482 result.setType(getType()); 483 483 holder.getMembers().add(result); 484 484 } … … 501 501 result = AXDocFactory.eINSTANCE.createAXType(); 502 502 result.setName(getName()); 503 if (getType().equals(AXEntryType.INTERFACE)) { 504 result.setInterface(true); 505 } 503 result.setType(getType()); 506 504 pack.getTypes().add(result); 507 505 } -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXIndexImpl.java
r2d81bf0 r2aa064d 295 295 result.setName(part); 296 296 result.setParent(this); 297 } 298 return result; 299 } 300 301 protected EList<AXEntry> collectAllEntries(EList<AXEntry> result, 302 boolean filterTypes, boolean filterMembers) { 303 super.collectAllEntries(result, filterTypes, filterMembers); 304 for (AXIndex index : getIndexes()) { 305 if (index instanceof AXIndexImpl) { 306 ((AXIndexImpl) index).collectAllEntries(result, filterTypes, 307 filterMembers); 308 } 297 309 } 298 310 return result; -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXIndexNodeImpl.java
r2d81bf0 r2aa064d 264 264 * <!-- begin-user-doc --> 265 265 * <!-- end-user-doc --> 266 */ 267 public EList<AXEntry> getAllEntries() { 268 BasicEList<AXEntry> result = new BasicEList<AXEntry>(); 269 return collectAllEntries(result, false, false); 270 } 271 272 /** 273 * <!-- begin-user-doc --> 274 * <!-- end-user-doc --> 275 */ 276 public EList<AXEntry> getAllTypes() { 277 BasicEList<AXEntry> result = new BasicEList<AXEntry>(); 278 return collectAllEntries(result, false, true); 279 } 280 281 /** 282 * <!-- begin-user-doc --> 283 * <!-- end-user-doc --> 284 */ 285 public EList<AXEntry> getAllMembers() { 286 BasicEList<AXEntry> result = new BasicEList<AXEntry>(); 287 return collectAllEntries(result, true, false); 288 } 289 290 /** 291 * <!-- begin-user-doc --> 292 * <!-- end-user-doc --> 293 */ 294 public AXEntry localMember(String part) { 295 return localEntry(part, true); 296 } 297 298 /** 299 * <!-- begin-user-doc --> 300 * <!-- end-user-doc --> 301 */ 302 public AXEntry localType(String part) { 303 return localEntry(part, false); 304 } 305 306 /** 307 * <!-- begin-user-doc --> 308 * <!-- end-user-doc --> 309 */ 310 public EList<AXEntry> getMembers() { 311 BasicEList<AXEntry> result = new BasicEList<AXEntry>(); 312 return collectEntries(result, true, false); 313 } 314 315 /** 316 * <!-- begin-user-doc --> 317 * <!-- end-user-doc --> 318 */ 319 public EList<AXEntry> getTypes() { 320 BasicEList<AXEntry> result = new BasicEList<AXEntry>(); 321 return collectEntries(result, false, true); 322 } 323 324 protected EList<AXEntry> collectAllEntries(EList<AXEntry> result, 325 boolean filterTypes, boolean filterMembers) { 326 this.collectEntries(result, filterTypes, filterMembers); 327 for (AXEntry entry : getEntries()) { 328 if (entry instanceof AXIndexNodeImpl) 329 ((AXIndexNodeImpl) entry).collectAllEntries(result, 330 filterTypes, filterMembers); 331 } 332 return result; 333 } 334 335 protected EList<AXEntry> collectEntries(EList<AXEntry> result, 336 boolean filterTypes, boolean filterMembers) { 337 for (AXEntry entry : getEntries()) { 338 AXEntryType entryType = entry.getType(); 339 // include entries with undisclosed entry type 340 if (entryType != null) { 341 if (filterTypes && entryType.isType()) { 342 continue; 343 } 344 if (filterMembers && entryType.isMember()) { 345 continue; 346 } 347 } 348 result.add(entry); 349 } 350 return result; 351 } 352 353 /** 354 * <!-- begin-user-doc --> 355 * <!-- end-user-doc --> 266 356 * @generated 267 357 */ -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXMemberImpl.java
r79dd699 r2aa064d 10 10 11 11 import org.axdt.axdoc.model.AXDocPackage; 12 import org.axdt.axdoc.model.AXEntryType; 12 13 import org.axdt.axdoc.model.AXMember; 13 14 import org.eclipse.emf.common.notify.Notification; … … 22 23 * The following features are implemented: 23 24 * <ul> 24 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#isVar <em>Var</em>}</li> 25 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#isFunction <em>Function</em>}</li> 26 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#isConst <em>Const</em>}</li> 27 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#isStatic <em>Static</em>}</li> 28 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#isProtected <em>Protected</em>}</li> 25 * <li>{@link org.axdt.axdoc.model.impl.AXMemberImpl#getType <em>Type</em>}</li> 29 26 * </ul> 30 27 * </p> … … 34 31 public class AXMemberImpl extends AXNodeImpl implements AXMember { 35 32 /** 36 * The default value of the '{@link # isVar() <em>Var</em>}' attribute.33 * The default value of the '{@link #getType() <em>Type</em>}' attribute. 37 34 * <!-- begin-user-doc --> 38 35 * <!-- end-user-doc --> 39 * @see # isVar()36 * @see #getType() 40 37 * @generated 41 38 * @ordered 42 39 */ 43 protected static final boolean VAR_EDEFAULT = true;40 protected static final AXEntryType TYPE_EDEFAULT = AXEntryType.NONE; 44 41 /** 45 * The flag representing the value of the '{@link #isVar() <em>Var</em>}' attribute.42 * The cached value of the '{@link #getType() <em>Type</em>}' attribute. 46 43 * <!-- begin-user-doc --> 47 44 * <!-- end-user-doc --> 48 * @see # isVar()45 * @see #getType() 49 46 * @generated 50 47 * @ordered 51 48 */ 52 protected static final int VAR_EFLAG = 1 << 0; 53 /** 54 * The default value of the '{@link #isFunction() <em>Function</em>}' attribute. 55 * <!-- begin-user-doc --> 56 * <!-- end-user-doc --> 57 * @see #isFunction() 58 * @generated 59 * @ordered 60 */ 61 protected static final boolean FUNCTION_EDEFAULT = false; 62 /** 63 * The flag representing the value of the '{@link #isFunction() <em>Function</em>}' attribute. 64 * <!-- begin-user-doc --> 65 * <!-- end-user-doc --> 66 * @see #isFunction() 67 * @generated 68 * @ordered 69 */ 70 protected static final int FUNCTION_EFLAG = 1 << 1; 71 /** 72 * The default value of the '{@link #isConst() <em>Const</em>}' attribute. 73 * <!-- begin-user-doc --> 74 * <!-- end-user-doc --> 75 * @see #isConst() 76 * @generated 77 * @ordered 78 */ 79 protected static final boolean CONST_EDEFAULT = false; 80 /** 81 * The flag representing the value of the '{@link #isConst() <em>Const</em>}' attribute. 82 * <!-- begin-user-doc --> 83 * <!-- end-user-doc --> 84 * @see #isConst() 85 * @generated 86 * @ordered 87 */ 88 protected static final int CONST_EFLAG = 1 << 2; 89 /** 90 * The default value of the '{@link #isStatic() <em>Static</em>}' attribute. 91 * <!-- begin-user-doc --> 92 * <!-- end-user-doc --> 93 * @see #isStatic() 94 * @generated 95 * @ordered 96 */ 97 protected static final boolean STATIC_EDEFAULT = false; 98 /** 99 * The flag representing the value of the '{@link #isStatic() <em>Static</em>}' attribute. 100 * <!-- begin-user-doc --> 101 * <!-- end-user-doc --> 102 * @see #isStatic() 103 * @generated 104 * @ordered 105 */ 106 protected static final int STATIC_EFLAG = 1 << 3; 107 /** 108 * The default value of the '{@link #isProtected() <em>Protected</em>}' attribute. 109 * <!-- begin-user-doc --> 110 * <!-- end-user-doc --> 111 * @see #isProtected() 112 * @generated 113 * @ordered 114 */ 115 protected static final boolean PROTECTED_EDEFAULT = false; 116 /** 117 * The flag representing the value of the '{@link #isProtected() <em>Protected</em>}' attribute. 118 * <!-- begin-user-doc --> 119 * <!-- end-user-doc --> 120 * @see #isProtected() 121 * @generated 122 * @ordered 123 */ 124 protected static final int PROTECTED_EFLAG = 1 << 4; 49 protected AXEntryType type = TYPE_EDEFAULT; 125 50 126 51 /** … … 131 56 protected AXMemberImpl() { 132 57 super(); 133 flags |= VAR_EFLAG;134 58 } 135 59 … … 149 73 * @generated 150 74 */ 151 public boolean isVar() {152 return (flags & VAR_EFLAG) != 0;75 public AXEntryType getType() { 76 return type; 153 77 } 154 78 … … 158 82 * @generated 159 83 */ 160 public void setVar(boolean newVar) { 161 boolean oldVar = (flags & VAR_EFLAG) != 0; 162 if (newVar) 163 flags |= VAR_EFLAG; 164 else 165 flags &= ~VAR_EFLAG; 84 public void setType(AXEntryType newType) { 85 AXEntryType oldType = type; 86 type = newType == null ? TYPE_EDEFAULT : newType; 166 87 if (eNotificationRequired()) 167 88 eNotify(new ENotificationImpl(this, Notification.SET, 168 AXDocPackage.AX_MEMBER__VAR, oldVar, newVar)); 169 } 170 171 /** 172 * <!-- begin-user-doc --> 173 * <!-- end-user-doc --> 174 * @generated 175 */ 176 public boolean isFunction() { 177 return (flags & FUNCTION_EFLAG) != 0; 178 } 179 180 /** 181 * <!-- begin-user-doc --> 182 * <!-- end-user-doc --> 183 * @generated 184 */ 185 public void setFunction(boolean newFunction) { 186 boolean oldFunction = (flags & FUNCTION_EFLAG) != 0; 187 if (newFunction) 188 flags |= FUNCTION_EFLAG; 189 else 190 flags &= ~FUNCTION_EFLAG; 191 if (eNotificationRequired()) 192 eNotify(new ENotificationImpl(this, Notification.SET, 193 AXDocPackage.AX_MEMBER__FUNCTION, oldFunction, newFunction)); 194 } 195 196 /** 197 * <!-- begin-user-doc --> 198 * <!-- end-user-doc --> 199 * @generated 200 */ 201 public boolean isConst() { 202 return (flags & CONST_EFLAG) != 0; 203 } 204 205 /** 206 * <!-- begin-user-doc --> 207 * <!-- end-user-doc --> 208 * @generated 209 */ 210 public void setConst(boolean newConst) { 211 boolean oldConst = (flags & CONST_EFLAG) != 0; 212 if (newConst) 213 flags |= CONST_EFLAG; 214 else 215 flags &= ~CONST_EFLAG; 216 if (eNotificationRequired()) 217 eNotify(new ENotificationImpl(this, Notification.SET, 218 AXDocPackage.AX_MEMBER__CONST, oldConst, newConst)); 219 } 220 221 /** 222 * <!-- begin-user-doc --> 223 * <!-- end-user-doc --> 224 * @generated 225 */ 226 public boolean isStatic() { 227 return (flags & STATIC_EFLAG) != 0; 228 } 229 230 /** 231 * <!-- begin-user-doc --> 232 * <!-- end-user-doc --> 233 * @generated 234 */ 235 public void setStatic(boolean newStatic) { 236 boolean oldStatic = (flags & STATIC_EFLAG) != 0; 237 if (newStatic) 238 flags |= STATIC_EFLAG; 239 else 240 flags &= ~STATIC_EFLAG; 241 if (eNotificationRequired()) 242 eNotify(new ENotificationImpl(this, Notification.SET, 243 AXDocPackage.AX_MEMBER__STATIC, oldStatic, newStatic)); 244 } 245 246 /** 247 * <!-- begin-user-doc --> 248 * <!-- end-user-doc --> 249 * @generated 250 */ 251 public boolean isProtected() { 252 return (flags & PROTECTED_EFLAG) != 0; 253 } 254 255 /** 256 * <!-- begin-user-doc --> 257 * <!-- end-user-doc --> 258 * @generated 259 */ 260 public void setProtected(boolean newProtected) { 261 boolean oldProtected = (flags & PROTECTED_EFLAG) != 0; 262 if (newProtected) 263 flags |= PROTECTED_EFLAG; 264 else 265 flags &= ~PROTECTED_EFLAG; 266 if (eNotificationRequired()) 267 eNotify(new ENotificationImpl(this, Notification.SET, 268 AXDocPackage.AX_MEMBER__PROTECTED, oldProtected, 269 newProtected)); 89 AXDocPackage.AX_MEMBER__TYPE, oldType, type)); 270 90 } 271 91 … … 282 102 case AXDocPackage.AX_MEMBER__ASDOC: 283 103 return getAsdoc(); 284 case AXDocPackage.AX_MEMBER__VAR: 285 return isVar() ? Boolean.TRUE : Boolean.FALSE; 286 case AXDocPackage.AX_MEMBER__FUNCTION: 287 return isFunction() ? Boolean.TRUE : Boolean.FALSE; 288 case AXDocPackage.AX_MEMBER__CONST: 289 return isConst() ? Boolean.TRUE : Boolean.FALSE; 290 case AXDocPackage.AX_MEMBER__STATIC: 291 return isStatic() ? Boolean.TRUE : Boolean.FALSE; 292 case AXDocPackage.AX_MEMBER__PROTECTED: 293 return isProtected() ? Boolean.TRUE : Boolean.FALSE; 104 case AXDocPackage.AX_MEMBER__TYPE: 105 return getType(); 294 106 } 295 107 return eDynamicGet(featureID, resolve, coreType); … … 312 124 getAsdoc().addAll((Collection<? extends String>) newValue); 313 125 return; 314 case AXDocPackage.AX_MEMBER__VAR: 315 setVar(((Boolean) newValue).booleanValue()); 316 return; 317 case AXDocPackage.AX_MEMBER__FUNCTION: 318 setFunction(((Boolean) newValue).booleanValue()); 319 return; 320 case AXDocPackage.AX_MEMBER__CONST: 321 setConst(((Boolean) newValue).booleanValue()); 322 return; 323 case AXDocPackage.AX_MEMBER__STATIC: 324 setStatic(((Boolean) newValue).booleanValue()); 325 return; 326 case AXDocPackage.AX_MEMBER__PROTECTED: 327 setProtected(((Boolean) newValue).booleanValue()); 126 case AXDocPackage.AX_MEMBER__TYPE: 127 setType((AXEntryType) newValue); 328 128 return; 329 129 } … … 345 145 getAsdoc().clear(); 346 146 return; 347 case AXDocPackage.AX_MEMBER__VAR: 348 setVar(VAR_EDEFAULT); 349 return; 350 case AXDocPackage.AX_MEMBER__FUNCTION: 351 setFunction(FUNCTION_EDEFAULT); 352 return; 353 case AXDocPackage.AX_MEMBER__CONST: 354 setConst(CONST_EDEFAULT); 355 return; 356 case AXDocPackage.AX_MEMBER__STATIC: 357 setStatic(STATIC_EDEFAULT); 358 return; 359 case AXDocPackage.AX_MEMBER__PROTECTED: 360 setProtected(PROTECTED_EDEFAULT); 147 case AXDocPackage.AX_MEMBER__TYPE: 148 setType(TYPE_EDEFAULT); 361 149 return; 362 150 } … … 377 165 case AXDocPackage.AX_MEMBER__ASDOC: 378 166 return asdoc != null && !asdoc.isEmpty(); 379 case AXDocPackage.AX_MEMBER__VAR: 380 return ((flags & VAR_EFLAG) != 0) != VAR_EDEFAULT; 381 case AXDocPackage.AX_MEMBER__FUNCTION: 382 return ((flags & FUNCTION_EFLAG) != 0) != FUNCTION_EDEFAULT; 383 case AXDocPackage.AX_MEMBER__CONST: 384 return ((flags & CONST_EFLAG) != 0) != CONST_EDEFAULT; 385 case AXDocPackage.AX_MEMBER__STATIC: 386 return ((flags & STATIC_EFLAG) != 0) != STATIC_EDEFAULT; 387 case AXDocPackage.AX_MEMBER__PROTECTED: 388 return ((flags & PROTECTED_EFLAG) != 0) != PROTECTED_EDEFAULT; 167 case AXDocPackage.AX_MEMBER__TYPE: 168 return type != TYPE_EDEFAULT; 389 169 } 390 170 return eDynamicIsSet(featureID); … … 402 182 403 183 StringBuffer result = new StringBuffer(super.toString()); 404 result.append(" (var: "); 405 result.append((flags & VAR_EFLAG) != 0); 406 result.append(", function: "); 407 result.append((flags & FUNCTION_EFLAG) != 0); 408 result.append(", const: "); 409 result.append((flags & CONST_EFLAG) != 0); 410 result.append(", static: "); 411 result.append((flags & STATIC_EFLAG) != 0); 412 result.append(", protected: "); 413 result.append((flags & PROTECTED_EFLAG) != 0); 184 result.append(" (type: "); 185 result.append(type); 414 186 result.append(')'); 415 187 return result.toString(); -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/impl/AXTypeImpl.java
r79dd699 r2aa064d 10 10 11 11 import org.axdt.axdoc.model.AXDocPackage; 12 import org.axdt.axdoc.model.AXEntryType; 12 13 import org.axdt.axdoc.model.AXMember; 13 14 import org.axdt.axdoc.model.AXType; … … 29 30 * <ul> 30 31 * <li>{@link org.axdt.axdoc.model.impl.AXTypeImpl#getMembers <em>Members</em>}</li> 31 * <li>{@link org.axdt.axdoc.model.impl.AXTypeImpl# isInterface <em>Interface</em>}</li>32 * <li>{@link org.axdt.axdoc.model.impl.AXTypeImpl#getType <em>Type</em>}</li> 32 33 * </ul> 33 34 * </p> … … 47 48 48 49 /** 49 * The default value of the '{@link # isInterface() <em>Interface</em>}' attribute.50 * <!-- begin-user-doc --> 51 * <!-- end-user-doc --> 52 * @see # isInterface()50 * The default value of the '{@link #getType() <em>Type</em>}' attribute. 51 * <!-- begin-user-doc --> 52 * <!-- end-user-doc --> 53 * @see #getType() 53 54 * @generated 54 55 * @ordered 55 56 */ 56 protected static final boolean INTERFACE_EDEFAULT = false;57 58 /** 59 * The flag representing the value of the '{@link #isInterface() <em>Interface</em>}' attribute.60 * <!-- begin-user-doc --> 61 * <!-- end-user-doc --> 62 * @see # isInterface()57 protected static final AXEntryType TYPE_EDEFAULT = AXEntryType.NONE; 58 59 /** 60 * The cached value of the '{@link #getType() <em>Type</em>}' attribute. 61 * <!-- begin-user-doc --> 62 * <!-- end-user-doc --> 63 * @see #getType() 63 64 * @generated 64 65 * @ordered 65 66 */ 66 protected static final int INTERFACE_EFLAG = 1 << 0;67 protected AXEntryType type = TYPE_EDEFAULT; 67 68 68 69 /** … … 103 104 * @generated 104 105 */ 105 public boolean isInterface() { 106 return (flags & INTERFACE_EFLAG) != 0; 107 } 108 109 /** 110 * <!-- begin-user-doc --> 111 * <!-- end-user-doc --> 112 * @generated 113 */ 114 public void setInterface(boolean newInterface) { 115 boolean oldInterface = (flags & INTERFACE_EFLAG) != 0; 116 if (newInterface) 117 flags |= INTERFACE_EFLAG; 118 else 119 flags &= ~INTERFACE_EFLAG; 106 public AXEntryType getType() { 107 return type; 108 } 109 110 /** 111 * <!-- begin-user-doc --> 112 * <!-- end-user-doc --> 113 * @generated 114 */ 115 public void setType(AXEntryType newType) { 116 AXEntryType oldType = type; 117 type = newType == null ? TYPE_EDEFAULT : newType; 120 118 if (eNotificationRequired()) 121 119 eNotify(new ENotificationImpl(this, Notification.SET, 122 AXDocPackage.AX_TYPE__ INTERFACE, oldInterface, newInterface));120 AXDocPackage.AX_TYPE__TYPE, oldType, type)); 123 121 } 124 122 … … 153 151 case AXDocPackage.AX_TYPE__MEMBERS: 154 152 return getMembers(); 155 case AXDocPackage.AX_TYPE__ INTERFACE:156 return isInterface() ? Boolean.TRUE : Boolean.FALSE;153 case AXDocPackage.AX_TYPE__TYPE: 154 return getType(); 157 155 } 158 156 return eDynamicGet(featureID, resolve, coreType); … … 179 177 getMembers().addAll((Collection<? extends AXMember>) newValue); 180 178 return; 181 case AXDocPackage.AX_TYPE__ INTERFACE:182 set Interface(((Boolean) newValue).booleanValue());179 case AXDocPackage.AX_TYPE__TYPE: 180 setType((AXEntryType) newValue); 183 181 return; 184 182 } … … 203 201 getMembers().clear(); 204 202 return; 205 case AXDocPackage.AX_TYPE__ INTERFACE:206 set Interface(INTERFACE_EDEFAULT);203 case AXDocPackage.AX_TYPE__TYPE: 204 setType(TYPE_EDEFAULT); 207 205 return; 208 206 } … … 225 223 case AXDocPackage.AX_TYPE__MEMBERS: 226 224 return members != null && !members.isEmpty(); 227 case AXDocPackage.AX_TYPE__ INTERFACE:228 return ((flags & INTERFACE_EFLAG) != 0) != INTERFACE_EDEFAULT;225 case AXDocPackage.AX_TYPE__TYPE: 226 return type != TYPE_EDEFAULT; 229 227 } 230 228 return eDynamicIsSet(featureID); … … 242 240 243 241 StringBuffer result = new StringBuffer(super.toString()); 244 result.append(" ( interface: ");245 result.append( (flags & INTERFACE_EFLAG) != 0);242 result.append(" (type: "); 243 result.append(type); 246 244 result.append(')'); 247 245 return result.toString(); -
org.axdt.axdoc.model/src/org/axdt/axdoc/model/util/AXUtil.java
r2d81bf0 r2aa064d 3 3 import java.io.ByteArrayInputStream; 4 4 import java.io.IOException; 5 import java.util.ArrayList;6 import java.util.List;7 5 8 6 import org.axdt.axdoc.model.AXDocFactory; 9 import org.axdt.axdoc.model.AXEntry;10 import org.axdt.axdoc.model.AXIndex;11 import org.axdt.axdoc.model.AXMember;12 7 import org.axdt.axdoc.model.AXRoot; 13 import org.axdt.axdoc.model.AXType;14 8 import org.eclipse.emf.common.util.URI; 15 9 import org.eclipse.emf.ecore.EObject; … … 61 55 return root; 62 56 } 63 public static AXIndex createPackage(AXRoot root, String name) {64 if (name == null || name.equals("")) return root;65 AXIndex current = root;66 main : for (String part : name.split("\\.")) {67 for (AXIndex pack : current.getIndexes()) {68 if (part.equals(pack.getName())) {69 current = pack;70 continue main;71 }72 }73 AXIndex child = factory.createAXIndex();74 child.setName(part);75 current.getIndexes().add(child);76 //getResource(child, child.fullName()+".axdoc.xml");77 current = child;78 }79 return current;80 }81 public static AXMember createMember(String name) {82 AXMember member = factory.createAXMember();83 if (name.contains("()")) {84 name = name.replace("()", "");85 member.setFunction(true);86 }87 member.setName(name);88 return member;89 }90 public static AXType createType(String typeName) {91 AXType type = factory.createAXType();92 type.setName(typeName);93 return type;94 }95 public static List<AXEntry> getAllTypes(AXIndex index) {96 ArrayList<AXEntry> allTypes = new ArrayList<AXEntry>();97 collectAllTypes(index, allTypes);98 return allTypes;99 }100 public static void collectAllTypes(AXIndex index, List<AXEntry> allTypes) {101 for (AXEntry e:index.getEntries()) {102 if (e.getType().isType()) allTypes.add(e);103 }104 for (AXIndex p:index.getIndexes()) {105 collectAllTypes(p, allTypes);106 }107 }108 57 } -
org.axdt.axdoc.test/src/org/axdt/axdoc/AXDocRegularTest.java
r87f02d1 r2aa064d 12 12 13 13 import org.axdt.axdoc.model.AXDocTests; 14 import org.axdt.axdoc.model.util.AXDocParserTest;15 14 import org.axdt.axdoc.model.util.AXDocUtilTest; 15 import org.axdt.axdoc.util.AXDocParserTest; 16 16 import org.axdt.axdoc.util.Index0rTest; 17 17 -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXEntryTest.java
r2d81bf0 r2aa064d 109 109 assertTrue(ref instanceof AXType); 110 110 AXType type = (AXType) ref; 111 assert False(type.isInterface());111 assertEquals(AXEntryType.CLASS,type.getType()); 112 112 assertEquals("Array", type.getName()); 113 113 assertSame(type, getFixture().getOrCreateReference()); … … 119 119 assertTrue(ref instanceof AXMember); 120 120 AXMember member = (AXMember) ref; 121 assert True(member.isFunction());121 assertEquals(AXEntryType.METHOD,member.getType()); 122 122 assertEquals("toString", member.getName()); 123 123 assertSame(member, entry.getOrCreateReference()); -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXIndexNodeTest.java
r2d81bf0 r2aa064d 10 10 11 11 import org.axdt.axdoc.model.util.AXUtil; 12 import org.eclipse.emf.common.util.EList; 12 13 13 14 /** … … 32 33 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getOrCreateReference() <em>Get Or Create Reference</em>}</li> 33 34 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getReference() <em>Get Reference</em>}</li> 35 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getAllEntries() <em>Get All Entries</em>}</li> 36 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getAllTypes() <em>Get All Types</em>}</li> 37 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getAllMembers() <em>Get All Members</em>}</li> 38 * <li>{@link org.axdt.axdoc.model.AXIndexNode#localMember(java.lang.String) <em>Local Member</em>}</li> 39 * <li>{@link org.axdt.axdoc.model.AXIndexNode#localType(java.lang.String) <em>Local Type</em>}</li> 40 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getMembers() <em>Get Members</em>}</li> 41 * <li>{@link org.axdt.axdoc.model.AXIndexNode#getTypes() <em>Get Types</em>}</li> 34 42 * </ul> 35 43 * </p> … … 190 198 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getOrCreateReference() <em>Get Or Create Reference</em>}' operation. 191 199 * <!-- begin-user-doc --> 200 * should be tested in concrete implementations 192 201 * <!-- end-user-doc --> 193 202 * @see org.axdt.axdoc.model.AXIndexNode#getOrCreateReference() 194 203 */ 195 public void testGetOrCreateReference() { 196 // should be tested in concrete implementations 197 } 204 public abstract void testGetOrCreateReference(); 198 205 199 206 /** … … 207 214 } 208 215 216 /** 217 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getAllEntries() <em>Get All Entries</em>}' operation. 218 * <!-- begin-user-doc --> 219 * <!-- end-user-doc --> 220 * @see org.axdt.axdoc.model.AXIndexNode#getAllEntries() 221 */ 222 public void testGetAllEntries() { 223 EList<AXEntry> list = getFixture().getAllEntries(); 224 assertNotNull(list); 225 assertEquals(0, list.size()); 226 AXEntry entry = getFixture().createEntry("test1", AXEntryType.METHOD); 227 getFixture().createEntry("test2", AXEntryType.PROPERTY); 228 assertEquals(2, getFixture().getAllEntries().size()); 229 AXEntry second = entry.createEntry("inner_test", AXEntryType.PROPERTY); 230 assertEquals(3, getFixture().getAllEntries().size()); 231 second.createEntry("third", AXEntryType.CLASS); 232 assertEquals(4, getFixture().getAllEntries().size()); 233 } 234 235 /** 236 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getAllTypes() <em>Get All Types</em>}' operation. 237 * <!-- begin-user-doc --> 238 * <!-- end-user-doc --> 239 * @see org.axdt.axdoc.model.AXIndexNode#getAllTypes() 240 */ 241 public void testGetAllTypes() { 242 AXEntry entry = getFixture().createEntry("class1", AXEntryType.CLASS); 243 getFixture().createEntry("interface1", AXEntryType.INTERFACE); 244 getFixture().createEntry("method1", AXEntryType.METHOD); 245 getFixture().createEntry("prop1", AXEntryType.PROPERTY); 246 assertEquals(4, getFixture().getAllEntries().size()); 247 assertEquals(2, getFixture().getAllTypes().size()); 248 AXEntry second = entry.createEntry("interface2", AXEntryType.INTERFACE); 249 assertEquals(3, getFixture().getAllTypes().size()); 250 second.createEntry("interface3", AXEntryType.INTERFACE); 251 assertEquals(4, getFixture().getAllTypes().size()); 252 } 253 254 /** 255 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getAllMembers() <em>Get All Members</em>}' operation. 256 * <!-- begin-user-doc --> 257 * <!-- end-user-doc --> 258 * @see org.axdt.axdoc.model.AXIndexNode#getAllMembers() 259 */ 260 public void testGetAllMembers() { 261 // TODO: implement this operation test method 262 } 263 264 /** 265 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#localMember(java.lang.String) <em>Local Member</em>}' operation. 266 * <!-- begin-user-doc --> 267 * <!-- end-user-doc --> 268 * @see org.axdt.axdoc.model.AXIndexNode#localMember(java.lang.String) 269 */ 270 public void testLocalMember__String() { 271 // TODO: implement this operation test method 272 } 273 274 /** 275 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#localType(java.lang.String) <em>Local Type</em>}' operation. 276 * <!-- begin-user-doc --> 277 * <!-- end-user-doc --> 278 * @see org.axdt.axdoc.model.AXIndexNode#localType(java.lang.String) 279 */ 280 public void testLocalType__String() { 281 // TODO: implement this operation test method 282 } 283 284 /** 285 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getMembers() <em>Get Members</em>}' operation. 286 * <!-- begin-user-doc --> 287 * <!-- end-user-doc --> 288 * @see org.axdt.axdoc.model.AXIndexNode#getMembers() 289 */ 290 public void testGetMembers() { 291 // TODO: implement this operation test method 292 } 293 294 /** 295 * Tests the '{@link org.axdt.axdoc.model.AXIndexNode#getTypes() <em>Get Types</em>}' operation. 296 * <!-- begin-user-doc --> 297 * <!-- end-user-doc --> 298 * @see org.axdt.axdoc.model.AXIndexNode#getTypes() 299 */ 300 public void testGetTypes() { 301 // TODO: implement this operation test method 302 } 303 209 304 } //AXIndexNodeTest -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXIndexTest.java
r2d81bf0 r2aa064d 138 138 139 139 AXEntry packMember = AXDocFactory.eINSTANCE.createAXEntry(); 140 packMember.setName("method ()");140 packMember.setName("method"); 141 141 packMember.setType(AXEntryType.METHOD); 142 142 packMember.setParent(getFixture()); … … 150 150 151 151 AXEntry typeMember = AXDocFactory.eINSTANCE.createAXEntry(); 152 typeMember.setName("method ()");152 typeMember.setName("method"); 153 153 typeMember.setType(AXEntryType.METHOD); 154 154 typeMember.setParent(type); … … 208 208 } 209 209 210 @Override 211 public void testGetAllEntries() { 212 super.testGetAllEntries(); 213 assertEquals(4, getFixture().getAllEntries().size()); 214 AXIndex index = getFixture().createIndex("index_test"); 215 AXEntry entry = index.createEntry("index_entry", AXEntryType.CLASS); 216 assertEquals(5, getFixture().getAllEntries().size()); 217 entry.createEntry("index_inner_entry", AXEntryType.METHOD); 218 assertEquals(6, getFixture().getAllEntries().size()); 219 } 210 220 } //AXIndexTest -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/AXRootTest.java
r2d81bf0 r2aa064d 132 132 AXPackage reference = getFixture().getOrCreateReference(); 133 133 assertNotNull(reference.eResource()); 134 assertEquals("root-package.axdoc", reference.eResource().getURI().lastSegment()); 134 assertEquals("root-package.axdoc", reference.eResource().getURI() 135 .lastSegment()); 135 136 136 137 AXIndex index = AXDocFactory.eINSTANCE.createAXIndex(); -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/coffeetime/ASDocFormatTest.java
r87f02d1 r2aa064d 12 12 import org.axdt.axdoc.model.AXLevel; 13 13 import org.axdt.axdoc.model.AXRoot; 14 import org.axdt.axdoc.model.util.AXUtil;15 14 import org.axdt.axdoc.util.AXDocParser; 16 15 import org.axdt.axdoc.util.HtmlLoader; … … 53 52 // you can specify the documentation url 54 53 AXRoot doc = parser.parse(url, AXLevel.TYPE, "base"); 55 List<AXEntry> typeList = AXUtil.getAllTypes(doc);54 List<AXEntry> typeList = doc.getAllTypes(); 56 55 for (AXEntry typeNode:typeList) { 57 56 parseType(typeNode); -
org.axdt.axdoc.test/src/org/axdt/axdoc/model/util/AXDocUtilTest.java
r2d81bf0 r2aa064d 5 5 import org.axdt.axdoc.TestConstants; 6 6 import org.axdt.axdoc.model.AXDocFactory; 7 import org.axdt.axdoc.model.AXEntryType;8 7 import org.axdt.axdoc.model.AXIndex; 9 8 import org.axdt.axdoc.model.AXPackage; … … 12 11 13 12 public class AXDocUtilTest extends TestCase implements TestConstants { 14 public void testGetAllTypes() throws Exception {15 AXRoot root = AXUtil.createRoot("name","url","base");16 AXIndex pack = root.createPackageIndex("org.axdt.test");17 AXIndex pack2 = root.createPackageIndex("org.axdt.foo");18 19 pack.createEntry("name", AXEntryType.CLASS);20 assertEquals(1, AXUtil.getAllTypes(root).size());21 pack2.createEntry("name2", AXEntryType.CLASS);22 assertEquals(2, AXUtil.getAllTypes(root).size());23 }24 13 public void testSerialize() throws Exception { 25 14 // empty resource -
org.axdt.axdoc.test/src/org/axdt/axdoc/util/Index0rTest.java
r85b4650 r2aa064d 36 36 index.initialize(root, AXLevel.PACKAGE); 37 37 assertNotNull(root); 38 // for now it loads the langref packages by itself39 38 assertEquals(1, index.roots.size()); 40 39 assertEquals(0, index.findPackage("foo").length); -
org.axdt.axdoc/src/org/axdt/axdoc/util/AXDocParser.java
r364575f r2aa064d 267 267 } 268 268 } 269 private AXEntryType parseTypeMemberEntryType(Node detail) throws DOMException, XPathExpressionException { 270 String headerText = parseTypeMemberHeader(detail); 271 AXEntryType type = getEntryType(headerText); 272 return type; 273 } 274 private AXEntry createTypeMemberEntry(AXEntry typeIndex, AXEntryType entryType, 275 String childCode) { 276 String keyword = getKeyword(entryType); 277 String mods="", decl, init="",name,type; 278 if (!childCode.contains(keyword)) { 279 // might property with getter and/or setter 280 decl = childCode; 281 } else { 282 String[] split = childCode.split(keyword,2); 283 mods = split[0].trim(); 284 decl = split[1].trim(); 285 } 286 if (decl.contains("=")) { 287 // has initializer 288 String[] split = decl.split("=",2); 289 decl = split[0].trim(); 290 init = split[1].trim(); 291 } 292 if (decl.contains(":")) { 293 String[] split = decl.split(":",2); 294 name = split[0].trim(); 295 type = split[1].trim(); 296 } else { 297 // might be constructor 298 name = decl.trim(); 299 type = typeIndex.getId(); 300 } 301 if (name.endsWith("()")) { 302 name = name.substring(0,name.length()-2); 303 } 304 AXEntry memberIndex = typeIndex.createEntry(name, entryType); 305 // create reference 306 memberIndex.getOrCreateReference(); 307 typeIndex.getEntries().add(memberIndex); 308 return memberIndex; 309 } 310 private String getKeyword(AXEntryType entryType) { 311 if (entryType == null) return null; 312 switch (entryType.getValue()) { 313 case AXEntryType.CONSTRUCTOR_VALUE: 314 case AXEntryType.METHOD_VALUE: 315 return "function"; 316 case AXEntryType.PROPERTY_VALUE: 317 return "var"; 318 case AXEntryType.CONSTANT_VALUE: 319 return "const"; 320 default: return null; 321 } 322 } 269 323 private void parseTypeMemberInfo(AXEntry typeIndex, Node detail) throws DOMException, XPathExpressionException { 270 String headerType = parseTypeMemberHeader(detail); 271 if ("Example".equals(headerType)) return; 272 // TODO handle events 273 if ("Event".equals(headerType)) return; 324 AXEntryType entryType = parseTypeMemberEntryType(detail); 325 if (entryType == null) 326 return; 274 327 Node child = detail.getFirstChild(); 275 328 // child contains the declaration string 276 329 String childCode = child.getTextContent().trim(); 277 330 log(3,"[DDD] found detail: "+ childCode); 278 AXEntry memberIndex = typeIndex.createEntry(childCode, AXEntryType.METHOD); 279 typeIndex.getEntries().add(memberIndex); 331 AXEntry memberIndex = createTypeMemberEntry(typeIndex,entryType,childCode); 280 332 child = child.getNextSibling(); 281 333 boolean isGetterSetter = child.getNodeType() == Node.TEXT_NODE; … … 313 365 // or some info spans follow 314 366 367 } 368 private AXEntryType getEntryType(String headerType) { 369 if ("method".equals(headerType)) { 370 return AXEntryType.METHOD; 371 } else 372 if ("property".equals(headerType)) { 373 return AXEntryType.PROPERTY; 374 } else 375 if ("Constant".equals(headerType)) { 376 return AXEntryType.CONSTANT; 377 } else 378 if ("Constructor".equals(headerType)) { 379 return AXEntryType.CONSTRUCTOR; 380 } 381 return null; 315 382 } 316 383 private String parseTypeMemberHeader(Node detail) throws DOMException, XPathExpressionException { -
org.axdt.axdoc/src/org/axdt/axdoc/util/Index0r.java
r364575f r2aa064d 11 11 import org.axdt.axdoc.AXDocPlugin; 12 12 import org.axdt.axdoc.model.AXEntry; 13 import org.axdt.axdoc.model.AXEntryType; 13 14 import org.axdt.axdoc.model.AXIndex; 14 15 import org.axdt.axdoc.model.AXIndexNode; … … 69 70 return null; 70 71 } 71 public AX IndexNode[] findMember(String qualifier, String name) {72 public AXEntry[] findMember(String qualifier, String name) { 72 73 ArrayList<AXIndexNode> result = new ArrayList<AXIndexNode>(); 73 74 for (AXRoot root:roots.values()) { … … 76 77 if (qsplit.length > 1) { 77 78 for (int i = 0; index != null && i < qsplit.length-1;i++) { 79 String part = qsplit[0]; 80 if (part.contains("#")) 81 part = part.substring(0,part.indexOf("#")); 78 82 index = index.localEntry(qsplit[0], false); 79 83 } 80 84 } 81 85 if (index != null) { 82 for (AXEntry entry : index.localEntry(qsplit[qsplit.length-1])) { 83 result.add(entry); 84 } 85 } 86 } 87 return result.toArray(new AXIndexNode[result.size()]); 86 String part = qsplit[qsplit.length-1]; 87 AXEntryType typeArg = null; 88 if (part.contains("#")) { 89 String[] split = part.split("#",2); 90 part = split[0]; 91 typeArg = AXEntryType.get(split[1]); 92 } 93 for (AXEntry entry : index.localEntry(part)) { 94 if (typeArg == null || typeArg.equals(entry.getType())) 95 result.add(entry); 96 } 97 } 98 } 99 return result.toArray(new AXEntry[result.size()]); 88 100 } 89 101 public AXIndex[] findPackage(String name) {
