public Declaration resolveUp(Identifier i) { Element p = i;// e.getParentElement(); for (; p != null;) { do {//while (!(p instanceof DeclarationsHolder)) { p = p.getParentElement(); } while (!(p instanceof DeclarationsHolder)); } return null; }
public Declaration resolveUp(Identifier i) { Element p = i;// e.getParentElement(); for (; p != null;) { do {//while (!(p instanceof DeclarationsHolder)) { p = p.getParentElement(); } while (!(p instanceof DeclarationsHolder)); } return null; }
public SymbolTable getEnclosingSymbolTable(Element element) { while (element != null) { SymbolTable st = elementTables.get(element); if (st != null) { return st; } element = element.getParentElement(); } return null; }
public SymbolTable getEnclosingSymbolTable(Element element) { while (element != null) { SymbolTable st = elementTables.get(element); if (st != null) { return st; } element = element.getParentElement(); } return null; }
static String getExactTypeDefName(Element e) { Element parent = e.getParentElement(); if (e instanceof FunctionSignature && parent instanceof TypeRef.Pointer) { parent = parent.getParentElement(); } if (parent == null || !(parent instanceof TypeDef)) { return null; } TypeDef td = (TypeDef) parent; return findBestPlainStorageName(td); }
static String getExactTypeDefName(Element e) { Element parent = e.getParentElement(); if (e instanceof FunctionSignature && parent instanceof TypeRef.Pointer) { parent = parent.getParentElement(); } if (parent == null || !(parent instanceof TypeDef)) { return null; } TypeDef td = (TypeDef) parent; return findBestPlainStorageName(td); }
public Object findParentOfTypes(Class<?>... types) { Element e = this; for (;;) { e = e.getParentElement(); if (e == null) return null; for (Class<?> type : types) if (type.isAssignableFrom(e.getClass())) return type.cast(e); } }
public Element getPreviousSibling() { Element pe = getParentElement(); if (pe != null) return pe.getPreviousChild(this); return null; }
public boolean replaceBy(Element element) { Element pe = getParentElement(); if (pe != null) return pe.replaceChild(this, element); return false; }
public Element getNextSibling() { Element pe = getParentElement(); if (pe != null) return pe.getNextChild(this); return null; }
public EnumSet<Language> resolvePossibleLanguages() { if (possibleLanguages != null) return possibleLanguages; Element parent = getParentElement(); if (parent != null) return parent.resolvePossibleLanguages(); return null; } public void setPossibleLanguages(EnumSet<Language> possibleLanguages) {
public boolean insertSibling(Element siblingToInsert, boolean before) { Element parent = getParentElement(); if (parent == null) return false; return parent.insertChild(this, siblingToInsert, before); } @SuppressWarnings("unchecked")
public String resolveFile(Element e) { String file = null; while (e != null && (file = e.getElementFile()) == null) { e = e.getParentElement(); } return file; }
public String resolveFile(Element e) { String file = null; while (e != null && (file = e.getElementFile()) == null) { e = e.getParentElement(); } return file; }
public static String getFileOfAscendency(Element decl) { Element e = decl; String file = null; Set<Integer> visitedIds = new TreeSet<Integer>(); while (e != null && (file = e.getElementFile()) == null && visitedIds.add(e.getId())) { e = e.getParentElement(); } return file; }
public final MutableByDeclarator mutateTypeKeepingParent(MutableByDeclarator type) { if (type == null) return null; MutableByDeclarator mutated = mutateType(type); if (mutated == null) throw new RuntimeException("Mutation of " + type + " yielded NULL!"); ((Element)mutated).setParentElement(((Element)type).getParentElement()); return mutated; } public static class DirectDeclarator extends Declarator {
static List<String> guessOwnerName(Element e) { Element parent = e.getParentElement(); if (parent == null) { return null; parent = parent.getParentElement();
static List<String> guessOwnerName(Element e) { Element parent = e.getParentElement(); if (parent == null) { return null; parent = parent.getParentElement();
(parent instanceof TypeRef.Pointer) && (parent.getParentElement() instanceof TypeDef)) { return;
(parent instanceof TypeRef.Pointer) && (parent.getParentElement() instanceof TypeDef)) { return;