Interface ASTParser<R>

interface ASTParser<R> {
    parse(inputStream, considerPosition?, measureLexingTime?, source?): ParsingResult<R>;
}

Type Parameters

Implemented by

Methods

Methods

  • Parses source code, returning a result that includes an AST and a collection of parse issues (errors, warnings). The parsing is done in accordance to the StarLasu methodology i.e. a first-stage parser builds a parse tree which is then mapped onto a higher-level tree called the AST.

    Parameters

    • inputStream: string | CharStream

      the source code.

    • Optional considerPosition: boolean

      if true (the default), parsed AST nodes record their position in the input text.

    • Optional measureLexingTime: boolean

      if true, the result will include a measurement of the time spent in lexing i.e. breaking

    • Optional source: Source

      the optional Source to associate to node positions. the input stream into tokens.

    Returns ParsingResult<R>

Generated using TypeDoc