use of org.eclipse.n4js.transpiler.TranspilerState.STECache in project n4js by eclipse.
the class PreparationStep method createIM.
private STECache createIM(Script script, Tracer tracer, InformationRegistry info) {
final AST2IMCopier copier = new AST2IMCopier(script, tracer, info);
final EObject result = copier.copy(script);
final STECache steCache = new STECache((Script_IM) result);
copier.steCache = steCache;
copier.copyReferences();
copier.createRemainingSymbolTableEntries();
return steCache;
}
use of org.eclipse.n4js.transpiler.TranspilerState.STECache in project n4js by eclipse.
the class PreparationStep method prepare.
/**
* Creates and initializes the transpiler state. In particular, this will create the intermediate model as a copy of
* the original AST with some modifications (esp. rewiring of cross-references to ensure intermediate model is
* self-contained).
*
* @param options
* the {@link GeneratorOption generator options} to use during generation.
*/
public TranspilerState prepare(Script script, GeneratorOption[] options) {
final N4JSResource resource = (N4JSResource) script.eResource();
final ContainerTypesHelper.MemberCollector memberCollector = containerTypesHelper.fromContext(resource);
final Tracer tracer = new Tracer();
final InformationRegistry info = new InformationRegistry();
final STECache steCache = createIM(script, tracer, info);
return new TranspilerState(resource, options, memberCollector, steCache.im, steCache, tracer, info);
}
Aggregations