Crate minparser

Source
Expand description

Simple parsing tools

This crate is a collection of objects and algorithms shared among different crates that needs to implement a parser.

The predicates module contains some useful functions in order to analize ASCII and Unicode characters. Some of these functions are just wrappers of functions defined in the standard library.

A Position is an object that identifies a (textual) file and a position inside it, represented as a line index and a column index. The main role of a Position object is to uniquely identify a single character or a (textual) token inside a file in order to allow the user to easily find it.

A Pos<T> is just an object containing a T object and a Position. Usually you set T to be equal to char or to a custom token type.

A View<'a, D, F> can be seen as a suffix of a larger string with the position of its first character and some data of type D. The match_tool method can be used to match its prefix with any object implementing the ParseTool trait which represents a pattern that can be sstisfied or not by a string.

Modules§

parser
Parsing tools
predicates
A collection of predicates for characters. Simple predicates for characters
utils
Additional useful tools

Structs§

NoFile
A placeholder that you can use when you don’t want to use the file field in a Position.
NoMatch
The standard error type for a missing match at specified position.
Pos
A positioned object, functionally equivalent to a struct containing an object of type T (the wrapped object) and its position as a Position<FILE> object.
Position
A position.
View
A view on a str to be parsed.

Traits§

Posable
A trait for objects with an associated position
PosableMut
A trait for object with mutable position