]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/doc/spec.tex
Added some rules in the "Left Drop" section.
[helm.git] / helm / DEVEL / mathml_editor / doc / spec.tex
1 \documentclass[10pt]{article}
2
3 \usepackage{a4wide}
4 \usepackage{palatino}
5 \usepackage{euler}
6 \usepackage{amssymb}
7 \usepackage{stmaryrd}
8
9 \title{A MathML Editor Based on \TeX{} Syntax\\Formal Specification}
10 \author{Paolo Marinelli\\Luca Padovani\\\small\{{\tt pmarinel},{\tt lpadovan}\}{\tt @cs.unibo.it}\\\small Department of Computer Science\\\small University of Bologna}
11 \date{}
12
13 \newcommand{\tmap}[1]{\llbracket#1\rrbracket}
14 \newcommand{\tadvance}{\vartriangle}
15 \newcommand{\tnext}{\rhd}
16 \newcommand{\G}{\texttt{g}}
17 \newcommand{\PNODE}{\texttt{p}}
18 \newcommand{\SNODE}{\texttt{s}}
19 \newcommand{\INODE}{\texttt{i}}
20 \newcommand{\NNODE}{\texttt{n}}
21 \newcommand{\ONODE}{\texttt{o}}
22 \newcommand{\CNODE}{\texttt{c}}
23 \newcommand{\TABLE}{\texttt{table}}
24 \newcommand{\SP}{\texttt{sp}}
25 \newcommand{\SB}{\texttt{sb}}
26 \newcommand{\CELL}{\texttt{cell}}
27 \newcommand{\ROW}{\texttt{row}}
28 \newcommand{\SLDROP}{\blacktriangleleft}
29 \newcommand{\NLDROP}{\vartriangleleft}
30 \newcommand{\RGROUP}{\vartriangleleft_{rg}}
31 \newcommand{\NLDGP}{\vartriangleleft_{g}}
32 \newcommand{\NLDSCRIPT}{\vartriangleleft_{s}}
33 \newcommand{\NLDMACRO}{\vartriangleleft_{c}} % at the moment it's not used.
34
35 \begin{document}
36
37 \maketitle
38
39 \section{Tokens}
40
41 The following tokens are defined:
42
43 \begin{tabular}{lllp{0.5\textwidth}}
44   \textbf{\TeX{}} & \textbf{Notation} & \textbf{Node} & \textbf{Description} \\
45 \hline
46   \verb+{+ & $\mathrm{begin}$ & \texttt{g} & Beginning of a group \\
47   \verb+}+ & $\mathrm{end}$ & & End of a group \\
48   \verb+$+ & $\$$ & \texttt{math} & Math shift \\ %$ \\
49   & &  & End-of-line \\
50   \verb+#+$i$ & $p(i)$ & \texttt{p} & Parameter \\
51   \verb+^+ & $\uparrow$ & \texttt{sp} & Superscript \\
52   \verb+_+ & $\downarrow$ & \texttt{sb} & Subscript \\
53   & $\square$ & & Space-like character that can be ignored \\
54   & $s$ & \texttt{s} & Space-like character that may be significant \\
55   letter & $i(v)$ & \texttt{i} & Identifier $v$ \\
56   digit & $n(v)$ & \texttt{n} & Number $v$ \\
57   other & $o(v)$ & \texttt{o} & Other character or operator $v$ \\
58   \verb+~+ & $\sim$ & & Active character \\
59   \verb+%+ & $\%$ & & Comment \\
60   control & $c(v)\langle\alpha_1,\dots,\alpha_n\rangle$ & \texttt{c} & 
61     Control sequence $v$ that expects the $\alpha_1,\dots,\alpha_n$ sequence of tokens. \\
62   backspace & $\vartriangleleft$ & & \\
63   backspace & $\blacktriangleleft$ & & \\
64 \end{tabular}
65
66 %% Some tokens are mapped directly into nodes of the TML tree. The following functions shows
67 %% the mapping:
68
69 \begin{tabular}{r@{\quad$=$\quad}l}
70   $\tmap{\{}$ & \verb+g+ \\
71   $\tmap{p(i)}$ & \verb+p[@index=+$i$\verb+]+ \\
72   $\tmap{p_l(i)}$ & \verb+p[@index=+$i$\verb+][@left-open='1']+ \\
73   $\tmap{p_r(i)}$ & \verb+p[@index=+$i$\verb+][@right-open='1']+ \\
74   $\tmap{s}$ & \verb+s+ \\
75   $\tmap{\uparrow}$ & \verb+sp+ \\
76   $\tmap{\downarrow}$ & \verb+sb+ \\
77   $\tmap{i(v)}$ & \verb+i[@value=+$v$\verb+]+ \\
78   $\tmap{n(v)}$ & \verb+n[@value=+$v$\verb+]+ \\
79   $\tmap{o(v)}$ & \verb+o[@value=+$v$\verb+]+ \\
80   $\tmap{c(v)\langle\alpha_1,\dots,\alpha_n\rangle}$ & \verb+c[@name=+$v$\verb+][^+$\tmap{\alpha_1}\cdots\tmap{\alpha_n}$\verb+$]+\\
81 \end{tabular}
82 %$
83
84 %% \section{Description and Semantics of the Pattern Language}
85
86 %% \begin{eqnarray*}
87 %%   \mathit{NodeTest} & ::= & \mathtt{*} \\
88 %%   & | & \mathit{ElementType} \\
89 %%   & | & \mathtt{<}~\mathit{ElementTypePattern}~\mathtt{>} \\[1ex]
90 %%   \mathit{ElementTypePattern} & ::= & \mathtt{*} \\
91 %%   & | & \mathit{ElementType}~(\mathtt{|}~\mathit{ElementType})^* \\
92 %%   & | & \mathtt{!}\mathit{ElementType}~(\mathtt{|}~\mathit{ElementType})^*\\[1ex]
93 %%   \mathit{NodePattern} & ::= & \mathit{NodeTest}~\mathit{AttributeQualifier}^*\\[1ex]
94 %%   \mathit{AttributeQualifier} & ::= & \mathtt{[@}\mathit{AttributeTest}\mathtt{]}\\
95 %%   & | & \mathtt{[!@}\mathit{AttributeTest}\mathtt{]}\\[1ex]
96 %%   \mathit{AttributeTest} & ::= & \mathit{AttributeName} \\
97 %%   & | & \mathit{AttributeName}\mathtt{='}\mathit{Text}\mathtt{'}
98 %% \end{eqnarray*}
99
100 \section{Insert Rules}
101
102 \paragraph{Begin Group:} $\{$
103
104 \begin{description}
105   \item{\verb+table/cursor+}\\
106    create a \texttt{row} node, create a \texttt{cell} node, create a \texttt{g} node,
107     append the cursor to the \texttt{g} node, append the \texttt{g} node to the \texttt{cell} node,
108     append the \texttt{cell} node to the \texttt{row} node, append the \texttt{row} node to the
109     \texttt{c} node 
110   \item{\verb+cursor+} \\ create a \texttt{g} node, replace the cursor with the new \texttt{g} node,
111     append the cursor to the new \texttt{g} node
112 \end{description}
113
114 % CASE: c/g[!@id]/cursor
115
116 % CASE: c/cursor
117
118 % ELSE:
119
120 % do_begin:
121 % CASE: c[@table='1']/cursor
122 % ELSE:
123 %   create a g node with id, replace the cursor with the fresh g and append
124 %   the cursor as only child of it
125
126 \paragraph{End Group:} $\}$
127
128 \begin{description}
129   \item{\verb+g[@id]/cursor+}\\
130   remove the cursor, put $\tadvance$ after the \texttt{g} node
131   \item{\verb+row/cell/g/cursor+}\\
132   remove the cursor, put $\tadvance$ after the \texttt{row} node
133   \item{\verb+math/g[!@id]/cursor+}\\
134   ?
135   \item{\verb+cursor+}\\
136   error ?
137 \end{description}
138
139 \paragraph{Math Shift:} $\$$
140
141 \begin{description}
142   \item{\verb+tex/cursor+}\\
143   create a \texttt{math} node, create a \texttt{g} node, append the \texttt{g} node
144     as child of the \texttt{math} node, append the cursor as child of the \texttt{g} node
145   \item{\verb+math[@display='1']/g[!@id][*#]/cursor+}\\
146   append the cursor as last child of the \texttt{math} node
147   \item{\verb+math/g[!@id][*#]/cursor+}\\
148   remove the cursor
149   \item{\verb+math[!display='1']/g[!@id]/cursor+}\\
150   set \verb+display='1'+ in the \texttt{math} node
151   \item{\verb+math/g[!@id]+}\\
152   append the cursor after the \texttt{math} node
153   \item{\verb+math/cursor+}\\
154   remove the cursor
155   \item{\verb+cursor+} \\
156   error ?
157 \end{description}
158
159 % do_shift:
160 % CASE: tex/cursor
161 %   create a math node. create a g node. append g as child of math.
162 %   append the cursor as child of g
163 % CASE: math[@display='1']/g[!@id][*#]/cursor
164 %   append the cursor as last child of math
165 % CASE: math/g[!@id][*#]/cursor
166 %   remove the cursor. Editing is done
167 % CASE: math[!display='1']/g[!@id]/cursor
168 %   set the display attribute to '1'
169 % CASE: math/g[!@id]
170 %   append the cursor after math (?)
171 % CASE: math/cursor
172 %   remove the cursor. Editing is done
173 % ELSE:
174 %   error
175
176 \paragraph{Align:} $\&$
177
178 \begin{description}
179   \item{\verb+g[@id]/cursor+}\\
180   create a \texttt{row} node, create a \texttt{cell} node, create a \texttt{g} node,
181     append the cursor to the new \texttt{g} node, append the \texttt{cell} node to the
182     the \texttt{row} node ?
183   \item{\verb+row/cell/g/cursor+}\\
184   create the \texttt{g} node, create the \texttt{cell} node, append the cursor
185     as child of the new \texttt{g} node, append the new \texttt{g} node to the new
186     \texttt{cell} node after the old \texttt{cell} node
187   \item{\verb+cursor+}\\
188   error
189 \end{description}
190
191 % do_align:
192 % CASE: g[@id]/cursor
193 %   create a row node. create a cell node. create a g node. append the
194 %   cursor to g, append the g to cell, append the cell to row, ???
195 % CASE: row/cell/g/cursor
196 %   create a g node. create a cell node. appent the cursor to g,
197 %   append the g to cell, insert the new cell after the existing cell
198 % ELSE:
199 %   error
200
201 \paragraph{End-of-line:}
202
203 % do_eol:
204 %   ignored
205
206 \paragraph{Parameter:} $p(i)$
207 % do_parameter:
208 %   ignored
209
210 \paragraph{Superscript:} $\uparrow$
211
212 \begin{description}
213   \item{\verb+<g|p>[^#]/cursor+}\\
214   create a \SP{} node, create a \G{} node, replace the cursor with the \SP{} node,
215     append the \G{} node as first child of the \SP{} node, append the cursor as last
216     child of the \SP{} node
217   \item{\verb+<g|p>[*#]/cursor+}\\
218   create a \SP{} node, replace \texttt{*} with the \SP{} node, append \texttt{*} to
219     the \SP{} node, append cursor to the \SP{} node
220   \item{\verb+sp[^*#$][!@over='1']/cursor+}\\ %$
221   set \verb+over='1'+ in the \SP{} node
222   \item{\verb+sp[^*#$][@over='1']/cursor+}\\ %$
223   error
224   \item{\verb+cursor+}\\
225   error ?
226 \end{description}
227 % do_superscript:
228 % CASE: g[^#]/cursor
229 %   create sp node. create g node, replace cursor with sp, append g to sp, append cursor to sp
230 % CASE: g[*#]/cursor
231 %   create sp node, replace * with sp, append * to sp, append cursor to sp
232 % CASE: sp[^*#$][!@over='1']/cursor
233 %   set over='1' in sp node
234 % CASE: sp[^*#$][@over='1']/cursor
235 %   error
236 % ELSE:
237 %   error ?
238
239 \paragraph{Subscript:} $\downarrow$
240
241 \begin{description}
242   \item{\verb+<g|p>[^#]/cursor+}\\
243   create a \SB{} node, create a \G{} node, replace the cursor with the \SB{} node,
244     append the \G{} node as first child of the \SB{} node, append the cursor as last
245     child of the \SB{} node
246   \item{\verb+<g|p>[*#]/cursor+}\\
247   create a \SB{} node, replace \texttt{*} with the \SB{} node, append \texttt{*} to
248     the \SB{} node, append cursor to the \SB{} node
249   \item{\verb+sb[^*#$][!@under='1']/cursor+}\\ %$
250   set \verb+under='1'+ in the \SB{} node
251   \item{\verb+sb[^*#$][@under='1']/cursor+}\\ %$
252   error
253   \item{\verb+cursor+}\\
254   error ?
255 \end{description}
256 % do_subscript:
257 % CASE: g[^#]/cursor
258 %   create sb node. create g node, replace cursor with sb, append g to sb, append cursor to sb
259 % CASE: g[*#]/cursor
260 %   create sb node, replace * with sb, append * to sb, append cursor to sb
261 % CASE: sb[^*#$][!@under='1']/cursor
262 %   set over='1' in sb node
263 % CASE: sb[^*#$][@under='1']/cursor
264 %   error
265 % ELSE:
266 %   error ?
267
268 \paragraph{Ignorable space:} $\square$
269
270 % do_ignorable_space:
271 %   do nothing?
272
273 \paragraph{Space:} $s$
274
275 \begin{description}
276   \item{\verb+cursor+}\\
277   create \SNODE{} node, replace cursor with the \SNODE{} node, append
278   $\tadvance$ after \SNODE{} node
279 \end{description}
280
281 % do_space
282 %   create s node, replace cursor with s, append \advance after s
283
284 \paragraph{Identifier:} $i(v)$
285
286 \begin{description}
287   \item{\verb+cursor+}\\
288   create an \INODE{}, set \verb+value=+$v$ in the \INODE{}, replace
289   cursor with \INODE{}, append $\tadvance$ after the \INODE{} node
290 \end{description}
291
292 % do_identifier
293 %   create i node, replace cursor with i, append \advance after i
294
295 \paragraph{Number:} $n(v)$
296
297 \begin{description}
298   \item{\verb+cursor+}\\
299   create an \NNODE{}, set \verb+value=+$v$ in the \NNODE{}, replace
300   cursor with \NNODE{}, append $\tadvance$ after the \NNODE{} node
301 \end{description}
302
303 % do_number
304 %   create n node, replace cursor with n, append \advance after n
305
306 \paragraph{Apostrophe:} $o({}')$
307
308 \begin{description}
309   \item{\verb+<g/p>[(sp[*#$]/g[o[@name='prime']$])#]/cursor+}\\
310   create a \ONODE{} node, set \verb+name='prime'+ in the \ONODE{},
311     append the \ONODE{} to the innermost \G{} node
312   \item{\verb+<g|p>[(sb[^sp[^*#$]/g[o[@name='prime']]$])#]/cursor+}\\
313   create a \ONODE{} node, set \verb+name='prime'+ in the \ONODE{},
314     append the \ONODE{} to the innermost \G{} node
315   \item{\verb+<g|p>[*#]/cursor+}\\
316   create a \ONODE{} node, set \verb+name='prime'+ in the \ONODE{},
317     create a \SP{} node, create a \G{} node, replace \texttt{*} with \SP{} node,
318     append the new \G{} node to the \SP{} node, append the \ONODE{}
319     node to the new \G{} node
320   \item{\verb+<g|p>[^#]/cursor+}\\
321   error?
322   \item{\verb+cursor+}\\
323   cursor is not in a group, error?
324 \end{description}
325
326 % do_apostrophe
327 % CASE: g[(sp[^*#$]/g[o[@name='prime']$])#]/cursor
328 %   append a new o[@name='prime'] node to the inner g node
329 % CASE: g[(sb[^sp[^*#$]/g[o[@name='prime']]$])#]/cursor
330 %   append a new o[@name='prime'] node to the inner g node
331 % CASE: g[*#]/cursor
332 %   create sp node, create g node, replace * with sp, append * to sp, append g to sp,
333 %   append a new o[@name='prime'[ node to the new g node
334 % CASE: g[^#]/cursor
335 %   error?
336 % ELSE:
337 %   cursor is not in a group, error?
338
339 \paragraph{Other:} $o(v)$
340
341 create an \ONODE{}, set \verb+value=+$v$ in the \ONODE{}, replace
342 cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node
343
344 % do_other
345 %   create o node, replace cursor with o, append \advance after o
346
347 \paragraph{Active:} $\sim$
348
349 % do_active:
350 %   ignored ???
351
352 \paragraph{Comment:} $\%$
353
354 % do_comment:
355 %   ignored ???
356
357 \paragraph{Begin Environment:} $c(\mathtt{begin})\langle\alpha_1,\dots,\alpha_n\rangle$
358
359 \paragraph{End Environment:} $c(\mathtt{end})\langle\rangle$
360
361 \paragraph{Left Delimiter:} $c(\mathtt{left})\langle\alpha\rangle$
362
363 \paragraph{Right Delimiter:} $c(\mathtt{right})\langle\alpha\rangle$
364
365 \paragraph{Carriage-Return:} $c(\mathtt{cr})\langle\rangle$
366
367 \begin{description}
368   \item{\verb+row/cell/g/cursor+}\\
369   create a \ROW{} node, create a \CELL{} node, create a \G{}
370     node, append the cursor to the new \G{} node, append the new \G{}
371     node to the new \CELL{} node, append the new \CELL{} node to the
372     new \ROW{} node, insert the new \ROW{} node after the old \ROW{} node
373   \item{\verb+cursor+}\\
374   ignored?
375 \end{description}
376
377 % do_cr:
378 % CASE: row/cell/g/cursor
379 %   create row node, create cell node, create g node,
380 %   append cursor to g, append g to cell, append cell to row,
381 %   insert new row after old row
382 % ELSE:
383 %   ignored ???
384
385 \paragraph{Macro:} $c(v)\langle\alpha_1,\dots,\alpha_n\rangle$
386
387 \begin{description}
388   \item{\verb+<p|g>/cursor+}\\
389   create a \CNODE{} node with the children corresponding to the pattern
390   $\tmap{\alpha_1}$,\dots,$\tmap{\alpha_n}$, replace the cursor with
391   the new \CNODE{} node. put $\tnext$ as the first child of the new
392   \CNODE{} node
393
394   \item{\verb+*/cursor+}\\
395   create a \CNODE{} node with the children corresponding to the pattern
396   $\tmap{\alpha_1}$,\dots,$\tmap{\alpha_n}$, replace the cursor with
397   the new \CNODE{} node, put $\tnext$ as the first child of the new
398   \CNODE{} node. If $n\ne0$ emit a warning (the macro has arguments but
399   but the context wouldn't normally allow them to be entered)
400 \end{description}
401
402 % do_macro:
403 % CASE: g/cursor
404 %   create a c node with children corresponding to the pattern of the macro
405 %   append \nextparam as first child of the macro
406
407 \section{Left Drop Rules}
408
409 \paragraph{Normal Left Drop:} $\NLDROP$
410
411 \begin{description}
412
413   % in the rules below, a token is either an i node, an n node, an o node, an s node or an empty c node.
414   % an empty c node is either an undefined macro or an empty macro. These c node are handled as they actually were 
415   % tokens (i, n, o, s).
416   % An important observation is: a sequence of groups with id, in which every group has one and only one child and where 
417   % the last group contains the cursor, is equivalent to the cursor (Is it clear?). For example:
418   % <g id="id1"><g id="id2">...<g id="idn"><cursor/></g>...</g></g> is equivalent to:
419   % <cursor/>
420
421   %************************************************************************************************************
422   %************************** there is at least one node preceding the cursor *********************************
423   %************************************************************************************************************
424
425   %************************** cursor's parent is a group or a parameter (p node).
426
427   \item{\verb+<g|p>[(i|n|o|s|c[!*])#]/(g[@id][^#$]/++\verb+)?cursor+}\\
428   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and replace the token with the cursor.
429   
430   \item{\verb+g[@id][(i|n|o|s|c[!*])#]/(g[@id][^#$]/++\verb+)?cursor+}\\
431   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and replace the token with the $\RGROUP$.
432
433   \item{\verb+<g|p>[g#]/(g[@id][^#$]/++\verb+)?cursor+}\\
434   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and append $\NLDGP$ to the \G{} node preceding the cursor.
435
436   \item{\verb+<g|p>[<sp|sb>#]/(g[@id][^#$]/++\verb+)?cursor+}\\
437   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and append the $\NLDSCRIPT$ to script node.
438
439   \item{\verb+<g|p>[c[p[@right-open="1"]$]#]/(g[@id][^#$]/++\verb+)?cursor+}\\
440   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and apeend the $\NLDGP$ to the \PNODE{} node.
441
442   % we don't have this kind of macro
443   %\item{\verb+<g|p>[c[^p[@left-open="1"]$]#]/(g[@id][^#$]/++\verb+)?cursor+}\\
444
445   \item{\verb+<g|p>[c[p[!@left-open="1"][!@right-open="1"](c[!*]|i|n|o|s)*$]#]/(g[@id][^#$]/++\verb+)?cursor+}\\
446   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and append the $\NLDGP$ to the \PNODE{} node.
447
448   \item{\verb+*[sp[^*g[!@id][^o[@name="prime"]$]]#]/(g[@id][^#$]/++\verb+)?cursor+}\\
449   replace (if present) the sequence of \G{} nodes with attribute \texttt{id} with the cursor and replace the \SP{} node with its first child.
450
451   \item{\verb+*[sp[^*g[!@id][^o[@name="prime"]++\verb+o[@name="prime"]$]]#]/(g[@id][^#$]/++\verb+)?cursor+}\\
452   replace (if present) the sequence of \G{} nodes with attribute \texttt{id} with the cursor and remove the last \ONODE{}, which is \G{} node's child.
453
454   %************************************ cursor's parent is a script
455
456   \item{\verb+<g|p>/<sp|sb>[(i|n|o|s|c[!*])#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
457   remove replace the script with the cursor.
458
459   \item{\verb+g[@id]/<sp|sb>[(i|n|o|s|c[!*])#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
460   replace the script with the $\RGROUP$.
461
462   \item{\verb+<sp|sb>[g#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
463   repalce the script with it's first child (the \G{} node) and append the $\NLDGP$ to it.
464
465   \item{\verb+<sp|sb>[^c[p[@right-open="1"]$]#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
466   remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and append the $\NLDGP$ to the \PNODE{} node.
467
468   % we don't have a macro of this kind
469   %\item{\verb+<sp|sb>[^c[^p[@left-open="1"]$]#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
470
471   \item{\verb+<sp|sb>[^c[p[!@left-open="1"][!@right-open="1"](c[!*]|i|n|o|s)*$]#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
472   replace the script with the \CNODE{} node and append the $\NLDGP$ to the \PNODE{} node.
473
474 \end{description}
475
476 \paragraph{Special Left Drop:} $\SLDROP$
477
478 %\begin{description}
479
480   %*******************************************************************************************************
481   %************** rules handling the case in which the cursor has a preceding node ***********************
482   %*******************************************************************************************************
483
484   %*************************************************************************************************
485   %*********** rules handling the case in which the cursor has no preceding nodes ******************
486   %*************************************************************************************************
487
488 %\end{description}
489
490 \section{Right Drop Rules}
491
492 \section{$\varepsilon$-rules}
493
494 \paragraph{Nromal Left Drop}
495
496 \begin{description}
497
498   %********************* epsilon rules concerning the rgreplace_father ********************
499
500   \item{\verb+(g[@id][^#$]/++\verb+)+$\RGROUP$}\\
501   replace the whole fragment with the cursor.
502
503   \item{\verb+*[!@id]/+$\RGROUP$}\\
504   replace the $\RGROUP$ with the cursor.
505
506   \item{\verb+g[@id][*#]/+$\RGROUP$}\\
507   replace the $\RGROUP$ with the cursor
508
509   \item{\verb+g[@id][#*]/+$\RGROUP$}\\
510   replace the $\RGROUP$ with the cursor.
511   % maybe it's not the correct action
512
513 \end{description}
514
515 \paragraph{Special Left Drop}
516
517 %\begin{description}
518
519 %\end{description}
520
521 \paragraph{Advance}
522
523 \begin{description}
524   \item{\verb+g/+$\tadvance$}\\
525   replace $\tadvance$ with the cursor
526
527   \item{\verb+p[#$]/+$\tadvance$}\\ %$
528   put $\tadvance$ after the \PNODE{} node
529
530   \item{\verb+c[#p]/+$\tadvance$} \\
531   remove $\tadvance$, put the cursor as first child of the \PNODE{} node
532
533   \item{\verb+c[#*]/+$\tadvance$} \\ %$
534   replace $\tadvance$ with the cursor 
535
536   \item{\verb+c[#$]/+$\tadvance$} \\ %$
537   move $\tadvance$ after the \CNODE{} node
538 \end{description}
539
540 \paragraph{Next Parameter}
541
542 \paragraph{Next Token}
543
544 %% \begin{description}
545 %%   \item{\verb+c[#p]/+$\tnext$} \\
546 %% \end{description}
547
548 % g[@id]/(c[#$][@right-open]/g[!@id][#$]/)+cursor  }   let p = cursor.parent() in remove; advance(p)
549
550 % c/g[!@id]/cursor
551 % c/cursor 
552 % */cursor  {   let g = new group in replace
553
554 % g[@id][^#$]/cursor  <=   cursor.parent().replace(cursor)
555 % g[@id][^#$]/cursor  <-   cursor
556 % (!g[@id][^#$])[A#B]/(g[@id][^#$]/)+cursor  <-  (!g[@id][^#$])[A#B]/cursor  
557
558 \end{document}