# Class AST

- Defined in core/parser/ast.js:49

#####
Index

### Constructors

constructor

### Properties

lexer
selfReferential
text
tokens

### Methods

additive
arrayDeclaration
assignment
ast
constant
consume
equality
expect
expressionStatement
filter
filterChain
identifier
logicalAND
logicalOR
multiplicative
object
parseArguments
peek
peekAhead
peekToken
primary
program
relational
ternary
throwError
unary

##
Constructors

### constructor

- new AST(lexer): AST

- #### Parameters

  - lexer: Lexer

    The lexer instance for tokenizing input

  #### Returns AST

  - Defined in core/parser/ast.js:53

##
Properties

### lexer

lexer: Lexer

- Defined in core/parser/ast.js:55

### selfReferential

selfReferential: {
$locals: {
type: 16;
};
this: {
type: 15;
};
}

- Defined in core/parser/ast.js:56

### text

text: string

- Defined in core/parser/ast.js:68

### tokens

tokens: Token[]

- Defined in core/parser/ast.js:69

##
Methods

### additive

- additive(): ASTNode

- Parses an additive expression.

  #### Returns ASTNode

  The additive expression node.

  - Defined in core/parser/ast.js:235

### arrayDeclaration

- arrayDeclaration(): ASTNode

- Parses an array declaration.

  #### Returns ASTNode

  The array declaration node.

  - Defined in core/parser/ast.js:417

### assignment

- assignment(): ASTNode

- Parses an assignment expression.

  #### Returns ASTNode

  The assignment expression node.

  - Defined in core/parser/ast.js:121

### ast

- ast(text): ASTNode

- Parses the input text and generates an AST.

  #### Parameters

  - text: string

    The input text to parse.

  #### Returns ASTNode

  The root node of the AST.

  - Defined in core/parser/ast.js:67

### constant

- constant(): ASTNode

- Parses a constant.

  #### Returns ASTNode

  The constant node.

  - Defined in core/parser/ast.js:408

### consume

- consume(e1?): Token

- Consumes a token if it matches the expected type.

  #### Parameters

  - `Optional` e1: string

    The expected token type.

  #### Returns Token

  The consumed token.

  - Defined in core/parser/ast.js:509

### equality

- equality(): ASTNode

- Parses an equality expression.

  #### Returns ASTNode

  The equality expression node.

  - Defined in core/parser/ast.js:199

### expect

- expect(...expected?): boolean | Token

- Consumes the next token if it matches any of the expected types.

  #### Parameters

  - `Optional` `Rest`...expected: string[]

    The expected token types.

  #### Returns boolean | Token

  The consumed token if it matches, otherwise false.

  - Defined in core/parser/ast.js:578

### expressionStatement

- expressionStatement(): ASTNode

- Parses an expression statement.

  #### Returns ASTNode

  The expression statement node.

  - Defined in core/parser/ast.js:98

### filter

- filter(baseExpression): ASTNode

- Parses a filter.

  #### Parameters

  - baseExpression: ASTNode

    The base expression to apply the filter to.

  #### Returns ASTNode

  The filter node.

  - Defined in core/parser/ast.js:360

### filterChain

- filterChain(): ASTNode

- Parses a filter chain.

  #### Returns ASTNode

  The filter chain node.

  - Defined in core/parser/ast.js:109

### identifier

- identifier(): ASTNode

- Parses an identifier.

  #### Returns ASTNode

  The identifier node.

  - Defined in core/parser/ast.js:396

### logicalAND

- logicalAND(): ASTNode

- Parses a logical AND expression.

  #### Returns ASTNode

  The logical AND expression node.

  - Defined in core/parser/ast.js:182

### logicalOR

- logicalOR(): ASTNode

- Parses a logical OR expression.

  #### Returns ASTNode

  The logical OR expression node.

  - Defined in core/parser/ast.js:165

### multiplicative

- multiplicative(): ASTNode

- Parses a multiplicative expression.

  #### Returns ASTNode

  The multiplicative expression node.

  - Defined in core/parser/ast.js:253

### object

- object(): ASTNode

- Parses an object.

  #### Returns ASTNode

  The object node.

  - Defined in core/parser/ast.js:438

### parseArguments

- parseArguments(): ASTNode[]

- Parses function arguments.

  #### Returns ASTNode[]

  The arguments array.

  - Defined in core/parser/ast.js:381

### peek

- peek(...expected?): boolean | Token

- Checks if the next token matches any of the expected types.

  #### Parameters

  - `Optional` `Rest`...expected: string[]

    The expected token types.

  #### Returns boolean | Token

  The next token if it matches, otherwise false.

  - Defined in core/parser/ast.js:549

### peekAhead

- peekAhead(i, ...expected?): boolean | Token

- Checks if the token at the specified index matches any of the expected types.

  #### Parameters

  - i: number

    The index to check.

  - `Optional` `Rest`...expected: string[]

    The expected token types.

  #### Returns boolean | Token

  The token at the specified index if it matches, otherwise false.

  - Defined in core/parser/ast.js:559

### peekToken

- peekToken(): Token

- Returns the next token without consuming it.

  #### Returns Token

  The next token.

  - Defined in core/parser/ast.js:533

### primary

- primary(): ASTNode

- Parses a primary expression.

  #### Returns ASTNode

  The primary expression node.

  - Defined in core/parser/ast.js:288

### program

- program(): ASTNode

- Parses a program.

  #### Returns ASTNode

  The program node.

  - Defined in core/parser/ast.js:81

### relational

- relational(): ASTNode

- Parses a relational expression.

  #### Returns ASTNode

  The relational expression node.

  - Defined in core/parser/ast.js:217

### ternary

- ternary(): ASTNode

- Parses a ternary expression.

  #### Returns ASTNode

  The ternary expression node.

  - Defined in core/parser/ast.js:142

### throwError

- throwError(msg, token?): void

- Throws a syntax error.

  #### Parameters

  - msg: string

    The error message.

  - `Optional` token: Token

    The token that caused the error.

  #### Returns void

  - Defined in core/parser/ast.js:492

### unary

- unary(): ASTNode

- Parses a unary expression.

  #### Returns ASTNode

  The unary expression node.

  - Defined in core/parser/ast.js:271