RiddlParserInput

com.ossuminc.riddl.language.parsing.RiddlParserInput
See theRiddlParserInput companion object
abstract class RiddlParserInput extends ParserInput

This class provides the loaded data for fastparse to parse. It is the same as fastparse.IndexedParserInput but adds support for file locations with At. The class is abstract because

Attributes

Companion
object
Source
RiddlParserInput.scala
Graph
Supertypes
class ParserInput
trait IsReachable
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def data: String

The data that will be parsed by fastparse

The data that will be parsed by fastparse

Attributes

Source
RiddlParserInput.scala
def root: URL

The URL from which the data originated.

The URL from which the data originated. If it didn't originate from a network or file location, then this should be empty, URL("") so that URL validity checking will be skipped.

Attributes

Source
RiddlParserInput.scala

Concrete methods

inline override def apply(index: Int): Char

Attributes

Definition Classes
ParserInput -> IsReachable
Source
RiddlParserInput.scala

Attributes

Source
RiddlParserInput.scala
inline override def dropBuffer(index: Int): Unit

Special method for Iterator mode.

Special method for Iterator mode. It drops the prefix of the internal buffer so that all the data strictly before becomes unavailable and index is the first valid element to access.

Attributes

Definition Classes
ParserInput
Source
RiddlParserInput.scala
inline override def innerLength: Int

Attributes

Definition Classes
ParserInput
Source
RiddlParserInput.scala
final inline def isEmpty: Boolean

Attributes

Source
RiddlParserInput.scala
inline override def isReachable(index: Int): Boolean

Shows if we can access to the element at given index.

Shows if we can access to the element at given index.

Attributes

Definition Classes
ParserInput -> IsReachable
Source
RiddlParserInput.scala
inline override def length: Int

Attributes

Definition Classes
ParserInput
Source
RiddlParserInput.scala
final def location(index: Int): At

Attributes

Source
RiddlParserInput.scala
final inline def nonEmpty: Boolean

Attributes

Source
RiddlParserInput.scala
def origin: String

The short origin name to use in error messages as the origin of the error.

The short origin name to use in error messages as the origin of the error. In test cases that do not use a URL, this should be overridden with the word "empty"

Attributes

Returns

Typically the last filename in the URL is sufficient, and that is the default calculated from root.

Source
RiddlParserInput.scala

The purpose of this parsing input.

The purpose of this parsing input. It could be a test name or blank for normal usage

Attributes

Source
RiddlParserInput.scala
def rangeOf(index: Int): (Int, Int)

Attributes

Source
RiddlParserInput.scala
def rangeOf(loc: At): (Int, Int)

Attributes

Source
RiddlParserInput.scala
inline override def slice(from: Int, until: Int): String

Attributes

Returns

Slice of internal data. For IndexedSeq mode it works as regular slice, if until overshoots the end of input, it just ignores it and behaves like until equals to the length of input. Same for Iterator mode, but it requests batches while the index of last retrieved element is less than until and if until is farther away than any element, it ignores this too.

Definition Classes
ParserInput
Source
RiddlParserInput.scala

Concrete fields

val nl: String

Attributes

Source
RiddlParserInput.scala