## com.google.javascript.jscomp.jsonml
Class JsonMLAst

    java.lang.Object
      com.google.javascript.jscomp.jsonml.JsonMLAst

All Implemented Interfaces:
  SourceAst, Serializable

    public class JsonMLAst

extends Object
implements SourceAst

Generates an AST from a JsonML source file. JsonML format for representation of JavaScript is specified here.

See Also:
  Serialized Form

Constructor Summary
`JsonMLAst(JsonML jsonml)`

Method Summary
`void` | `clearAst()` Removes any references to root node of the AST.
`JsonML` | `convertToJsonML()`
`Node` | `getAstRoot(AbstractCompiler compiler)` Generates AST based on AST representation
`JsonML` | `getElementPreOrder(int n)` Returns a JsonML element with the specified number from the tree in pre-order walk.
`InputId` | `getInputId()`
`SourceFile` | `getSourceFile()` Returns the source file the generated AST represents.
`String` | `getSourceName()`
`void` | `setSourceFile(SourceFile file)` Sets the source file the generated AST represents.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JsonMLAst

    public JsonMLAst(JsonML jsonml)

Method Detail

### clearAst

    public void clearAst()

  Description copied from interface: `SourceAst`
  Removes any references to root node of the AST. If it is requested again, another parse will be performed. This method is needed to allow the ASTs to be garbage collected if the inputs are still around after compilation.

  Specified by:
    `clearAst` in interface `SourceAst`

### getAstRoot

    public Node getAstRoot(AbstractCompiler compiler)

  Generates AST based on AST representation

  Specified by:
    `getAstRoot` in interface `SourceAst`
  See Also:
    `SourceAst.getAstRoot(AbstractCompiler)`

### getSourceFile

    public SourceFile getSourceFile()

  Description copied from interface: `SourceAst`
  Returns the source file the generated AST represents.

  Specified by:
    `getSourceFile` in interface `SourceAst`

### setSourceFile

    public void setSourceFile(SourceFile file)

  Description copied from interface: `SourceAst`
  Sets the source file the generated AST represents. This can be called after deserializing if access to the source file is needed. If a different file is provided than that with which this was created, an IllegalStateException will be thrown.

  Specified by:
    `setSourceFile` in interface `SourceAst`

### getSourceName

    public String getSourceName()

### convertToJsonML

    public JsonML convertToJsonML()

### getElementPreOrder

    public JsonML getElementPreOrder(int n)

  Returns a JsonML element with the specified number from the tree in pre-order walk.

  Returns:
    n-th node or null if the node does not exists

### getInputId

    public InputId getInputId()

  Specified by:
    `getInputId` in interface `SourceAst`
  Returns:
    The input id associated with this AST