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, java.util.List<IdeDeclaration> secondaryDeclarations)
           
 
Method Summary
 void addDependency(CompilationUnit otherUnit)
           
 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()
           
 java.util.Collection<java.io.File> getSourcePath()
           
 JooSymbol getSymbol()
           
 void scope(Scope scope)
           
 void setCompiler(Jooc compiler)
           
 void setSource(InputSource source)
           
 java.lang.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,
                       java.util.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 java.util.Collection<java.io.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 java.io.IOException
Description copied from class: NodeImplBase
Default implementation generates same code as JS. Overwritten where this must differ.

Overrides:
generateAsApiCode in class NodeImplBase
Throws:
java.io.IOException

generateJsCode

protected void generateJsCode(JsWriter out)
                       throws java.io.IOException
Specified by:
generateJsCode in class NodeImplBase
Throws:
java.io.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)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2010 CoreMedia AG. All Rights Reserved.