package alba
Alba compiler
Install
Dune Dependency
Authors
Maintainers
Sources
0.4.2.tar.gz
sha256=203ee151ce793a977b2d3e66f8b3a0cd7a82cc7f15550c63d88cb30c71eb5f95
md5=64367c393f80ca784f88d07155da4fb0
doc/alba.fmlib/Fmlib/Character_parser/Normal/index.html
Module Character_parser.Normal
Normal Parser.
State
: User state.Final
: Final result type of the parser.Semantic
: Semantic error message (triggered byfail message
)Context_msg
: Each new context is opened with a value of typeContext_msg
.
Parameters
module State : Module_types.ANY
module Final : Module_types.ANY
module Semantic : Module_types.ANY
module Context_msg : Module_types.ANY
Signature
Modules and Types
module Context : CONTEXT with type msg = Context_msg.t
module Error :
Generic_parser.ERROR
with type expect = string * Indent.t
and type semantic = Semantic.t
type final = Final.t
Combinators
include COMBINATORS
with type expect = string
and type semantic = Semantic.t
and type state = State.t
and type context = Context_msg.t
Basic Combinators
include Generic_parser.COMBINATORS with type semantic = Semantic.t
type semantic = Semantic.t
val return : 'a -> 'a t
val succeed : 'a -> 'a t
Position and State Combinators
val get_position : Position.t t
type state = State.t
Indentation Combinators
val get_bounds : (int * int option) t
Context Combinator
type context = Context_msg.t
val expect : (char -> bool) -> string -> char t
Character Combinators
val expect_end : unit t
val whitespace_char : char t
val whitespace : int t
val one_of_chars : string -> string -> unit t
val string : string -> unit t
val char : char -> unit t
val space : unit t
val letter : char t
val digit : char t
val word : (char -> bool) -> (char -> bool) -> string -> string t
Parser
During Parsing
include PARSER
val needs_more : parser -> bool
Does the parser need more tokens (i.e. either put_char
or put_end
)?
val has_ended : parser -> bool
Has the parser terminated (opposite of needs_more p
)?
val has_succeeded : parser -> bool
Has the parser succeeded
val position : parser -> Position.t
The current position.
val line : parser -> int
The current line.
val column : parser -> int
The current column.
val error_tabs : parser -> int list
put_char p c
feeds the parser p
with the character token c
. Only possible if needs_more p
is valid.
Terminated Parser
The result the parser has produced which is either a final value or a list of dead ends. Only valid if the parser has terminated.
The list of tokens (i.e. optional characters) which the parser has not processed at the point of termination.
val lookahead_string : parser -> string
Create and Run the Parser
make pc st
makes a parser from a parser combinator pc
with the initial state st
.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page