blob: 9e7b85cb8e67bd26b3d190f3910cbef76cba5374 (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
[comment {-*- text -*- doctools manpage}]
[vset PGEN_VERSION 1.0.2]
[manpage_begin pt::pgen n [vset PGEN_VERSION]]
[include include/module.inc]
[titledesc {Parser Generator}]
[require pt::pgen [opt [vset PGEN_VERSION]]]
[description]
[include include/ref_intro.inc]
This package provides a command implementing a
[term {parser generator}]
taking parsing expression grammars as input.
[para]
It is the implementation of method [method generate] of [cmd pt], the
[manpage {Parser Tools Application}].
[para]
As such the intended audience of this document are people wishing to
modify and/or extend this part of [cmd pt]'s functionality. Users of
[cmd pt] on the other hand are hereby refered to the applications'
manpage, i.e. [manpage {Parser Tools Application}].
[para]
It resides in the User Package Layer of Parser Tools.
[para][image arch_user_pkg][para]
[section API]
[list_begin definitions]
[call [cmd ::pt::pgen] \
[arg inputformat] \
[arg text] \
[arg resultformat] \
[opt [arg options...]]]
This command takes the parsing expression grammar in [arg text] (in
the format specified by [arg inputformat]), and returns the same
grammar in the format [arg resultformat] as the result of the command.
[para]
The two known input formats are [const peg] and [const json].
Introductions to them, including their formal specifications, can be
found in the [manpage {PEG Language Tutorial}] and
[manpage {The JSON Grammar Exchange Format}]. The packages used to
parse these formats are
[list_begin definitions]
[def [const peg]] [package pt::peg::from::peg]
[def [const json]] [package pt::peg::from::json]
[list_end]
[para]
On the output side the known formats, and the packages used to
generate them are
[list_begin definitions]
[def [const c]] [package pt::peg::to::cparam]
[def [const container]] [package pt::peg::to::container]
[def [const critcl]] [package pt::peg::to::cparam] +
[package pt::cparam::configuration::critcl]
[def [const json]] [package pt::peg::to::json]
[def [const oo]] [package pt::peg::to::tclparam] +
[package pt::tclparam::configuration::tcloo]
[def [const peg]] [package pt::peg::to::peg]
[def [const snit]] [package pt::peg::to::tclparam] +
[package pt::tclparam::configuration::snit]
[list_end]
The options supported by each of these formats are documented
with their respective packages.
[list_end]
[section Example]
[vset MODE pkg][include include/example/full.inc]
[include include/feedback.inc]
[manpage_end]
|