\newcommand{\ROW}{\texttt{row}}
\newcommand{\SLDROP}{\blacktriangleleft}
\newcommand{\NLDROP}{\vartriangleleft}
+\newcommand{\RGROUP}{\vartriangleleft_{rg}}
\begin{document}
% <g id="id1"><g id="id2">...<g id="idn"><cursor/></g>...</g></g> is equivalent to:
% <cursor/>
- % there is an optional sequence of groups with id, all of which having one and only one child. The last
- % child of this sequence (or the root, if the sequence is empty) is a group with id, has as first element a
- % token and has as second and last element an eventually empty sequence of groups with id, all of which having
- %one and only one child. The last element of this sequence has the cursor as its child.
- \item{\verb+(g[@id][^#$]/++\verb+)?g[@id][^(i|n|o|s|c[ ])#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
- replace the whole fragment with the cursor.
+ \item{\verb+<g|p>[(i|n|o|s|c[ ])#]/(g[@id][^#$]/++\verb+)?cursor+}\\
+ remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and replace the token with the $\RGROUP$.
+
+ \item{\verb+<g|p>[g#]/(g[@id][^#$]/++\verb+)?cursor+}\\
+ remove the cursor (and eventually the sequence of \G{} nodes with attribute \texttt{id}) and append $\NLDG$ to the \G{} node preceding the cursor
+
+ %% there is an optional sequence of groups with id, all of which having one and only one child. The last
+ %% child of this sequence (or the root, if the sequence is empty) is a group with id, has as first element a
+ %% token and has as second and last element an eventually empty sequence of groups with id, all of which having
+ %%one and only one child. The last element of this sequence has the cursor as its child.
+ %\item{\verb+(g[@id][^#$]/++\verb+)?g[@id][^(i|n|o|s|c[ ])#$]/(g[@id][^#$]/++\verb+)?cursor+}\\
+ %replace the whole fragment with the cursor.
% the cursor is a macro's child. There is an eventually empty sequence of delimiters, which precedes the
% cursor. Before this sequence, there is a p node. This p node has as its last child a token
\begin{description}
+ %********************* epsilon rules concerning the rgreplace_father ********************
+
+ \item{\verb+(g[@id][^#$]/++\verb+)+$\RGROUP$}\\
+ replace the whole fragment with the cursor.
+
+ \item{\verb+*[!@id]/+$\RGROUP$}\\
+ replace the $\RGROUP$ with the cursor.
+
+ \item{\verb+g[@id][*#]/+$\RGROUP$}\\
+ replace the $\RGROUP$ with the cursor
+
+ \item{\verb+g[@id][#*]/+$\RGROUP$}\\
+ replace the $\RGROUP$ with the cursor.
+ % maybe it's not the correct action
+
+
%********************************************* \NLDROP has a preceding node *********************************************