Changeset 4049
- Timestamp:
- Dec 17, 2008, 9:03:08 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/AstInfo.java
r3863 r4049 7 7 import org.refal.rfpdt.ast.AstDecl; 8 8 import org.refal.rfpdt.ast.AstFence; 9 import org.refal.rfpdt.ast.AstFuncDecl; 9 10 import org.refal.rfpdt.ast.AstFuncDef; 10 11 import org.refal.rfpdt.ast.AstImplem; … … 79 80 return null; 80 81 } 82 83 private static AstNode getFuncDef (AstDecl astNode) { 84 if (astNode instanceof AstFuncDecl && ((AstFuncDecl) astNode).funcDef != null) 85 return ((AstFuncDecl) astNode).funcDef; 86 else 87 return getDeclName(astNode); 88 } 89 90 private static AstNode getDeclName (AstDecl astNode) { 91 return astNode != null ? astNode.name : null; 92 } 81 93 82 94 /** May return <code>null<code>! */ … … 97 109 else if (size > 1 && astNodeList.get(size - 1) instanceof AstName) { 98 110 AstNode astNode = astNodeList.get(size - 2); 99 AstDecl astDecl = null;100 111 if (astNode instanceof AstDecl) 101 astDecl = (AstDecl) astNode;112 return getFuncDef((AstDecl) astNode); 102 113 else if (astNode instanceof AstFuncDef) 103 astDecl = ((AstFuncDef) astNode).funcDecl;114 return getDeclName(((AstFuncDef) astNode).funcDecl); 104 115 else if (astNode instanceof AstRef) 105 astDecl = ((AstRef) astNode).decl;116 return getFuncDef(((AstRef) astNode).decl); 106 117 else if (astNode instanceof AstCall) 107 astDecl = ((AstCall) astNode).funcDecl;118 return getFuncDef(((AstCall) astNode).funcDecl); 108 119 else if (astNode instanceof AstNative) 109 astDecl = ((AstNative) astNode).funcDecl;120 return getDeclName(((AstNative) astNode).funcDecl); 110 121 else 111 122 return null; 112 return astDecl != null ? astDecl.name : null;113 123 } 114 124 return null;
Note: See TracChangeset
for help on using the changeset viewer.