X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2FDEVEL%2Fmathml_editor%2Fdoc%2Fspec.tex;h=504825ae6bf8306126e5beda26f780d2c2928c6f;hb=ab1ea1988436efdac3c8148cd8310997d0122a39;hp=55e17218a5ac2b11195f426def7c3c55852b1796;hpb=d861d72d1e53f4f3252c91ed14615fdbf5686301;p=helm.git diff --git a/helm/DEVEL/mathml_editor/doc/spec.tex b/helm/DEVEL/mathml_editor/doc/spec.tex index 55e17218a..504825ae6 100644 --- a/helm/DEVEL/mathml_editor/doc/spec.tex +++ b/helm/DEVEL/mathml_editor/doc/spec.tex @@ -28,13 +28,8 @@ \newcommand{\CELL}{\texttt{cell}} \newcommand{\ROW}{\texttt{row}} \newcommand{\SLDROP}{\blacktriangleleft} -\newcommand{\SLDSCRIPT}{\blacktriangleleft_{s}} \newcommand{\NLDROP}{\vartriangleleft} -\newcommand{\RGROUP}{\vartriangleleft_{rg}} -\newcommand{\NLDGP}{\vartriangleleft_{g}} -\newcommand{\NLDSCRIPT}{\vartriangleleft_{s}} -\newcommand{\NLDMACRO}{\vartriangleleft_{c}} -\newcommand{\NLDTABLE}{\vartriangleleft_{t}} +\newcommand{\RDROP}{\vartriangleright} \begin{document} @@ -523,48 +518,34 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node \begin{description} - %******************************************************************************************************* - %************** rules handling the case in which the cursor has a preceding node *********************** - %******************************************************************************************************* - - %************** cursor's parent is a group or a parameter (a p node) - - \item{\verb+[(i|n|o|s|c[!*])#]/cursor+}\\ - remove the token. - - \item{\verb+[g#]/cursor+}\\ - remove the cursor and append it to the \G{} node. - - \item{\verb+[#]cursor+}\\ - remove the cursor and append the $\SLDSCRIPT$ + \item{\verb+cursor+}\\ + replace the cursor with the $\SLDROP$. - \item{\verb+[c[p[@right-open="1"]$]#]/cursor+}\\ - remove the cursor and append the it to the \PNODE{} node. +\end{description} - % remember to add the rules handling the primes +\section{Right Drop Rules} - %************************************************************************************************* - %*********** rules handling the case in which the cursor has no preceding nodes ****************** - %************************************************************************************************* +\begin{description} - \item{\verb+g[@id][^#$]/cursor+}\\ - replace the \G{} node with the cursor. + \item{\verb+cursor+}\\ + replace the cursor with the $\RDROP$. \end{description} -\section{Right Drop Rules} - \section{$\varepsilon$-rules} \paragraph{Nromal Left Drop} \begin{description} + \item{\verb+math/g[^#]/+$\NLDROP$}\\ + repalce the $\NLDROP$ with the cursor. + %************************************************************************************** %****************************** epsilon-rules with \NLDROP **************************** %************************************************************************************** - %***************************** \NLDROP has no preceding nodes ************************* + %************** \NLDROP has neither preceding nor following nodes ******************** \item{\verb+math[^#$]/+$\NLDROP$}\\ replace the $\NLDROP$ with the cursor. @@ -572,19 +553,10 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node \item{\verb+g[^#$]/+$\NLDROP$}\\ replace the \G{} node with the $\NLDROP$. - % this rule overrides the rule above - \item{\verb+math/g[^#$]/+$\NLDROP$}\\ - replace the $\NLDROP$ with the cursor. - + % this rule is overridden by the two ones below \item{\verb+c/p[^#$]/+$\NLDROP$}\\ remove the $\NLDROP$ and insert it before the \PNODE{} node. - \item{\verb+cell[^#$]/+$\NLDROP$}\\ - replace the cell with the $\NLDROP_n$. - - \item{\verb+table[^#$]/+$\NLDROP$}\\ - replace the \TABLE{} node with the $\NLDROP$. - \item{\verb+c[p[@left-open='1'][*]#$]/p[@right-open='1'][^#$]/+$\NLDROP$}\\ replace the \CNODE{} node with the content of the first \PNODE{} node and insert the $\NLDROP$ after this content @@ -594,6 +566,12 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node \item{\verb+c[^#][!p(*)]/+$\NLDROP$}\\ replace the \CNODE{} node with the $\NLDROP$. + \item{\verb+cell[^#$]/+$\NLDROP$}\\ + replace the cell with the $\NLDROP_n$. + + \item{\verb+table[^#$]/+$\NLDROP$}\\ + replace the \TABLE{} node with the $\NLDROP$. + %************************* \NLDROP has at least one preceding node ********************* % general rules @@ -603,7 +581,7 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node remove the $\NLDROP$ and append it as the last child of its ex preceding brother. % this rule overrides the one above - \item{\verb+*[#]/+$\NLDROP$}\\ + \item{\verb+*[(i|n|o|s|c[!*])#]/+$\NLDROP$}\\ remove the $\NLDROP$ and replace the token with the $\NLDROP_n$. % special rules @@ -637,13 +615,104 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node % special rules - \item{\verb+math/g[^#*]/+$\NLDROP$}\\ - replace the $\NLDROP$ with the cursor. - % this rule is applicable to all macros. \item{\verb+c[^#][p[*]]/+$\NLDROP$}\\ remove the $\NLDROP$ and insert it before the \CNODE{} node. +\end{description} + +\paragraph{Special Left Drop} + +\begin{description} + + %******************************************************************************************************** + %************************************ epsilon-rules with \SLDROP **************************************** + %******************************************************************************************************** + + \item{\verb+math/+$\SLDROP$}\\ + replace the $\SLDROP$ with the cursor. + + \item{\verb+math/g[^#]/+$\NLDROP$}\\ + replace the $\NLDROP$ with the cursor. + + %************************ \SLDROP has neither preceding nor following nodes ***************************** + + \item{\verb+g[^#$]/+$\SLDROP$}\\ + replace the \G{} node with the cursor. + + \item{\verb+c[p[@left-open='1'][*]#$]/p[@right-open='1'][^#$]/+$\SLDROP$}\\ + replace the \CNODE{} node with the content of the first \PNODE{} node and insert the cursor after this content + + \item{\verb+c[p[@left-open='1'][!*]#$]/p[@right-open='1'][^#$]/+$\SLDROP$}\\ + replace the \CNODE{} node with the cursor. + + \item{\verb+c/p[^#$]/+$\SLDROP$}\\ + remove the $\SLDROP$ and insert it before the \PNODE{} node. + + \item{\verb+c[^#][!p(*)]/+$\SLDROP$}\\ + replace the \CNODE{} node with the cursor. + + \item{\verb+cell[^#$]/+$\SLDROP$}\\ + replace the cell with the $\NLDROP_n$. + + \item{\verb+table[^#$]/+$\SLDROP$}\\ + replace the \TABLE{} node with the cursor. + + %*********************** \SLDROP has at least one preceding node *********************************** + + \item{\verb+*[sp[!@id][^*g[!@id][^o[@name='prime']++\verb+o[@name='prime']$]]#]/+$\SLDROP$}\\ + remove the last \ONODE{} node and replace the $\SLDROP$ with the cursor. + + \item{\verb+*[sp[!@id][^*g[!@id][^o[@name='prime']$]]#]/+$\SLDROP$}\\ + replace the script with its first child and replace the $\SLDROP$ with the cursor.%$\NLDROP_n$. + + \item{\verb+[^g[!@id][!*]#$]/+$\SLDROP$}\\ + replace the script with the cursor. + + % this rule is overridden by the three rules above. + \item{\verb+[^*#$]+/$\SLDROP$}\\ + replace the script node with its first child and insert the cursor after it. + + \item{\verb+c[(i|n|o|s|c[!*])#]/+$\SLDROP$}\\ + remove the $\SLDROP$ and insert the cursor before the delimiter. + + \item{\verb+c[p#(i|n|o|s|c[!*])]/+$\SLDROP$}\\ + remove the $\SLDROP$ and insert the cursor into the \PNODE{} node. + + \item{\verb+c[p[@right-open='1']#]+}\\ + remove the $\SLDROP$ and append the curor as last child of the \PNODE{} node. + + % this rule is overridden by the two ones above. + \item{\verb+c[p#]/+$\SLDROP$}\\ + move the $\SLDROP$ into the \PNODE{} node. + + \item{\verb+*[(i|n|o|s|c[!*])#]/+$\SLDROP$}\\ + remove the $\SLDROP$ and replace the token with the cursor. + + \item{\verb+*[table#]/+$\SLDROP$}\\ + remove the $\SLDROP$ and append the $\NLDROP_n$ as the last child of the \TABLE{} node. + + \item{\verb+*[c#]/+$\SLDROP$}\\ + move the $\SLDROP$ into the \CNODE{} node. + + \item{\verb+*[g#]/+$\SLDROP$}\\ + remove the $\SLDROP$ and append the cursor as the last child of the \G{} node. + + %********** \SLDROP has no preceding node, but has following ones ************** + + \item{\verb+c[^#p][p(*)]/+$\SLDROP$}\\ + remove the $\SLDROP$ and insert the cursor before the \CNODE{} node. + + % general rule + \item{\verb+*[^#*]/+$\SLDROP$}\\ + remove the $\SLDROP$ and insert the cursor before its parent. + +\end{description} + +\paragraph{Normalize Left Drop} + +\begin{description} + %**************************************************************************************** %***************************** epsilon-rules with \NLDROP_n ***************************** %**************************************************************************************** @@ -661,18 +730,57 @@ cursor with \ONODE{}, append $\tadvance$ after the \ONODE{} node remove the $\NLDROP_n$ and append it as last child of the \ROW{} node. \item{\verb+table[^#$]/+$\NLDROP_n$}\\ - replace the \texttt{table} with the cursor.%$\NLDROP_n$. + replace the \TABLE{} with the cursor.%$\NLDROP_n$. \item{\verb+g[@id][^#$]/+$\NLDROP_n$}\\ replace the \G{} node with the $\NLDROP_n$. + \item{$\NLDROP_n$}\\ + replace the $\NLDROP_n$ with the cursor. + \end{description} -\paragraph{Special Left Drop} +\paragraph{Right Drop} + +\begin{description} + + %************************* \RDROP has at least a following node **************************************** + + \item{\verb+c[#(i|n|o|s|c[!*])]/+$\RDROP$}\\ + remove the $\RDROP$ and append it after the delimiter + + \item{\verb+*[#(i|n|o|s|c[!*])]/+$\RDROP$}\\ + remove the token and replace the $\RDROP$ with the cursor $\RDROP_n$. + + % this rule is overridden by those ones above. + \item{\verb+*[#*]/+$\RDROP$}\\ + remove the $\RDROP$ and append it as the first child of the following node. -%\begin{description} + %************************** \RDROP has neither following nor preceding nodes ****************************** -%\end{description} + \item{\verb+c[#$][!p[*]]/+$\RDROP$}\\ + replace the \CNODE{} with the $\RDROP$. + + \item{\verb+p[^#$]/+$\RDROP$}\\ + move the $\RDROP$ after the \PNODE{} node. + + \item{\verb+g[^#$]/+$\RDROP$}\\ + replace the \G{} node with the $\RDROP$. + +\end{description} + +\paragraph{Normalize Right Drop} + +\begin{description} + + % at the moment it's the only rule, defined for this symbol. + \item{\verb+g[@id][^#$]/+$\RDROP_n$}\\ + replace the \G{} node with the $\RDROP_n$. + + \item{$\RDROP_n$}\\ + replace the $\RDROP$ with the cursor. + +\end{description} \paragraph{Advance}