com.google.dart.compiler.backend.js.ast
Class JsProgram

java.lang.Object
  extended by HasMetadata
      extended by com.google.dart.compiler.backend.js.ast.JsProgram
All Implemented Interfaces:
JsNode

public final class JsProgram
extends HasMetadata

A JavaScript program.


Constructor Summary
JsProgram(java.lang.String unitId)
           
 
Method Summary
 void accept(JsVisitor v)
          Causes this object to have the visitor visit itself and its children.
 void acceptChildren(JsVisitor visitor)
           
 JsProgram deepCopy()
           
 JsExpression getEmptyExpression()
           
 JsBlock getFragmentBlock(int fragment)
           
 JsBlock getGlobalBlock()
           
 JsNumberLiteral getNumberLiteral(double value)
           
 JsNumberLiteral getNumberLiteral(int value)
           
 JsRootScope getRootScope()
          Gets the quasi-mythical root scope.
 JsObjectScope getScope()
          Gets the top level scope.
 java.lang.Object getSource()
          Return the source info associated with this object.
 JsStringLiteral getStringLiteral(java.lang.String value)
          Creates or retrieves a JsStringLiteral from an interned object pool.
 void setFragmentCount(int fragments)
           
 void setSource(java.lang.Object info)
          Set the source info associated with this object.
 JsNode source(java.lang.Object info)
           
 java.lang.String toString()
           
 void traverse(JsVisitorWithContext v, JsContext ctx)
          Causes this object to have the visitor visit itself and its children.
protected
<T extends HasMetadata>
T
withMetadataFrom(T other)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsProgram

public JsProgram(java.lang.String unitId)
Method Detail

getEmptyExpression

@NotNull
public JsExpression getEmptyExpression()

getFragmentBlock

public JsBlock getFragmentBlock(int fragment)

getGlobalBlock

public JsBlock getGlobalBlock()

getNumberLiteral

public JsNumberLiteral getNumberLiteral(double value)

getNumberLiteral

public JsNumberLiteral getNumberLiteral(int value)

getRootScope

public JsRootScope getRootScope()
Gets the quasi-mythical root scope. This is not the same as the top scope; all unresolvable identifiers wind up here, because they are considered external to the program.


getScope

public JsObjectScope getScope()
Gets the top level scope. This is the scope of all the statements in the main program.


getStringLiteral

@NotNull
public JsStringLiteral getStringLiteral(java.lang.String value)
Creates or retrieves a JsStringLiteral from an interned object pool.


setFragmentCount

public void setFragmentCount(int fragments)

accept

public void accept(JsVisitor v)
Description copied from interface: JsNode
Causes this object to have the visitor visit itself and its children.

Parameters:
v - the visitor that should traverse this node

acceptChildren

public void acceptChildren(JsVisitor visitor)
Specified by:
acceptChildren in interface JsNode

traverse

public void traverse(JsVisitorWithContext v,
                     JsContext ctx)
Description copied from interface: JsNode
Causes this object to have the visitor visit itself and its children.

Parameters:
v - the visitor that should traverse this node
ctx - the context of an existing traversal

deepCopy

@NotNull
public JsProgram deepCopy()

getSource

public java.lang.Object getSource()
Description copied from interface: JsNode
Return the source info associated with this object.


setSource

public void setSource(java.lang.Object info)
Description copied from interface: JsNode
Set the source info associated with this object.


source

public JsNode source(java.lang.Object info)

toString

public java.lang.String toString()

withMetadataFrom

protected <T extends HasMetadata> T withMetadataFrom(T other)