1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
[comment {-*- tcl -*- --- !doctools ---}]
[manpage_begin pt::peg::export::[vset PACKAGE] n [vset VERSION]]
[include ../module.inc]
[include ../keywords_export.inc]
[titledesc "PEG Export Plugin. Write [vset NAME] format"]
[require pt::peg::export::[vset PACKAGE] [opt [vset VERSION]]]
[require pt::peg::to::[vset PACKAGE]]
[description]
[include ../ref_intro.inc]
This package implements the parsing expression grammar export plugin
for the generation of [vset NAME] markup.
[para]
It resides in the Export section of the Core Layer of Parser Tools and
is intended to be used by [package pt::peg::export], the export
manager, sitting between it and the corresponding core conversion
functionality provided by [package pt::peg::to::[vset PACKAGE]].
[para][image arch_core_eplugins][para]
[para]
While the direct use of this package with a regular interpreter is
possible, this is strongly disrecommended and requires a number of
contortions to provide the expected environment.
The proper way to use this functionality depends on the situation:
[list_begin enumerated]
[enum]
In an untrusted environment the proper access is through the package
[package pt::peg::export] and the export manager objects it
provides.
[enum]
In a trusted environment however simply use the package
[package pt::peg::to::[vset PACKAGE]] and access the core
conversion functionality directly.
[list_end]
[section API]
The API provided by this package satisfies the specification of the
Plugin API found in the [manpage {Parser Tools Export API}]
specification.
[list_begin definitions]
[call [cmd export] [arg serial] [arg configuration]]
This command takes the canonical serialization of a parsing expression
grammar, as specified in section [sectref {PEG serialization format}],
and contained in [arg serial], the [arg configuration], a dictionary,
and generates [vset NAME] markup encoding the grammar.
The created string is then returned as the result of the command.
[list_end]
[include config/[vset CONFIG].inc]
[include ../format/[vset PACKAGE].inc]
[include ../serial/pegrammar.inc]
[include ../serial/pexpression.inc]
[include ../feedback.inc]
[manpage_end]
|