lexer-next
TypeScript icon, indicating that this package has built-in type declarations

4.1.1 • Public • Published

lexer-next

lexer for recursive descent parsers

npm i lexer-next pnpm add lexer-next yarn add lexer-next

API

# createLexer(tokenize) src/index.ts#L106

    # tokenize

    createLexer(tokenize)  =>

      # (input)

        # input

          string

        (input)  =>

# LexerErrorCauses src/causes.ts#L1
# LexerError src/index.ts#L15
# stackTraceLimit

    number

# captureStackTrace(targetObject, constructorOpt)

    # targetObject

      object

    # constructorOpt

      Function

    captureStackTrace(targetObject, constructorOpt)  =>

      void
# RegExpToken

    # constructor(pattern)

# Token
# is(group, value)

    # group

      string

    # value

      string

    is(group, value)  =>

      boolean
# toJSON()
# create(value, group, source)
# Lexer src/index.ts#L46
# advance() src/index.ts#L50
# expect(group, value) src/index.ts#L77

    # group

      string

    # value

      string

    expect(group, value)  =>

# filter(fn) src/index.ts#L87
# onerror(fn) src/index.ts#L82
# peek() src/index.ts#L59

    peek()  =>

    # group

      string

    # value

      string

    peek(group, value)  =>

# RegExpMatchArrayLike

    # index

      number

    # input

      string

# TokenJson

    # group

      string

    # source

      {

      # index

        number

      # input

        string

      # match

        string []

      }

# value

    string

# ErrorHandler src/index.ts#L31
# FilterFunction src/index.ts#L39

    # (token)

      # token

      (token)  =>

        boolean

# LexerFactory src/index.ts#L95

    # (input)

      # input

        string

      (input)  =>

# Tokenizer src/index.ts#L41

    # (input)

      # input

        string

      (input)  =>

        IterableIterator<RegExpMatchArray>

# createLexer(tokenize) src/index.ts#L106

    # tokenize

    createLexer(tokenize)  =>

      # (input)

        # input

          string

        (input)  =>

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

Package Sidebar

Install

npm i lexer-next

Weekly Downloads

184

Version

4.1.1

License

MIT

Unpacked Size

97.6 kB

Total Files

18

Last publish

Collaborators

  • stagas