use of abs.frontend.ast.CompilationUnit in project abstools by abstools.
the class IncrementalModelBuilder method removeCompilationUnit.
public synchronized void removeCompilationUnit(CompilationUnit cu) throws NoModelException {
if (model == null)
throw new NoModelException();
String filename = cu.getFileName();
assert filename != null;
CompilationUnit cuold = getCompilationUnit(filename);
List<CompilationUnit> culist = model.getCompilationUnitList();
int cindex = culist.getIndexOfChild(cuold);
if (cindex > 0) {
culist.removeChild(cindex);
}
// model.flushCache();
flushAll(model);
}
use of abs.frontend.ast.CompilationUnit in project abstools by abstools.
the class IncrementalModelBuilder method addCompilationUnits.
public synchronized void addCompilationUnits(Iterable<CompilationUnit> units) throws IOException, NoModelException {
// Initialize the model.
if (model == null) {
model = new Model();
model.addCompilationUnit(getStdLibCompilationUnit());
}
for (CompilationUnit u : units) {
addCompilationUnit(u);
}
Assert.isNotNull(model);
}
Aggregations