pt_peg_op(3tcl) | Parser Tools | pt_peg_op(3tcl) |
pt_peg_op - Parser Tools PE Grammar Utility Operations
package require Tcl 8.5
package require pt::peg::op 1.0.1
::peg::peg::op called container
::peg::peg::op dechain container
::peg::peg::op drop unreachable container
::peg::peg::op drop unrealizable container
::peg::peg::op flatten container
::peg::peg::op minimize container
::peg::peg::op modeopt container
::peg::peg::op reachable container
::peg::peg::op realizable container
Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the Introduction to Parser Tools. This document is the entrypoint to the whole system the current package is a part of.
This package provides a number of utility commands manipulating a PE grammar (container) in various ways.
The result of the command is a dictionary mapping from each symbol to the symbols it calls. The empty string is the key used to represent the start expression of the grammar.
The grammar in the container is not modified.
The container instance has to expose a method API as is provided by the package pt::peg::container.
caller called | dechain | notes --------------+---------+----------------------- value value | yes | value is passed value leaf | yes | value is passed value void | yes | caller is implied void leaf value | no | generated value was discarded, inlined would not. called may be implied void. leaf leaf | no | s.a. leaf void | no | s.a. void value | no | caller drops value, inlined would not. void leaf | no | s.a. void void | yes |
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
After flattening the expressions it removes unreachable and unrealizable symbols, flattens the expressions again, then optimizes the symbol modes before collapsing symbol chains as much as possible.
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the empty string.
The grammar in the container is directly modified. If that is not wanted, a copy of the original container has to be used.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the list of reachable symbols.
The grammar in the container is not modified.
The container instance has to expose a method API as is provided by the package pt::peg::container.
The result of the command is the list of realizable symbols.
The grammar in the container is not modified.
The container instance has to expose a method API as is provided by the package pt::peg::container.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category pt of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation.
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.
EBNF, LL(k), PEG, TDPL, context-free languages, expression, grammar, matching, parser, parsing expression, parsing expression grammar, push down automaton, recursive descent, state, top-down parsing languages, transducer
Parsing and Grammars
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
1.0.1 | tcllib |