|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.CompilerInput
public class CompilerInput
A class for the internal representation of an input to the compiler.
Wraps a SourceAst
and maintain state such as module for the input and
whether the input is an extern. Also calculates provided and required types.
Constructor Summary | |
---|---|
CompilerInput(SourceAst ast)
|
|
CompilerInput(SourceAst ast,
boolean isExtern)
|
|
CompilerInput(SourceAst ast,
InputId inputId,
boolean isExtern)
|
|
CompilerInput(SourceAst ast,
String inputId,
boolean isExtern)
|
|
CompilerInput(SourceFile file)
|
|
CompilerInput(SourceFile file,
boolean isExtern)
|
Method Summary | |
---|---|
void |
clearAst()
Removes any references to root node of the AST. |
SourceAst |
getAst()
|
Node |
getAstRoot(AbstractCompiler compiler)
Gets the root node of the AST for the source file this represents. |
String |
getCode()
|
InputId |
getInputId()
Returns a name for this input. |
String |
getLine(int lineNumber)
Gets the source line for the indicated line number. |
int |
getLineOffset(int lineno)
|
JSModule |
getModule()
Returns the module to which the input belongs. |
String |
getName()
Returns a name for this input. |
int |
getNumLines()
|
String |
getPathRelativeToClosureBase()
Gets the path relative to closure-base, if one is available. |
Collection<String> |
getProvides()
Gets a list of types provided by this input. |
Region |
getRegion(int lineNumber)
Get a region around the indicated line number. |
Collection<String> |
getRequires()
Gets a list of types depended on by this input. |
SourceAst |
getSourceAst()
Returns the SourceAst object on which this input is based. |
SourceFile |
getSourceFile()
Returns the source file the generated AST represents. |
boolean |
isExtern()
|
void |
removeRequire(String require)
|
void |
setCompiler(AbstractCompiler compiler)
Sets an abstract compiler for doing parsing. |
void |
setModule(JSModule module)
Sets the module to which the input belongs. |
void |
setSourceFile(SourceFile file)
Sets the source file the generated AST represents. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompilerInput(SourceAst ast)
public CompilerInput(SourceAst ast, boolean isExtern)
public CompilerInput(SourceAst ast, String inputId, boolean isExtern)
public CompilerInput(SourceAst ast, InputId inputId, boolean isExtern)
public CompilerInput(SourceFile file)
public CompilerInput(SourceFile file, boolean isExtern)
Method Detail |
---|
public InputId getInputId()
getInputId
in interface SourceAst
public String getName()
getName
in interface DependencyInfo
public SourceAst getAst()
public String getPathRelativeToClosureBase()
getPathRelativeToClosureBase
in interface DependencyInfo
public Node getAstRoot(AbstractCompiler compiler)
SourceAst
getAstRoot
in interface SourceAst
public void clearAst()
SourceAst
clearAst
in interface SourceAst
public SourceFile getSourceFile()
SourceAst
getSourceFile
in interface SourceAst
public void setSourceFile(SourceFile file)
SourceAst
setSourceFile
in interface SourceAst
public SourceAst getSourceAst()
public void setCompiler(AbstractCompiler compiler)
public Collection<String> getRequires()
getRequires
in interface DependencyInfo
public Collection<String> getProvides()
getProvides
in interface DependencyInfo
public void removeRequire(String require)
public String getLine(int lineNumber)
lineNumber
- the line number, 1 being the first line of the file.
null
if it does not exist,
or if there was an IO exception.public Region getRegion(int lineNumber)
lineNumber
- the line number, 1 being the first line of the file.
null
if it does not exist,
or if there was an IO exception.public String getCode() throws IOException
IOException
public JSModule getModule()
public void setModule(JSModule module)
public boolean isExtern()
public int getLineOffset(int lineno)
public int getNumLines()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |