1# -*- tcl -*- ascii85.pcx
2# Syntax of the commands provided by package ascii85.
3#
4# For use by TclDevKit's static syntax checker.
5# See http://www.activestate.com/solutions/tcl/
6# See http://aspn.activestate.com/ASPN/docs/Tcl_Dev_Kit/4.0/Checker.html#pcx_api
7# for the documentation describing the format of the code contained in this file
8#
9
10package require pcx
11pcx::register ascii85
12pcx::tcldep   1.0 needs tcl 8.4
13
14namespace eval ::ascii85 {}
15
16# Using the indirections below looks to be quite pointless, given that
17# they simply substitute the commands for others. I am doing this for
18# two reasons.
19
20# First, the rules coming after become self-commenting, i.e. a
21# maintainer can immediately see what an argument is supposed to be,
22# instead of having to search elsewhere (like the documentation and
23# implementation). In this manner our definitions here are a type of
24# semantic markup.
25
26# The second reason is that while we have no special checks now we
27# cannot be sure if such will (have to) be added in the future. With
28# all checking routed through our definitions we now already have the
29# basic infrastructure (i.e. hooks) in place in which we can easily
30# add any new checks by simply redefining the relevant command, and
31# all the rules update on their own. Mostly. This should cover 90% of
32# the cases. Sometimes new checks will require to create deeper
33# distinctions between different calls of the same thing. For such we
34# may have to update the rules as well, to provide the necessary
35# information to the checker.
36
37interp alias {} ascii85::checkLineLength  {} checkInt  ; #
38interp alias {} ascii85::checkWrapChar    {} checkWord ; #
39interp alias {} ascii85::checkData        {} checkWord ; #
40
41#pcx::message FOO {... text ...} type
42#pcx::scan <VERSION> <NAME> <RULE>
43
44pcx::check 1.0 std ::ascii85::decode \
45    {checkSimpleArgs 1 1 {
46	ascii85::checkData
47    }}
48
49# NOTE: Is '-maxlen' < 0 allowed?
50# Doc doesn't forbid it, code doesn't catch it.
51# May crash it however, i.e be a bug.
52# Check testsuite.
53pcx::check 1.0 std ::ascii85::encode \
54    {checkSimpleArgs 1 -1 {
55	{checkSwitches 1 {
56	    {-maxlen   ascii85::checkLineLength}
57	    {-wrapchar ascii85::checkWrapChar}
58	} {checkSimpleArgs 1 1 {
59	    ascii85::checkData
60	}}}
61    }}
62
63# Initialization via pcx::init.
64# Use a ::ascii85::init procedure for non-standard initialization.
65pcx::complete
66