peg vocabulary
Factor handbook > Vocabulary index


Summary
Parsing expression grammar and packrat parser

Meta-data
Tags:text, parsing
Authors:Chris Double


Words

Tuple classes
ClassSuperclassSlots
left-recursion tupleseed rule-id head next
memo-entry tupleans pos
parse-error tupleposition got messages
parse-failed tupleinput word
parse-result tupleremaining ast
parser tuplepeg compiled id
peg-head tuplerule-id involved-set eval-set


Parsing words
WordSyntax
PEG:


Generic words
WordStack effect
(compile)( peg -- quot )


Symbol words
delayed
error-stack
fail
ignore
input
lrstack
pos


Ordinary words
WordStack effect
(grow-lr)( h p r: ( -- result ) m -- )
(merge-errors)( a b -- c )
(parse)( input parser -- result )
(setup-lr)( l s -- )
2choice( parser1 parser2 -- parser )
2seq( parser1 parser2 -- parser )
3choice( parser1 parser2 parser3 -- parser )
3seq( parser1 parser2 parser3 -- parser )
4choice( parser1 parser2 parser3 parser4 -- parser )
4seq( parser1 parser2 parser3 parser4 -- parser )
<parse-error>( position got messages -- parse-error )
<parse-result>( remaining ast -- parse-result )
action( parser quot -- parser )
add-error( position got message -- )
apply-memo-rule( r m -- ast )
apply-non-memo-rule( r p -- ast )
apply-rule( r p -- ast )
box( quot -- parser )
choice( seq -- parser )
choice*( quot -- paser )
compile( parser -- word )
compile-parser( parser -- word )
compile-parser-quot( parser -- quot )
compiled-parse( state word -- result )
define-parser-word( parser word -- )
delay( quot -- parser )
ensure( parser -- parser )
ensure-not( parser -- parser )
eval-rule( rule -- ast )
execute-parser( word -- result )
failed?( obj -- ? )
fixup-delayed( -- )
grow-lr( h p r m -- ast )
heads( -- cache )
hide( parser -- parser )
input-from( input -- n )
input-slice( -- slice )
lr-answer( r p m -- ast )
memo( pos id -- memo-entry )
merge-errors( -- )
merge-overlapping-errors( a b -- c )
optional( parser -- parser )
packrat( id -- cache )
parse( input parser -- ast )
parse-failed( input word -- * )
peg-cache( -- cache )
preset-parser-word( parser -- parser word )
process-parser-result( result -- result )
process-rule-result( p result -- result )
range( min max -- parser )
recall( r p -- memo-entry )
repeat0( parser -- parser )
repeat1( parser -- parser )
reset-pegs( -- )
rule-id( word -- id )
satisfy( quot -- parser )
semantic( parser quot -- parser )
seq( seq -- parser )
seq*( quot -- paser )
set-memo( memo-entry pos id -- )
setup-growth( h p -- )
setup-lr( r l -- )
sp( parser -- parser )
stop-growth?( ast m -- ? )
token( string -- parser )
update-m( ast m -- )
with-packrat( input quot -- result )


Class predicate words
WordStack effect
left-recursion?( object -- ? )
memo-entry?( object -- ? )
parse-error?( object -- ? )
parse-failed?( object -- ? )
parse-result?( object -- ? )
parser?( object -- ? )
peg-head?( object -- ? )


Files


Children from resource:basis
VocabularySummary
peg.debuggerpeg.debugger vocabulary
peg.ebnfDeclarative EBNF language for writing PEG parsers
peg.parsersAdditional PEG parsers
peg.searchSearch and replace using parsing expression grammars


Children from resource:extra
VocabularySummary
peg.exprSimple expression evaluator using EBNF
peg.javascriptJavaScript parser
peg.pl0Grammar for PL/0 Language


Children
VocabularySummary
peg.privatepeg.private vocabulary