s/¶¶¶local/ ¶¶¶laystan ¶¶¶latexopen \\\\backslash LOCAL ¶¶¶latexclot ¶¶¶debeq/
s/$/¶¶¶fineq/
}
/¶¶¶global/ {
s/¶¶¶global/ ¶¶¶laystan ¶¶¶latexopen \\\\backslash GLOBAL ¶¶¶latexclot ¶¶¶debeq/
s/$/¶¶¶fineq/
}
/¶¶¶option/ d
s/¶¶¶if/¶¶¶laystan ¶¶¶latexopen \\\\backslash IF { ¶¶¶latexclot þþþifdebeq / g
s/¶¶¶elif/¶¶¶laystan ¶¶¶latexopen \\\\backslash ELSIF { ¶¶¶latexclot þþþifdebeq / g
s/¶¶¶then/ þþþiffineq ¶¶¶latexopen } / g
s/¶¶¶else/¶¶¶laystan ¶¶¶latexopen \\\\backslash ELSE/ g
s/¶¶¶endif/¶¶¶laystan ¶¶¶latexopen \\\\backslash ENDIF/ g
s/þþþif/¶¶¶/g
/¶¶¶do/ {
s/¶¶¶for/¶¶¶laystan ¶¶¶latexopen \\\\backslash FOR { ¶¶¶latexclot þþþfordebeq / g
s/¶¶¶do/ þþþforfineq ¶¶¶latexopen } / g
s/ to / þþþforfineq ¶¶¶latexopen \\\\backslash TO ¶¶¶latexclot þþþfordebeq /
s/ from / þþþforfineq ¶¶¶latexopen \\\\backslash FROM ¶¶¶latexclot þþþfordebeq /
s/ while / þþþforfineq WHILE þþþfordebeq /
s/þþþfor/¶¶¶/g
}
s/¶¶¶enddo/ ¶¶¶laystan ¶¶¶latexopen \\\\backslash ENDFOR / g
/^¶¶¶state[ ]*$/ d
/¶¶¶state/ {
s/¶¶¶state/¶¶¶laystan ¶¶¶latexopen \\\\backslash STATE ¶¶¶latexclot ¶¶¶debeq/
s/$/¶¶¶fineq ; /
}
/¶¶¶error/ {
s/¶¶¶error/¶¶¶laystan ¶¶¶latexopen \\\\backslash STATE \\\\backslash ERROR ¶¶¶latexclot /
s/\\\\"/"/g
}
/¶¶¶return/ {
s/¶¶¶return/¶¶¶laystan ¶¶¶latexopen \\\\backslash STATE \\\\backslash RETURN ¶¶¶latexclot ¶¶¶debeq /
s/$/¶¶¶fineq/
}
s/¶¶¶break/¶¶¶laystan ¶¶¶latexopen \\\\backslash STATE \\\\backslash BREAK ¶¶¶latexclot /
cat $from_rep/$from_fil | tr \\f\\r\\n ¶¶¶ | sed -f $tmp_sed1 | grep MPLTEXT > $tmp1
# et alors $tmp1 contient exactement une ligne par cellule maple non vide
# au passage, on a recollé les end_if, end_do, end_proc
sed -f $tmp_sed2 $tmp1 > $tmp2
# et alors $tmp2 est composé de "lignes logiques", chacune commençant par un code.
# les lignes non vides correspondent aux lignes du résultat final
sed -f $tmp_sed3 $tmp2 > $tmp3
# gestion des mots-clefs ; puis une ligne pour chaque instruction élémentaire
sed -f $tmp_sed4 $tmp3 > $tmp4
# gestion des équations