jaskell.parsec

Type members

Classlikes

class Ahead[E, T](val parser: Parsec[E, T]) extends Parsec[E, T]

Ahead use a parser to parse state, return the result and rollback whatever

Ahead use a parser to parse state, return the result and rollback whatever

Version

1.0.0

Companion
object
object Ahead
Companion
class
object Atom

Atom parsers, like one, eof, return and failed, equals and not equals, etc.

Atom parsers, like one, eof, return and failed, equals and not equals, etc.

Version

1.0.0

class Attempt[E, T](val parsec: Parsec[E, T]) extends Parsec[E, T]
class Between[E, T](val open: Parsec[E, _], val close: Parsec[E, _], val parsec: Parsec[E, T]) extends Parsec[E, T]

Between parse the open parser, and then sub parser, and then close parser, return sub parser result if success.

Between parse the open parser, and then sub parser, and then close parser, return sub parser result if success.

Version

1.0.0

Companion
object
object Between
Companion
class
class Binder[A, B, C](val parsec: Parsec[A, B], val f: B => Parsec[A, C]) extends Parsec[A, C]
case class Ch(char: Char, caseSensitive: Boolean) extends Parsec[Char, Char]
case class ChIn(content: String, caseSensitive: Boolean) extends Parsec[Char, Char]
case class ChNone(content: String, caseSensitive: Boolean) extends Parsec[Char, Char]
class Choice[E, T](val parsecs: Seq[Parsec[E, T]]) extends Parsec[E, T]

Choice just the operator <|> in Haskell parsec

Choice just the operator <|> in Haskell parsec

Version

1.0.0

Companion
object
object Choice
Companion
class
object Combinator

Parsec Combinators

Parsec Combinators

Version

1.0.0

case class Combine2[A, B](left: Parsec[A, B], right: Parsec[A, B]) extends Parsec[A, B]
class CommonState[T](val content: Seq[T]) extends State[T]

Common State has int status and transaction market. It can apply to Seq[T] or any serial collection.

Common State has int status and transaction market. It can apply to Seq[T] or any serial collection.

Version

1.0.0

trait Config
case class Cons[A, B, C](prev: Parsec[A, B], next: Parsec[A, C]) extends Parsec[A, C]
case class Count[E, T](p: Parsec[E, T], n: Int) extends Parsec[E, Seq[T]]
case class Crlf(r: Ch, n: Ch) extends Parsec[Char, String]
class Decimal extends Parsec[Char, String]
class Digit extends Parsec[Char, Char]
case class EndBy[E, T](parser: Parsec[E, T], sep: Parsec[E, _]) extends Parsec[E, Seq[T]]

EndBy p sep parses zero or more occurrences of p, separated and ended by sep. Returns a seq of values returned by p.

EndBy p sep parses zero or more occurrences of p, separated and ended by sep. Returns a seq of values returned by p.

Version

1.0.0

class EndBy1[E, T](val parser: Parsec[E, T], val sep: Parsec[E, _]) extends Parsec[E, Seq[T]]

EndBy1 p sep parses one or more occurrences of p, separated and ended by sep. Returns a seq of values returned by p.

EndBy1 p sep parses one or more occurrences of p, separated and ended by sep. Returns a seq of values returned by p.

Version

1.0.0

Companion
object
object EndBy1
Companion
class
class EndOfLine extends Parsec[Char, String]

check next content if a \n char or \r\n

check next content if a \n char or \r\n

Version

1.0.0

Companion
object
object EndOfLine
Companion
class
class Eof[E] extends Parsec[E, Unit]
Companion
object
object Eof
Companion
class
case class Eq[A](x: A) extends Parsec[A, A]
case class Find[E, T](psc: Parsec[E, T]) extends Parsec[E, T]

Find try and next util success or eof.

Find try and next util success or eof.

Version

1.0.0

Companion
object
object Find
Companion
class
case class Int(sign: Parsec[Char, Char], uint: Parsec[Char, String]) extends Parsec[Char, String]
class Is[T](val predicate: T => Boolean) extends Parsec[T, T]

TODO

TODO

Version

1.0.0

Since

2020/07/23 14:18

class Iterator[E, T](val p: Parsec[E, T], val state: State[E]) extends Iterator[T]
class Letter extends Parsec[Char, Char]

TODO

TODO

Version

1.0.0

Since

2020/06/12 18:53

Companion
object
object Letter
Companion
class
class Many[E, T](val parsec: Parsec[E, T]) extends Parsec[E, Seq[T]]

Many try to parse the parse more times, and collect all results into a Seq. Many could success 0 to any times.

Many try to parse the parse more times, and collect all results into a Seq. Many could success 0 to any times.

Companion
object
object Many
Companion
class
class Many1[E, T](val parsec: Parsec[E, T]) extends Parsec[E, Seq[T]]

Many try to parse the parse more times, and collect all results into a Seq. Many must success once at lest

Many try to parse the parse more times, and collect all results into a Seq. Many must success once at lest

Version

1.0.0

Companion
object
object Many1
Companion
class
class ManyTill[E, T, L](val parser: Parsec[E, T], val end: Parsec[E, L]) extends Parsec[E, Seq[T]]

manyTill p end applies parser p zero or more times until parser end succeeds. Returns the list of values returned by p. This parser can be used to scan comments.

manyTill p end applies parser p zero or more times until parser end succeeds. Returns the list of values returned by p. This parser can be used to scan comments.

Version

1.0.0

Companion
object
object ManyTill
Companion
class
class NCh(val char: Char, val caseSensitive: Boolean) extends Parsec[Char, Char]
case class Ne[A](x: A) extends Parsec[A, A]
class Newline extends Parsec[Char, Char]

