Handbook
Glossary
parser-quot ( peg -- quot )
Vocabulary
peg
Inputs
peg
an
object
Outputs
quot
an
object
Definition
IN:
peg
GENERIC:
parser-quot
( peg -- quot )
Methods
USING:
accessors
kernel
peg
peg.private
;
M:
action-parser
parser-quot
[
parser>>
execute-parser-quot
]
[
quot>>
]
bi
[
check-action
]
curry
compose
;
USING:
accessors
combinators
peg
peg.private
;
M:
box-parser
parser-quot
quot>>
( -- parser )
call-effect
execute-parser-quot
;
USING:
accessors
combinators.short-circuit
kernel
peg
peg.private
;
M:
choice-parser
parser-quot
parsers>>
execute-parsers-quots
[
0||
]
curry
;
USING:
accessors
assocs
kernel
namespaces
peg
peg.private
quotations
words
;
M:
delay-parser
parser-quot
quot>>
gensym
[
delayed
get
set-at
]
keep
1quotation
;
USING:
accessors
kernel
peg
peg.private
;
M:
ensure-not-parser
parser-quot
parser>>
execute-parser-quot
[
[
input-slice
]
]
dip
[
check-ensure-not
]
compose
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
ensure-parser
parser-quot
parser>>
execute-parser-quot
[
[
input-slice
]
]
dip
[
check-ensure
]
compose
compose
;
USING:
accessors
kernel
peg
peg.parsers.private
peg.private
sequences
;
M:
just-parser
parser-quot
p1>>
execute-parser-quot
[
[
[
remaining>>
empty?
]
1guard
]
?call
]
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
optional-parser
parser-quot
parser>>
execute-parser-quot
[
check-optional
]
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
range-parser
parser-quot
[
min>>
]
[
max>>
]
bi
[
[
[
input-slice
]
]
dip
]
dip
[
parse-range
]
2curry
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
repeat0-parser
parser-quot
parser>>
execute-parser-quot
[
[
input-slice
V{
}
clone
<parse-result>
]
]
dip
[
swap
repeat-loop
]
curry
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
repeat1-parser
parser-quot
parser>>
execute-parser-quot
[
[
input-slice
V{
}
clone
<parse-result>
]
]
dip
[
swap
repeat-loop
repeat1-empty-check
]
curry
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
satisfy-parser
parser-quot
quot>>
[
[
input-slice
]
]
dip
[
parse-satisfy
]
curry
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
semantic-parser
parser-quot
[
parser>>
execute-parser-quot
]
[
quot>>
]
bi
[
check-semantic
]
curry
compose
;
USING:
accessors
combinators.short-circuit
kernel
peg
peg.private
sequences
;
M:
seq-parser
parser-quot
parsers>>
execute-parsers-quots
[
[
parse-seq-element
]
curry
]
map
[
[
input-slice
V{
}
clone
<parse-result>
]
]
dip
[
1&&
]
curry
compose
;
USING:
accessors
kernel
namespaces
peg
peg.private
sequences
unicode
;
M:
sp-parser
parser-quot
parser>>
execute-parser-quot
[
[
input-slice
[
blank?
]
trim-head-slice
input-from
pos
set
]
]
dip
compose
;
USING:
accessors
kernel
peg
peg.private
;
M:
token-parser
parser-quot
symbol>>
[
[
input-slice
]
]
dip
[
parse-token
]
curry
compose
;