net.jangaroo.jooc
Class CompilationUnit

java.lang.Object
  extended by net.jangaroo.jooc.NodeImplBase
      extended by net.jangaroo.jooc.CompilationUnit
All Implemented Interfaces:
CodeGenerator

public class CompilationUnit
extends NodeImplBase
implements CodeGenerator

Author:
Andreas Gawecki, Frank Wienberg

Nested Class Summary
 
Nested classes/interfaces inherited from class net.jangaroo.jooc.NodeImplBase
NodeImplBase.Scoped
 
Constructor Summary
CompilationUnit(PackageDeclaration packageDeclaration, JooSymbol lBrace, IdeDeclaration primaryDeclaration, JooSymbol rBrace, List<IdeDeclaration> secondaryDeclarations)
           
 
Method Summary
 void addDependency(CompilationUnit otherUnit)
           
 String addResourceDependency(String relativePath)
          Add a dependency to a resource at the given path, which is relative to this compilation unit's file.
 net.jangaroo.jooc.AstNode analyze(net.jangaroo.jooc.AstNode parentNode, AnalyzeContext context)
           
protected  void generateAsApiCode(JsWriter out)
          Default implementation generates same code as JS.
protected  void generateJsCode(JsWriter out)
           
 Jooc getCompiler()
           
 PackageDeclaration getPackageDeclaration()
           
 IdeDeclaration getPrimaryDeclaration()
           
 Collection<File> getSourcePath()
           
 JooSymbol getSymbol()
           
 void scope(Scope scope)
           
 void setCompiler(Jooc compiler)
           
 void setSource(InputSource source)
           
 String toString()
           
 void writeOutput(CompilationUnitSinkFactory writerFactory, boolean verbose)
           
 
Methods inherited from class net.jangaroo.jooc.NodeImplBase
analyze, generateCode, scope, withNewDeclarationScope, withNewLabelScope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jangaroo.jooc.CodeGenerator
generateCode
 

Constructor Detail

CompilationUnit

public CompilationUnit(PackageDeclaration packageDeclaration,
                       JooSymbol lBrace,
                       IdeDeclaration primaryDeclaration,
                       JooSymbol rBrace,
                       List<IdeDeclaration> secondaryDeclarations)
Method Detail

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.