BackgroundClass Parser

A simple parser for Mahalo expressions.

Hierarchy

  • Parser

Index

Constructors

constructor

  • new Parser(expression: string): Parser
  • Parameters
    • expression: string
    Returns Parser

Properties

ast

The AST for the expression string.

expression

expression:string

The expression string.

i

i:number

The current character index.

paths

paths:Set<string>

A set of key paths that are used inthe expression.

symbol

symbol:object

The current symbol.

Methods

Private accept

  • accept(type: number): boolean
  • Parameters
    • type: number
    Returns boolean

Private addPath

  • Parameters
    Returns void

Private array

Private bracketIdentifier

Private call

Private comparison

compile

  • compile(scope: Object): any
  • Compiles the AST with a given scope.

    Parameters
    • scope: Object
    Returns any

Private expect

  • expect(type: number): void
  • Parameters
    • type: number
    Returns void

Private filter

Private identifier

Private isBracketIdentifier

  • isBracketIdentifier(branch: any): boolean
  • Parameters
    • branch: any
    Returns boolean

Private key

  • key(): object
  • Returns object

Private member

Private memberOrIdentifier

Private multiply

Private nextSymbol

  • nextSymbol(): void
  • Returns void

Private object

  • object(): object
  • Returns object

    Private operand

    Private paren

    Private resolvePath

    • resolvePath(branch: any, path: any): any
    • Parameters
      • branch: any
      • path: any
      Returns any

    Private sum

    Private unary