Functions

parsejs(String text, {String filename, int firstLine: 1, bool handleNoise: true, bool annotations: true}) Program

Parse text as a JavaScript program and return its AST.

Classes

ArrayExpression

Expression of form: [ [expressions] ]

AssignmentExpression

Expression of form: [left] = [right] or [left] += [right] or using any of the assignment operators: =, +=, -=, *=, /=, %=, <<=, >>=, >>>=, |=, ^=, &=

BaseVisitor

Implementation of Visitor which redirects each visit method to a method defaultNode.

BinaryExpression

Expression of form: [left] + [right], or using any of the binary operators: ==, !=, ===, !==, <, <=, >, >=, <<, >>, >>>, +, -, *, /, %, |, ^, &, &&, ||, in, instanceof

BlockStatement

Statement of form: { [body] }

BreakStatement

Statement of form: break; or break [label];

CallExpression

Expression of form: [callee](..[arguments]..) or new [callee](..[arguments]..).

CatchClause

A catch clause: catch ([param]) [body]

ConditionalExpression

Expression of form: [condition] ? [then] : [otherwise].

ContinueStatement

Statement of form: continue; or continue [label];

DebuggerStatement

Statement of form: debugger;

DoWhileStatement

Statement of form: do [body] while ([condition]);

EmptyStatement

Statement of form: ;

Expression

//// Superclass of all nodes that are expressions.

ExpressionStatement

Statement of form: [expression];

ForInStatement

Statement of form: for ([left] in [right]) [body]

ForStatement

Statement of form: for ([init]; [condition]; [update]) [body]

FunctionDeclaration

Statement of form: function [function.name])([function.params]) { [function.body] }.

FunctionExpression

Expression of form: function [function.name]([function.params]) { [function.body] }.

FunctionNode

A function, which may occur as a function expression, function declaration, or property accessor in an object literal.

IfStatement

Statement of form: if ([condition]) then [then] else [otherwise].

IndexExpression

Expression of form: [object][[property]].

LabeledStatement

Statement of form: [label]: [body]

LiteralExpression

A literal string, number, boolean or null.

MemberExpression

Expression of form: [object].[property].

Name

Mention of a variable, property, or label.

NameExpression

A Name that is used as an expression.

Node

A node in the abstract syntax tree of a JavaScript program.

ObjectExpression

Expression of form: { [properties] }

ParseError

Program

The root node of a JavaScript AST, representing the top-level scope.

Programs

A collection of Program nodes.

Property

Property initializer [key]: [value], or getter get [key] [value], or setter set [key] [value].

RecursiveVisitor

Traverses the entire subtree when visiting a node.

RegexpExpression

A regular expression literal.

ReturnStatement

Statement of form: return [argument]; or return;

Scope

Superclass for Program, FunctionNode, and CatchClause, which are the three types of node that can host local variables.

SequenceExpression

Comma-seperated expressions.

Statement

Superclass for all nodes that are statements.

SwitchCase

Clause in a switch: case [expression]: [body] or default: [body] if expression is null.

SwitchStatement

Statement of form: switch ([argument]) { [cases] }

ThisExpression

Expression of form: this

ThrowStatement

Statement of form: throw [argument];

TryStatement

Statement of form: try [block] catch [handler] finally [finalizer].

UnaryExpression

Expression of form: +[argument], or using any of the unary operators: +, -, !, ~, typeof, void, delete

UpdateExpression

Expression of form: ++[argument], --[argument], [argument]++, [argument]--.

VariableDeclaration

Statement of form: var [declarations];

VariableDeclarator

Variable declaration: [name] or [name] = [init].

Visitor

Visitor interface for AST nodes.

WhileStatement

Statement of form: while ([condition]) [body]

WithStatement

Statement of form: with ([object]) { [body] }