source: specdomain/trunk/src/specdomain/test/test_doc.rst @ 983

Last change on this file since 983 was 983, checked in by jemian, 10 years ago

refs #8, now parses most macro definitions (just the initial declaration, not the muiltiline content, for now)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision URL Header
File size: 3.6 KB
Line 
1.. $Id: test_doc.rst 983 2012-06-28 21:34:54Z jemian $
2
3===============
4Acceptance Test
5===============
6
7If all links are valid, test is done successfully.
8
9
10Directives
11==========
12
13A *directive* can be used to define the anchor point of a reference.
14Index entries will point back to the *directive*.  If the item
15defined in the directive is not obtained from the source code,
16then define it here, like these.  All of these directives should
17have entries in an Index.
18
19SPEC Macros
20^^^^^^^^^^^
21
22.. spec:def:: def_macro content
23
24   :param arg: list of arguments is optional
25   :type arg: str
26
27   This is a standard SPEC macro definition.
28
29.. spec:def:: def_function(arguments)
30
31   :param str arguments: named argument(s) to this function
32
33.. spec:rdef:: rdef_macro content
34
35   This is a SPEC macro definition with symbols that are evaluated only at run-time.
36
37.. spec:cdef:: cdef("cdef_macro", "content", "cdef_part", flags)
38
39   :param str cdef_macro: one-word name (quoted string) for this macro chain
40   :param str content: SPEC code to be inserted (typically a single macro)
41   :param str cdef_part: name for this part of the chained macro
42   :param str flags: see the manual
43
44..
45        SPEC cdef macro definitions
46        ++++++++++++++++++++++++++++++++
47       
48        .. TODO: pull this subsection once this part is made to work
49       
50        There are several different signatures for SPEC's ``cdef`` macro definition.
51        Here are some examples pulled from the ``SPEC.D`` directory.
52       
53        .. note::  At present, the argument list from ``cdef`` macro definitions
54           is not being parsed or handled.  This will be fixed in a future revision.
55           
56        .. literalinclude:: cdef-examples.mac
57           :linenos:
58           :language: guess
59
60SPEC Variables
61^^^^^^^^^^^^^^
62
63These are some representative variable declarations in SPEC macro source files::
64
65        global  BCDA_GM[]
66       
67           global    theta[]
68           global    2theta[]  # this will not be found
69           global    _motor[]
70       
71        global kohzu_PV kohzuMV_PV UND_PV Und_Off UNDE_TRACK_ON
72        global       kohzuStop_PV kohzuMode_PV      kohzuMove_PV
73            global CCD_OVERHEAD_SECS_MEASURED   # measured readout time
74       
75            global @A_name[] @B_name[]
76               unglobal @A_name
77               unglobal @B_name
78
79Variables in Directives
80+++++++++++++++++++++++
81
82These define the variable.
83
84global variable declaration:
85
86        .. spec:global:: A[]
87       
88           ``A[]`` contains the values of all motors
89
90local variable declaration: 
91
92        .. spec:local:: i
93       
94           ``i`` is a local loop counter
95
96array variable declaration:
97
98        *--tba--*
99
100Variables in Roles
101+++++++++++++++++++++++
102
103These items should link back to the directives above.
104
105* global variable declaration:  :spec:global:`A[]`
106* local variable declaration:   :spec:local:`i`
107* array variable declaration:   *--tba--*
108* constant declaration:                 *--tba--*
109
110
111Roles
112=====
113
114A *role* refers to a *directive* (makes a link to a *directive* defined elsewhere).
115Each of these items should produce a valid link.  Additionally, every call to a
116*role* should produce an index entry.
117
118SPEC Macros
119^^^^^^^^^^^
120
121These items should link back to the directives above.
122
123* macro definition:                             :spec:def:`def_macro`
124* function definition:                          :spec:def:`def_function(arguments)`
125* runtime-defined macro definition: :spec:rdef:`rdef_macro`
126* chained macro definition:             :spec:cdef:`cdef("cdef_macro", "content", "cdef_part", flags)`
127
128SPEC Variables
129^^^^^^^^^^^^^^
130
131The SPEC macro language provides for several types of variable:
132
133* global variables, such as:    :spec:global:`A[]`
134* local variable, such as:      :spec:local:`i`
135* array variable declaration:   *--tba--*
136* constant declaration:                 *--tba--*
137
138Source code documentation
139============================
140
141.. toctree::
142   :maxdepth: 2
143   :glob:
144
145   *.mac
146   python-example-source
Note: See TracBrowser for help on using the repository browser.