In package com.copperleaf.kudzu.parser

class com.copperleaf.kudzu.parser.WordParser

Consume a specific sequence of characters of the input.

Predicts true when:

  • there is remaining input
  • the next character matches the first expected character

Parsing stops when:

  • the next character is not whitespace
  • there is no more input remaining
  • the entire expected string has been consumed

Parsing fails when:

  • there is no more input remaining
  • the next character does not match the corresponding character of the expected string

Fields

expected: String

Constructors

constructor(expected: String, name: String = "")

Consume a specific sequence of characters of the input.

Predicts true when:

  • there is remaining input
  • the next character matches the first expected character

Parsing stops when:

  • the next character is not whitespace
  • there is no more input remaining
  • the entire expected string has been consumed

Parsing fails when:

  • there is no more input remaining
  • the next character does not match the corresponding character of the expected string

Parameters:
  • expected: String
  • name: String = ""

Methods

fun predict(input: ParserContext): Boolean

Parameters:
fun parse(input: ParserContext): <Node, ParserContext>

Parameters:

Extensions

fun checkNotEmpty(input: ParserContext)

Parameters: