public class GlobalLexicalScope extends LexicalScope
LexicalScope.NestingState, LexicalScope.TempManager, LexicalScope.VariableMutability
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_NAME_PREFIX
No synthetic name prefix.
|
static ICodeGenerator |
NO_GENERATOR
No code generator.
|
static boolean |
NO_PARALLEL_CODEGEN
Single-thread code generation.
|
static IABCVisitor |
USE_DEFAULT_EMITTER
No IABCVisitor supplied, this scope should supply a default implementation.
|
static boolean |
VISIBLE_COMPILATION_UNIT
The value for the
inInvisibleCompilationUnit constructor
parameter that means we are not in an invisible compilation unit. |
anyType, DEBUG_LINE_UNKNOWN, methodBodySemanticChecker, noInitializer
Constructor and Description |
---|
GlobalLexicalScope(ICompilerProject project,
ICodeGenerator generator)
Construct a "global" scope to attempt to generate a constant value.
|
GlobalLexicalScope(ICompilerProject project,
ICodeGenerator generator,
String syntheticNamePrefix,
boolean inInvisibleCompilationUnit,
boolean useParallelCodegen,
Map<String,String> encodedDebugFiles)
Construct a global lexical scope to serve as the basis for generating
code for a compilation unit.
|
GlobalLexicalScope(ICompilerProject project,
ICodeGenerator generator,
String syntheticNamePrefix,
IABCVisitor emitter)
Construct a global scope with a specialized IABCVisitor.
|
Modifier and Type | Method and Description |
---|---|
void |
addProblem(ICompilerProblem problem)
Add a problem to this code generation phase.
|
Set<EmbedData> |
getEmbeds() |
protected String |
getEncodedDebugFile(String filename) |
ICodeGenerator |
getGenerator() |
boolean |
getInInvisibleCompilationUnit() |
InstructionList |
getInitInstructions() |
MethodBodySemanticChecker |
getMethodBodySemanticChecker() |
Collection<ICompilerProblem> |
getProblems() |
ICompilerProject |
getProject() |
protected String |
getSyntheticName(String user_supplied) |
boolean |
isGlobalScope() |
addDefaultValue, addHasNexts, addInlinedBindings, addProblems, allocateTemp, allocateTemp, declareVariableName, emitFile, emitLine, findProperty, findProperty, finishClassStaticInitializer, generateBindableGetter, generateBindableSetter, getBinding, getBinding, getDebugFile, getEnclosingFrame, getFlowManager, getGlobalScope, getHasNexts, getLocalASScope, getLocalBindings, getMethodInfo, getNestingState, getParamTypes, getPropertyValue, getPropertyValue, getThisBinding, initializeTempRegisters, insideInlineFunction, isLocalDefinition, makeBindableVariable, makeNamespace, makeParameter, makeVariable, makeVariable, makeVariable, makeVariable, mergeTemps, needsActivation, needsArguments, needsHoistedInitInsns, needsThis, popFrame, processMetadata, pushFrame, pushInlineFunctionFrame, releaseTemp, resetDebugInfo, resetMethodInfo, resolveName, setDebugFile, setDebugLine, setLocalASScope, setMethodInfo, setNeedsActivation, setNeedsArguments, setNeedsRest, setSetsDxns, transferInitializerData
public static final boolean VISIBLE_COMPILATION_UNIT
inInvisibleCompilationUnit
constructor
parameter that means we are not in an invisible compilation unit.public static final boolean NO_PARALLEL_CODEGEN
public static final String EMPTY_NAME_PREFIX
public static final ICodeGenerator NO_GENERATOR
public static final IABCVisitor USE_DEFAULT_EMITTER
public GlobalLexicalScope(ICompilerProject project, ICodeGenerator generator)
project
- - the active compiler project.generator
- - the active code generator.public GlobalLexicalScope(ICompilerProject project, ICodeGenerator generator, String syntheticNamePrefix, IABCVisitor emitter)
project
- - the active compiler project.generator
- - the caller's code generator.syntheticNamePrefix
- - text to prefix any synthetic names generated.emitter
- - the caller's IABCVisitor.public GlobalLexicalScope(ICompilerProject project, ICodeGenerator generator, String syntheticNamePrefix, boolean inInvisibleCompilationUnit, boolean useParallelCodegen, Map<String,String> encodedDebugFiles)
project
- - the active compiler project.generator
- - the active code generator.syntheticNamePrefix
- - text to prefix any synthetic names generated.inInvisibleCompilationUnit
- - true if we are compiling an invisible
compilation unit, which does not contribute any definitions to the project scopeuseParallelCodegen
- - use multiple threads to generate code if true.encodedDebugFiles
- - a mapping between the absolute path of a file, and the
encoded path that is used by OP_debugfilepublic boolean isGlobalScope()
isGlobalScope
in class LexicalScope
public ICompilerProject getProject()
getProject
in class LexicalScope
public ICodeGenerator getGenerator()
getGenerator
in class LexicalScope
public boolean getInInvisibleCompilationUnit()
getInInvisibleCompilationUnit
in class LexicalScope
IDefinition
's for package/file classes,
interfaces, function's, var's, const's, and namespaces need to be
normalized before comparing them by identity in some semantic checks (
namely the type conversion checks ).
Also, in this case, we must do additional checking to determine
whether an import is valid.public InstructionList getInitInstructions()
getInitInstructions
in class LexicalScope
public MethodBodySemanticChecker getMethodBodySemanticChecker()
getMethodBodySemanticChecker
in class LexicalScope
public Collection<ICompilerProblem> getProblems()
getProblems
in class LexicalScope
public void addProblem(ICompilerProblem problem)
LexicalScope
addProblem
in class LexicalScope
problem
- The ICompilerProblem
to add.public Set<EmbedData> getEmbeds()
protected String getSyntheticName(String user_supplied)
user_supplied
- - some user-supplied text, which may make debugging easier.Copyright © 2016 The Apache Software Foundation. All rights reserved.