net.jangaroo.jooc
Class CompilationUnit
java.lang.Object
net.jangaroo.jooc.NodeImplBase
net.jangaroo.jooc.CompilationUnit
- All Implemented Interfaces:
- CodeGenerator
public class CompilationUnit
- extends NodeImplBase
- implements CodeGenerator
- Author:
- Andreas Gawecki, Frank Wienberg
CompilationUnit
public CompilationUnit(PackageDeclaration packageDeclaration,
JooSymbol lBrace,
IdeDeclaration primaryDeclaration,
JooSymbol rBrace,
List<IdeDeclaration> secondaryDeclarations)
getPackageDeclaration
public PackageDeclaration getPackageDeclaration()
scope
public void scope(Scope scope)
getPrimaryDeclaration
public IdeDeclaration getPrimaryDeclaration()
getCompiler
public Jooc getCompiler()
setCompiler
public void setCompiler(Jooc compiler)
getSourcePath
public Collection<File> getSourcePath()
setSource
public void setSource(InputSource source)
- Parameters:
source - the source of this compilation unit.
writeOutput
public void writeOutput(CompilationUnitSinkFactory writerFactory,
boolean verbose)
throws net.jangaroo.jooc.Jooc.CompilerError
- Throws:
net.jangaroo.jooc.Jooc.CompilerError
generateAsApiCode
protected void generateAsApiCode(JsWriter out)
throws IOException
- Description copied from class:
NodeImplBase
- Default implementation generates same code as JS. Overwritten where this must differ.
- Overrides:
generateAsApiCode in class NodeImplBase
- Throws:
IOException
generateJsCode
protected void generateJsCode(JsWriter out)
throws IOException
- Specified by:
generateJsCode in class NodeImplBase
- Throws:
IOException
analyze
public net.jangaroo.jooc.AstNode analyze(net.jangaroo.jooc.AstNode parentNode,
AnalyzeContext context)
- Overrides:
analyze in class NodeImplBase
getSymbol
public JooSymbol getSymbol()
addDependency
public void addDependency(CompilationUnit otherUnit)
addResourceDependency
public String addResourceDependency(String relativePath)
- Add a dependency to a resource at the given path, which is relative to this compilation unit's file.
- Parameters:
relativePath - relative path of the dependency
- Returns:
- the path relative to the source directory
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2002-2011 CoreMedia AG. All Rights Reserved.