Exemple #1
0
 public Macro get(String name) {
   Map m = db.getMap(NAME);
   Macro c;
   for (Iterator i = m.values().iterator(); i.hasNext(); ) {
     c = (Macro) i.next();
     if (c.getName().equals(name)) {
       return c;
     }
   }
   return null;
 }
Exemple #2
0
  public Macro newMacro(PMacro pDeclaration) {

    if (pDeclaration == null) {
      throw new InternalException("pDeclaration may not be null");
    }

    if (pDeclaration.parent() instanceof AMacroSourceFilePart) {
      throw new InternalException("pDeclaration may not be a top-level macro");
    }

    Macro macro = getGlobalIndex().newMacro(pDeclaration, this);

    this.macroMap.put(macro.getName(), macro);
    this.macros.add(macro);

    return macro;
  }