public abstract class AbstractCompiler extends java.lang.Object implements SourceExcerptProvider, CompilerInputProvider
This is an abstract class, so that we can make the methods package-private.
SourceExcerptProvider.ExcerptFormatter, SourceExcerptProvider.SourceExcerpt
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
annotationMap |
Constructor and Description |
---|
AbstractCompiler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addExportedNames(java.util.Set<java.lang.String> exportedVariableNames)
Adds exported names to keep track.
|
abstract void |
addInputSourceMap(java.lang.String name,
SourceMapInput sourceMap)
Adds a
SourceMapInput for the given sourceFileName , to be used for error
reporting and source map combining. |
abstract void |
clearJSTypeRegistry() |
com.google.javascript.jscomp.AstFactory |
createAstFactory()
Returns a new AstFactory that will add type information to the nodes it creates if and only if
type type checking has already happened.
|
LogFile |
createOrReopenIndexedLog(java.lang.Class<?> owner,
java.lang.String firstNamePart,
java.lang.String... restNameParts)
Provides logging access to a file with the specified name, differentiated by the index of the
current pass.
|
LogFile |
createOrReopenLog(java.lang.Class<?> owner,
java.lang.String firstNamePart,
java.lang.String... restNameParts)
Provides logging access to a file with the specified name.
|
AstAnalyzer |
getAstAnalyzer()
Returns a new AstAnalyzer configured correctly to answer questions about Nodes in the AST
currently being compiled.
|
abstract CodingConvention |
getCodingConvention()
Gets the current coding convention.
|
abstract com.google.javascript.jscomp.IdGenerator |
getCrossModuleIdGenerator()
Gets the id generator for cross-module motion.
|
abstract ErrorManager |
getErrorManager()
Gets the error manager.
|
abstract java.util.Set<java.lang.String> |
getExportedNames()
Gets the names that have been exported.
|
abstract java.lang.Iterable<TypeMismatch> |
getImplicitInterfaceUses()
Gets all types that are used implicitly as a matching interface type.
|
abstract CompilerInput |
getInput(InputId inputId)
Looks up an input (possibly an externs input) by input id.
|
abstract ModuleMap |
getModuleMap() |
abstract ModuleMetadataMap |
getModuleMetadataMap() |
abstract double |
getProgress() |
abstract ReverseAbstractInterpreter |
getReverseAbstractInterpreter()
Get an interpreter for type analysis.
|
abstract Node |
getRoot()
Returns the root node of the AST, which includes both externs and source.
|
abstract Node |
getScriptNode(java.lang.String filename) |
abstract TypedScope |
getTopScope()
Gets the top scope.
|
abstract java.lang.Iterable<TypeMismatch> |
getTypeMismatches()
Gets the central registry of type violations.
|
abstract JSTypeRegistry |
getTypeRegistry()
Gets a central registry of type information from the compiled JS.
|
static boolean |
isFillFileName(java.lang.String fileName)
Returns whether a file name was created by
createFillFileName . |
abstract void |
report(JSError error)
Report an error or warning.
|
abstract void |
reportChangeToChangeScope(Node changeScopeRoot)
Mark modifications in a scope that is different than the Compiler.currentScope use this (eg,
InlineVariables and many others)
|
abstract void |
reportChangeToEnclosingScope(Node n)
Passes that make modifications in a scope that is different than the Compiler.currentScope use
this (eg, InlineVariables and many others)
|
abstract void |
setAnonymousFunctionNameMap(VariableMap functionMap)
Sets the naming map for anonymous functions
|
abstract void |
setCssNames(java.util.Map<java.lang.String,java.lang.Integer> newCssNames)
Sets the css names found during compilation.
|
abstract void |
setIdGeneratorMap(java.lang.String serializedIdMappings)
Sets the id generator for cross-module motion.
|
abstract void |
setModuleMap(ModuleMap moduleMap) |
abstract void |
setModuleMetadataMap(ModuleMetadataMap moduleMetadataMap) |
abstract void |
setPropertyMap(VariableMap propertyMap)
Sets the property renaming map
|
abstract void |
setStringMap(VariableMap stringMap)
Sets the string replacement map
|
abstract void |
setVariableMap(VariableMap variableMap)
Sets the variable renaming map
|
abstract java.lang.String |
toSource()
Prints a node to source code.
|
abstract java.lang.String |
toSource(Node root)
Prints a node to source code.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSourceLine, getSourceMapping, getSourceRegion
public abstract CompilerInput getInput(InputId inputId)
getInput
in interface CompilerInputProvider
@Nullable public abstract Node getScriptNode(java.lang.String filename)
public abstract void addExportedNames(java.util.Set<java.lang.String> exportedVariableNames)
public abstract java.util.Set<java.lang.String> getExportedNames()
public abstract void setVariableMap(VariableMap variableMap)
public abstract void setPropertyMap(VariableMap propertyMap)
public abstract void setStringMap(VariableMap stringMap)
public abstract void setCssNames(java.util.Map<java.lang.String,java.lang.Integer> newCssNames)
public abstract void setIdGeneratorMap(java.lang.String serializedIdMappings)
public abstract com.google.javascript.jscomp.IdGenerator getCrossModuleIdGenerator()
public abstract void setAnonymousFunctionNameMap(VariableMap functionMap)
public abstract JSTypeRegistry getTypeRegistry()
public abstract void clearJSTypeRegistry()
public abstract TypedScope getTopScope()
public abstract void report(JSError error)
public abstract CodingConvention getCodingConvention()
public abstract void reportChangeToEnclosingScope(Node n)
public abstract void reportChangeToChangeScope(Node changeScopeRoot)
public abstract java.lang.Iterable<TypeMismatch> getTypeMismatches()
public abstract java.lang.Iterable<TypeMismatch> getImplicitInterfaceUses()
public abstract java.lang.String toSource()
public abstract java.lang.String toSource(Node root)
public abstract ReverseAbstractInterpreter getReverseAbstractInterpreter()
public static boolean isFillFileName(java.lang.String fileName)
createFillFileName
.public abstract ErrorManager getErrorManager()
public abstract Node getRoot()
public abstract double getProgress()
public abstract void addInputSourceMap(java.lang.String name, SourceMapInput sourceMap)
SourceMapInput
for the given sourceFileName
, to be used for error
reporting and source map combining.public com.google.javascript.jscomp.AstFactory createAstFactory()
public AstAnalyzer getAstAnalyzer()
public abstract ModuleMetadataMap getModuleMetadataMap()
public abstract void setModuleMetadataMap(ModuleMetadataMap moduleMetadataMap)
public abstract ModuleMap getModuleMap()
public abstract void setModuleMap(ModuleMap moduleMap)
@MustBeClosed public final LogFile createOrReopenLog(java.lang.Class<?> owner, java.lang.String firstNamePart, java.lang.String... restNameParts)
@MustBeClosed public final LogFile createOrReopenIndexedLog(java.lang.Class<?> owner, java.lang.String firstNamePart, java.lang.String... restNameParts)
Indexing helps in separating logs from different pass loops. The filename pattern is "[debug_log_directory]/[owner_name]/([name_part[i]]/){0,n-1}[pass_index]_[name_part[n]]".
Copyright © 2009-2020 Google. All Rights Reserved.