Newline match \n char

Newline match \n char

Version

1.0.0

Companion
object
object Newline
Companion
class
class NoWhitespace extends Parsec[Char, Char]

NoWhitespace success if the char is't any whitespace.

NoWhitespace success if the char is't any whitespace.

Version

1.0.0

Companion
object
object NoWhitespace
Companion
class
class NoneOf[E](val items: Set[E]) extends Parsec[E, E]

NoneOf success if get a item none of any in prepared

NoneOf success if get a item none of any in prepared

Version

1.0.0

Companion
object
object NoneOf
Companion
class
class One[A] extends Parsec[A, A]
class OneOf[T](val items: Set[T]) extends Parsec[T, T]

OneOf success if item equals one of prepared.

OneOf success if item equals one of prepared.

Version

1.0.0

Companion
object
object OneOf
Companion
class
class Opt[E, T](val p: Parsec[E, T], val otherwise: T) extends Parsec[E, T]

Opt x p tries to apply parser p. If p fails without consuming input, it returns the value x, otherwise the value returned by p.

Opt x p tries to apply parser p. If p fails without consuming input, it returns the value x, otherwise the value returned by p.

Version

1.0.0

Companion
object
object Opt
Companion
class
case class Pack[E, T](value: T) extends Parsec[E, T]
Companion
object
object Pack
Companion
class
trait Parsec[A, +B]
class ParsecException(val status: Any, val message: String) extends Exception

Parser throw ParsecException if failed.

Parser throw ParsecException if failed.

Version

1.0.0

class ScNumber extends Parsec[Char, String]

TODO

TODO

Version

1.0.0

case class SepBy[E, T](parsec: Parsec[E, T], by: Parsec[E, _]) extends Parsec[E, Seq[T]]

sepBy p sep parses zero or more occurrences of p, separated by sep. Returns a list of values returned by p.

sepBy p sep parses zero or more occurrences of p, separated by sep. Returns a list of values returned by p.

Version

1.0.0

class SepBy1[E, T](val parsec: Parsec[E, T], val by: Parsec[E, _]) extends Parsec[E, Seq[T]]

SepBy1 p sep parses one or more occurrences of p, separated by sep. Returns a list of values returned by p.

SepBy1 p sep parses one or more occurrences of p, separated by sep. Returns a list of values returned by p.

Version

1.0.0

Companion
object
object SepBy1
Companion
class
class SepEndBy[E, T](val parser: Parsec[E, T], val sep: Parsec[E, _]) extends Parsec[E, Seq[T]]

SepEndBy p sep parses zero or more occurrences of p, separated and optionally ended by sep, ie. haskell style statements. Returns a seq of values returned by p.

SepEndBy p sep parses zero or more occurrences of p, separated and optionally ended by sep, ie. haskell style statements. Returns a seq of values returned by p.

Version

1.0.0

class SepEndBy1[E, T](val parser: Parsec[E, T], val sep: Parsec[E, _]) extends Parsec[E, Seq[T]]

SepEndBy1 p sep parses one or more occurrences of p, separated and optionally ended by sep. Returns a list of values returned by p.

SepEndBy1 p sep parses one or more occurrences of p, separated and optionally ended by sep. Returns a list of values returned by p.

Version

1.0.0

class Skip[E](val psc: Parsec[E, _]) extends Parsec[E, Unit]

Skip p applies the parser p zero or more times, skipping its result.

Skip p applies the parser p zero or more times, skipping its result.

Version

1.0.0

Companion
object
object Skip
Companion
class
class Skip1[E](val psc: Parsec[E, _]) extends Parsec[E, Unit]

Skip1 p applies the parser p one or more times, skipping its result.

Skip1 p applies the parser p one or more times, skipping its result.

Version

1.0.0

Companion
object
object Skip1
Companion
class
class Skip1Spaces extends Parsec[Char, Unit]

TODO

TODO

Version

1.0.0

class Skip1Whitespaces extends Parsec[Char, Unit]

TODO

TODO

Version

1.0.0

class SkipSpaces extends Parsec[Char, Unit]

TODO

TODO

Version

1.0.0

Companion
object
object SkipSpaces
Companion
class
class SkipWhitespaces extends Parsec[Char, Unit]

TODO

TODO

Version

1.0.0

Companion
object
Companion
class
class Space extends Parsec[Char, Char]

TODO

TODO

Version

1.0.0

Companion
object
object Space
Companion
class
trait State[+E]
class Text(val text: String, val caseSensitive: Boolean) extends Parsec[Char, String]

TODO

TODO

Version

1.0.0

Companion
object
object Text
Companion
class
object Txt

Functions Helper include parsers for Text

Functions Helper include parsers for Text

Version

1.0.0

class TxtState(val txt: String, val newLine: Char) extends CommonState[Char]

Txt State extends Common State trait. It special for text content analyst. Txt state could mark a status point in which line.

Txt State extends Common State trait. It special for text content analyst. Txt state could mark a status point in which line.

Version

1.0.0

Companion
object
object TxtState
Companion
class
case class UDecimal(uint: UInt) extends Parsec[Char, String]
case class UInt(digit: Digit) extends Parsec[Char, String]
class Whitespace extends Parsec[Char, Char]

TODO

TODO

Version

1.0.0

Since

2020/05/09 17:18

Companion
object
object Whitespace
Companion
class

Givens

Givens

given parsecConfig[E]: Monad[[T] =>> Parsec[E, T]]
given textParserConfig[T]: Monad[[T] =>> Parsec[Char, T]]