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

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

public final class JsProgram
extends java.lang.Object

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)
           
 JsEmpty getEmptyStatement()
           
 JsBlock getFragmentBlock(int fragment)
           
 JsBlock getGlobalBlock()
           
 JsNumberLiteral getNumberLiteral(double value)
           
 JsNumberLiteral getNumberLiteral(int value)
           
 JsRootScope getRootScope()
          Gets the quasi-mythical root scope.
 JsScope 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()
           
 
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

getEmptyStatement

public JsEmpty getEmptyStatement()

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 JsScope 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

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()
Overrides:
toString in class java.lang.Object