File: tclparam.inc

package info (click to toggle)
tcllib 1.14-dfsg-3%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 33,036 kB
  • sloc: tcl: 148,302; ansic: 14,067; sh: 10,320; xml: 1,766; yacc: 753; pascal: 551; makefile: 129; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (30 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (8)
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

[section {Tcl/PARAM code representation of parsing expression grammars}]

The Tcl/PARAM representation of parsing expression grammars is Tcl
code whose execution will parse input per the grammar. The code is
based on the virtual machine documented in the
[manpage {PackRat Machine Specification}], using its instructions
and a few more to handle control flow.

[para]

Note that the generated code by itself is not functional. It expects
to be embedded into a framework which provides services like the PARAM
state, implementations for the PARAM instructions, etc.

The bulk of such a framework has to be specified through the option
[option -template]. The additional options

[list_begin options]
[opt_def -indent integer]
[opt_def -main string]
[opt_def -namespace string]
[opt_def -prelude string]
[opt_def -proc-command string]
[opt_def -runtime-command string]
[opt_def -self-command string]
[list_end]

provide code snippets which help to glue framework and generated code
together. Their placeholders are in the [emph generated] code.