2 '<expr>' [ DEFUN | DEFVAR | TERM ] * '</expr>'
4 TERM = [ INT | STRING | SYMBOL | LIST | VAR | FUNCALL ]
7 '<defun fname="' FNAME ? ">'
13 '<args>' FIXED ? OPTIONAL ? REST ? '</args>'
14 | '<args-unevalled>' FIXED ? OPTIONAL ? REST ? '</args-unevalled>'
17 '<fixed> VAR + '</fixed>'
20 '<optional>' VAR + '<optional>'
23 '<rest>' VAR '</rest>'
25 DEFVAR = DEFVAR-INT DEFVAR-STR DEFVAR-SYM
28 '<defvar vname="' VNAME '">'
30 [ INT POSSIBLE-INT-VALUE ? ] ?
34 <possible-value> [ INT | '<range>' INT INT '</range>' ] + </possible-value>
37 '<defvar vname"' VNAME '">'
39 [ STR DEFVAR-STR_VALUE ? ] ?
43 <possible-value> STR + </possible-value>
46 '<defvar vname"' VNAME '">'
48 [ SYMBOL POSSIBLE-SYM-VALUE ? ] ?
52 <possible-value> SYMBOL + </possible-value>
55 '<description>' [ TEXT | GETTEXT ] '</description>'
58 '<gettext>' TEXT '</gettext>'
61 '<integer>' INTEGER '</integer>'
63 '<string>' STRING '</string>'
65 '<symbol>' NAME '</symbol>'
67 '<list>' TERM * '</list>' | <list/>
70 '<varref vname="' VNAME '"/>'
73 '<funcall fname="' FNAME '">' TERM * '</funcall>'
79 | LT | LE | EQ | GE | GT | NOTEQ
80 | ADD | SUB | MUL | DIV | MOD
81 | LOGAND | LOGIOR | LOGXOR | LSH
82 | APPEND | CONCAT | LENGTH | NTH | COPY | INS | DEL
83 | PROGN | IF | WHEN | COND
84 | LOOP | WHILE | FOREACH | BREAK | RETURN
87 ;; TERM has a value, and is evaluated to a TERM as below.
88 ;; INT has an integer value, and is evaluated to itself .
89 ;; STRING has a string value, and is evaluated to itself.
90 ;; SYMBOL has a symbol value, and is evaluated to itself.
91 ;; LIST has a list value and, is evaluated to itself.
92 ;; VAR has a value of TERM that is assigned to the variable,
93 ;; and is evalued to that TERM.
94 ;; FUNCALL has a value of TERM that is returned by that function,
95 ;; and is evalued to that TERM.
97 INTTERM = INT | VAR (value is INT) | FUNCALL (return INT)
98 STRTERM = STR | VAR (value is STR) | FUNCALL (return STR)
99 SYMTERM = SYMBOL | VAR (value is SYMBOL) | FUNCALL (return SYMBOL)
100 LISTTERM = LIST | VAR (value is LIST) | FUNCALL (return LIST)
103 ;; Here after, when an argument is TERM, it is given to a function
104 ;; without being evaluted. Otherwise, an evaluated term is given.
106 SET = '<set vname="' VNAME '">' ANYTERM '</set>'
107 ADD = '<add>' INTTERM + '</add>'
108 | '<add vname="' VNAME '">' INTTERM + '</add>'
109 SUB = '<sub>' INTTERM + '</sub>'
110 | '<sub vname="' VNAME '">' INTTERM + '</sub>'
111 MUL = '<mul>' INTTERM + '</mul>'
112 | '<mul vname="' VNAME '">' INTTERM + '</mul>'
113 DIB = '<div>' INTTERM + '</div>'
114 | '<div vname="' VNAME '">' INTTERM + '</div>'
115 MOD = '<mod>' INTTERM INTTERM '</mod>'
116 | '<mod vname="' VNAME '">' INTTERM '</div>'
117 LOGAND = '<logand> INTTERM + '</logand>'
118 | '<logand vname="' VNAME '">' INTTERM + '</logand>'
119 LOGIOR = '<logior> INTTERM + '</logior>'
120 | '<logior> vname="' VNAME '">' INTTERM + '</logior>'
121 LOGXOR = '<logxor> INTTERM + '</logxor>'
122 | '<logxor> vname="' VNAME '">' INTTERM + '</logxor>'
123 LSH = '<lsh>' INTTERM INTTERM '</lsh>'
124 | '<lsh vname="' VNAME '">' INTTERM '</mul>'
125 LT = '<lt>' INTTERM INTTERM '</lt>'
126 LE = '<le>' INTTERM INTTERM '</le>'
127 EQ = '<eq>' INTTERM INTTERM '</eq>'
128 NOTEQ = '<noteq>' INTTERM INTTERM '</noteq>'
129 GE = '<ge>' INTTERM INTTERM '</ge>'
130 GT ='<gt>' INTTERM INTTERM '</gt>'
131 APPEND = '<append>' ANYTERM + '</append>'
132 CONCAT = '<concat>' [ INTTERM | STRTERM | LISTTERM ] + '</concat>'
133 LENGTH = '<length>' [ STRTERM | LISTTERM ] '</length>'
134 NTH = '<nth>' INTTERM [ STRTERM | LISTTERM ] '</nth>'
135 COPY = '<copy>' LISTTERM '</nth>'
136 INS = '<ins vname="' VNAME '">' INTTERM [ STRTERM | LISTTERM ] '</ins>'
137 DEL = '<del vname="' VNAME '">' INTTERM INTTERM '</ins>'
138 AND = '<and>' TERM + '</and>'
139 OR = '<or>' TERM + '</or>'
140 NOT = '<not>' TERM '</not>'
141 PROGN = '<progn>' TERM * '</progn>'
142 IF = '<if>' TERM TERM TERM ? '</if>'
143 WHEN = '<when>' TERM TERM * '</when>'
144 COND = '<cond>' LIST + '</cond>'
145 LOOP = '<loop>' TERM + '</loop>'
146 WHILE = '<while>' TERM + '</while>'
147 FOREACH = '<foreach vname="' VNAME '">' TERM + '</foreach>'
148 BREAK = '<break>' ANYTERM ? '</break>'
149 RETURN = '<return>' ANYTERM ? '</return>'
150 QUOTE = '<quote>' TERM '</quote>'
151 EVAL = '<eval>' TERM '</eval>'
152 TYPE = '<type>' ANYTERM '</type>'