C# (CSharp) Rhino.Ast Namespace

Classes

Name Description
ArrayComprehension AST node for a JavaScript 1.7 Array comprehension.
ArrayComprehensionLoop AST node for a single 'for (foo in bar)' loop construct in a JavaScript 1.7 Array comprehension.
ArrayLiteral AST node for an Array literal.
Assignment AST node representing the set of assignment operators such as = , *= and += .
AstRoot Node for the root of a parse tree.
AstRoot._NodeVisitor_139
Block A block statement delimited by curly braces.
BreakStatement A break statement.
CatchClause Node representing a catch-clause of a try-statement.
Comment Node representing comments.
ConditionalExpression AST node representing the ternary operator.
ContinueStatement A continue statement.
DoLoop Do statement.
ElementGet AST node for an indexed property reference, such as foo['bar'] or foo[2] . This is sometimes called an "element-get" operation, hence the name of the node.

Node type is Rhino.Token.GETELEM .

The node bounds extend from the beginning position of the target through the closing right-bracket. In the presence of a syntax error, the right bracket position is -1, and the node ends at the end of the element expression.

EmptyExpression AST node for an empty expression.
EmptyStatement AST node for an empty statement.
ErrorCollector An error reporter that gathers the errors and warnings for later display.
ErrorNode AST node representing a parse error or a warning.
ExpressionStatement AST node representing an expression in a statement context.
ForInLoop For-in or for-each-in statement.
ForLoop C-style for-loop statement.
FunctionCall AST node for a function call.
FunctionNode A JavaScript function declaration or expression.

Node type is Rhino.Token.FUNCTION .

FunctionDeclaration : function Identifier ( FormalParameterListopt ) { FunctionBody } FunctionExpression : function Identifieropt ( FormalParameterListopt ) { FunctionBody } FormalParameterList : Identifier FormalParameterList , Identifier FunctionBody : SourceElements Program : SourceElements SourceElements : SourceElement SourceElements SourceElement SourceElement : Statement FunctionDeclaration
JavaScript 1.8 introduces "function closures" of the form
function ([params] ) Expression
In this case the FunctionNode node will have no body but will have an expression.
GeneratorExpression
GeneratorExpressionLoop
IfStatement If-else statement.
InfixExpression AST node representing an infix (binary operator) expression.
Jump Used for code generation.
KeywordLiteral AST node for keyword literals: currently, this , null , true , false , and debugger . Node type is one of Rhino.Token.THIS , Rhino.Token.NULL , Rhino.Token.TRUE , Rhino.Token.FALSE , or Rhino.Token.DEBUGGER .
Label AST node representing a label.
LabeledStatement A labeled statement.
LetNode AST node for let statements and expressions.
Loop Abstract base type for loops.
Name AST node for a simple name.
NewExpression New expression.
NumberLiteral AST node for a Number literal.
ObjectLiteral AST node for an Object literal (also called an Object initialiser in Ecma-262).
ObjectProperty AST node for a single name:value entry in an Object literal.
ParenthesizedExpression AST node for a parenthesized expression.
ParseProblem Encapsulates information for a JavaScript parse error or warning.
PropertyGet AST node for the '.' operator.
RegExpLiteral AST node for a RegExp literal.
ReturnStatement Return statement.
Scope Represents a scope in the lexical scope chain.
ScriptNode Base type for AstRoot and FunctionNode nodes, which need to collect much of the same information.
StringLiteral AST node for a single- or double-quoted string literal.
SwitchCase Switch-case AST node type.
SwitchStatement Switch statement AST node type.
Symbol Represents a symbol-table entry.
ThrowStatement Throw statement.
TryStatement Try/catch/finally statement.
UnaryExpression AST node representing unary operators such as ++ , ~ , typeof and delete . The type field is set to the appropriate Token type for the operator. The node length spans from the operator to the end of the operand (for prefix operators) or from the start of the operand to the operator (for postfix).

The default xml namespace = <expr> statement in E4X (JavaScript 1.6) is represented as a UnaryExpression of node type Rhino.Token.DEFAULTNAMESPACE , wrapped with an ExpressionStatement .

VariableDeclaration A list of one or more var, const or let declarations.
VariableInitializer A variable declaration or initializer, part of a VariableDeclaration expression. The variable "target" can be a simple name or a destructuring form. The initializer, if present, can be any expression.

Node type is one of Rhino.Token.VAR , Rhino.Token.CONST , or Rhino.Token.LET .

WhileLoop While statement.
XmlDotQuery AST node representing an E4X foo.(bar) query expression. The node type (operator) is Rhino.Token.DOTQUERY . Its getLeft node is the target ("foo" in the example), and the getRight node is the filter expression node.

This class exists separately from InfixExpression largely because it has different printing needs. The position of the left paren is just after the dot (operator) position, and the right paren is the final position in the bounds of the node. If the right paren is missing, the node ends at the end of the filter expression.

XmlElemRef AST node for an E4X XML [expr] member-ref expression. The node type is Rhino.Token.REF_MEMBER .

Syntax:

 @opt ns:: opt [ expr ]
Examples include ns::[expr] , @ns::[expr] , @[expr] , *::[expr] and @*::[expr] .

Note that the form [expr] (i.e. no namespace or attribute-qualifier) is not a legal XmlElemRef expression, since it's already used for standard JavaScript ElementGet array-indexing. Hence, an XmlElemRef node always has either the attribute-qualifier, a non- null namespace node, or both.

The node starts at the @ token, if present. Otherwise it starts at the namespace name. The node bounds extend through the closing right-bracket, or if it is missing due to a syntax error, through the end of the index expression.

XmlExpression AST node for an embedded JavaScript expression within an E4X XML literal.
XmlFragment Abstract base type for components that comprise an XmlLiteral object. Node type is Rhino.Token.XML .

XmlLiteral AST node for an E4X (Ecma-357) embedded XML literal.
XmlMemberGet AST node for E4X ".@" and ".." expressions, such as foo..bar , foo..@bar , @foo.@bar , and foo..@ns::* . The right-hand node is always an XmlRef .

Node type is Rhino.Token.DOT or Rhino.Token.DOTDOT .

XmlPropRef AST node for an E4X XML [expr] property-ref expression. The node type is Rhino.Token.REF_NAME .

Syntax:

 @opt ns:: opt name
Examples include name , ns::name , ns::* , *::name , *::* , @attr , @ns::attr , @ns::* , @*::attr , @*::* and @* .

The node starts at the @ token, if present. Otherwise it starts at the namespace name. The node bounds extend through the closing right-bracket, or if it is missing due to a syntax error, through the end of the index expression.

XmlRef Base class for E4X XML attribute-access or property-get expressions.
XmlString AST node for an XML-text-only component of an XML literal expression.
Yield AST node for JavaScript 1.7 yield expression or statement. Node type is Rhino.Token.YIELD .

Yield : yield [no LineTerminator here] [non-paren Expression] ;