Improve the migration script and guide (#166)
authorPeter Kovacs <kpeter@inf.elte.hu>
Tue, 28 Oct 2008 18:33:51 +0100
changeset 343956a29f30887
parent 342 3e906e6c08a9
child 344 236b1902e5cc
child 345 2f64c4a692a8
Improve the migration script and guide (#166)

- Safer replacement of 'graph' and 'edge'.
- Fix the erroneous renaming of [Gg]raphToEps.
- Fixes and improvements in the migration guide.
doc/migration.dox
tools/lemon-0.x-to-1.x.sh
     1.1 --- a/doc/migration.dox	Tue Oct 28 14:49:18 2008 +0000
     1.2 +++ b/doc/migration.dox	Tue Oct 28 18:33:51 2008 +0100
     1.3 @@ -25,7 +25,7 @@
     1.4  to the 0.x release series.
     1.5  
     1.6  Many of these changes adjusted automatically by the
     1.7 -<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
     1.8 +<tt>lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
     1.9  update are typeset <b>boldface</b>.
    1.10  
    1.11  \section migration-graph Graph Related Name Changes
    1.12 @@ -53,9 +53,11 @@
    1.13    for <tt>Arc</tt>s (directed edges).
    1.14  
    1.15  \warning
    1.16 -<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of
    1.17 -the words \c graph, \c digraph, \c edge and \c arc, so it replaces them
    1.18 -in strings, comments etc. as well as in all identifiers.</b>
    1.19 +<b>The <tt>lemon-0.x-to-1.x.sh</tt> script replaces the words \c graph,
    1.20 +\c ugraph, \c edge and \c uedge in your own identifiers and in
    1.21 +strings, comments etc. as well as in all LEMON specific identifiers.
    1.22 +So use the script carefully and make a backup copy of your source files
    1.23 +before applying the script to them.</b>
    1.24  
    1.25  \section migration-lgf LGF tools
    1.26   - The \ref lgf-format "LGF file format" has changed,
     2.1 --- a/tools/lemon-0.x-to-1.x.sh	Tue Oct 28 14:49:18 2008 +0000
     2.2 +++ b/tools/lemon-0.x-to-1.x.sh	Tue Oct 28 18:33:51 2008 +0100
     2.3 @@ -14,27 +14,36 @@
     2.4      TMP=`mktemp`
     2.5      sed -e "s/undirected graph/_gr_aph_label_/g"\
     2.6          -e "s/undirected edge/_ed_ge_label_/g"\
     2.7 -        -e "s/graph_/_gr_aph_label__/g"\
     2.8 -        -e "s/_graph/__gr_aph_label_/g"\
     2.9          -e "s/UGraph/_Gr_aph_label_/g"\
    2.10 -        -e "s/uGraph/_gr_aph_label_/g"\
    2.11 -        -e "s/ugraph/_gr_aph_label_/g"\
    2.12 +        -e "s/u[Gg]raph/_gr_aph_label_/g"\
    2.13 +        -e "s/\<Graph\>/_Digr_aph_label_/g"\
    2.14 +        -e "s/\<graph\>/_digr_aph_label_/g"\
    2.15 +        -e "s/\<Graphs\>/_Digr_aph_label_s/g"\
    2.16 +        -e "s/\<graphs\>/_digr_aph_label_s/g"\
    2.17 +        -e "s/_Graph/__Gr_aph_label_/g"\
    2.18 +        -e "s/\([Gg]\)raph\([a-z_]\)/_\1r_aph_label_\2/g"\
    2.19 +        -e "s/\([a-z_]\)graph/\1_gr_aph_label_/g"\
    2.20          -e "s/Graph/_Digr_aph_label_/g"\
    2.21          -e "s/graph/_digr_aph_label_/g"\
    2.22          -e "s/UEdge/_Ed_ge_label_/g"\
    2.23 -        -e "s/uEdge/_ed_ge_label_/g"\
    2.24 -        -e "s/uedge/_ed_ge_label_/g"\
    2.25 +        -e "s/u[Ee]dge/_ed_ge_label_/g"\
    2.26          -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
    2.27 +        -e "s/\<Edge\>/_Ar_c_label_/g"\
    2.28 +        -e "s/\<edge\>/_ar_c_label_/g"\
    2.29 +        -e "s/\<Edges\>/_Ar_c_label_s/g"\
    2.30 +        -e "s/\<edges\>/_ar_c_label_s/g"\
    2.31 +        -e "s/_Edge/__Ed_ge_label_/g"\
    2.32 +        -e "s/Edge\([a-z_]\)/_Ed_ge_label_\1/g"\
    2.33 +        -e "s/edge\([a-z_]\)/_ed_ge_label_\1/g"\
    2.34 +        -e "s/\([a-z_]\)edge/\1_ed_ge_label_/g"\
    2.35          -e "s/Edge/_Ar_c_label_/g"\
    2.36          -e "s/edge/_ar_c_label_/g"\
    2.37 -        -e "s/ANode/_Re_d_label_/g"\
    2.38 -        -e "s/BNode/_Blu_e_label_/g"\
    2.39 -        -e "s/A-Node/_Re_d_label_/g"\
    2.40 -        -e "s/B-Node/_Blu_e_label_/g"\
    2.41 -        -e "s/anode/_re_d_label_/g"\
    2.42 -        -e "s/bnode/_blu_e_label_/g"\
    2.43 -        -e "s/aNode/_re_d_label_/g"\
    2.44 -        -e "s/bNode/_blu_e_label_/g"\
    2.45 +        -e "s/A[Nn]ode/_Re_d_label_/g"\
    2.46 +        -e "s/B[Nn]ode/_Blu_e_label_/g"\
    2.47 +        -e "s/A-[Nn]ode/_Re_d_label_/g"\
    2.48 +        -e "s/B-[Nn]ode/_Blu_e_label_/g"\
    2.49 +        -e "s/a[Nn]ode/_re_d_label_/g"\
    2.50 +        -e "s/b[Nn]ode/_blu_e_label_/g"\
    2.51          -e "s/_Digr_aph_label_/Digraph/g"\
    2.52          -e "s/_digr_aph_label_/digraph/g"\
    2.53          -e "s/_Gr_aph_label_/Graph/g"\
    2.54 @@ -48,6 +57,8 @@
    2.55          -e "s/_Blu_e_label_/Blue/g"\
    2.56          -e "s/_re_d_label_/red/g"\
    2.57          -e "s/_blu_e_label_/blue/g"\
    2.58 +        -e "s/DigraphToEps/GraphToEps/g"\
    2.59 +        -e "s/digraphToEps/graphToEps/g"\
    2.60          -e "s/\<DefPredMap\>/SetPredMap/g"\
    2.61          -e "s/\<DefDistMap\>/SetDistMap/g"\
    2.62          -e "s/\<DefReachedMap\>/SetReachedMap/g"\