io.github.iltotore.pureparser

Members list

Type members

Classlikes

case class ParseError[+I](expected: Pattern[I], at: Int)

Attributes

Companion
object
Source
ParserError.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ParseError

Attributes

Companion
class
Source
ParserError.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ParseError.type
case class ParseResult[I, A](output: Option[A], errors: Seq[ParseError[I]], endPosition: Int)

The result of a parser. Unlike Either, a ParseResult can contain both an output value and errors, typically in the case of a recovered AST.

The result of a parser. Unlike Either, a ParseResult can contain both an output value and errors, typically in the case of a recovered AST.

Type parameters

A

the output type.

I

the type of a token.

Value parameters

endPosition

the position the parser ended at. It is often supposed to be at the end of the token list (EOF).

errors

the emitted parsing errors. No error means that the parsing was successful.

output

the value outputted by the parser. The Option is empty only if no AST could be recovered.

Attributes

Source
ParseResult.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Parser

Attributes

Source
Parser.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Parser.type
trait RecoverStrategy[I, A]

A recovery strategy, basically a recovery Parser based on the original one.

A recovery strategy, basically a recovery Parser based on the original one.

Type parameters

A

the output type.

I

the type of a token.

Attributes

Companion
object
Source
RecoverStrategy.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
RecoverStrategy.scala
Supertypes
class Object
trait Matchable
class Any
Self type
case class Span(start: Int, end: Int)

A span between two positions in the input list, typically used to track the position of each parsed node.

A span between two positions in the input list, typically used to track the position of each parsed node.

Value parameters

end

the end of this Span (exclusive).

start

the start of this Span (inclusive).

Attributes

Note

it is always assumed that start < end.

Source
Span.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Types

type Parser[I, +A] = (State[Int], Reader[IndexedSeq[I]], Writer[ParseError[I]], Abort[Boolean]) ?=> A

A parser taking tokens of type I, outputting a A.

A parser taking tokens of type I, outputting a A.

It is a combination of the following effects:

Type parameters

A

the output type.

I

the type of a token.

Attributes

Source
Parser.scala