]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/bin/recomm/recommParser.mly
milestone update in ground
[helm.git] / matita / matita / contribs / lambdadelta / bin / recomm / recommParser.mly
index 5686e747effbe3efe959aaf0203f3dc1f33dcbd1..5e71743a9a087a817fb4b232a7d0f98dd6a4509b 100644 (file)
 
 %%
 
-inn_r:
+sp:
+  |    { "" }
   | SP { $1 }
+
+inn_r:
   | NL { $1 }
   | SW { $1 }
   | OT { $1 }
 
 inn:
   | inn_r { $1 }
-  | KW      { $1 }
-  | CW      { $1 }
-  | HW      { $1 }
+  | SP    { $1 }
+  | KW    { $1 }
+  | CW    { $1 }
+  | HW    { $1 }
+
+inn_w:
+  | inn   { $1 }
+  | SR    { $1 }
 
 inns_r:
   | inn_r      { $1      }
@@ -34,6 +42,10 @@ inns:
   | inn      { $1      }
   | inn inns { $1 ^ $2 }
 
+inns_w:
+  | inn_w        { $1      }
+  | inn_w inns_w { $1 ^ $2 }
+
 out:
   | SP { $1 }
   | SR { $1 }
@@ -47,14 +59,27 @@ outs:
   | out      { $1      }
   | out outs { $1 ^ $2 } 
 
-sw:
-  | HW { lc $1 }
-  | SW { lc $1 }
+cc:
+  | CW { $1 }
+  | OT { $1 }
+
+cw:
+  | cc    { $1      }
+  | cc cw { $1 ^ $2 }
 
 cws:
   |           { []       }
   | SP        { []       }
-  | SP CW cws { $2 :: $3 }
+  | SP cw cws { $2 :: $3 }
+
+sc:
+  | HW { lc $1 }
+  | SW { lc $1 }
+  | OT { $1    }
+
+sw:
+  | sc    { $1      }
+  | sc sw { $1 ^ $2 }
 
 sws:
   |           { []       }
@@ -62,15 +87,16 @@ sws:
   | SP sw sws { $2 :: $3 }
 
 src_l:
-  | NL               { ET.Line  $1                     }
-  | OP PP inns CP    { ET.Mark  $3                     }
-  | OP KW inns CP    { ET.Key   ($2, $3)               }
-  | OP CW cws CP     { ET.Title ($2 :: $3)             }
-  | OP HW sws CP     { ET.Slice (lc $2 :: $3)          }
-  | OP CP            { ET.Other ($1, "", $2)           }
-  | OP inns_r CP     { ET.Other ($1, $2, $3)           }
-  | OP SR inns CP    { ET.Other ($1, $2 ^ $3, $4)      }
-  | OP SR SR inns CP { ET.Other ($1, $2 ^ $3 ^ $4, $5) }
+  | NL                 { ET.Line  $1                        }
+  | OP sp PP inns CP   { ET.Mark  $4                        }
+  | OP sp KW inns_w CP { ET.Key   ($3, $4)                  }
+  | OP sp CW cws CP    { ET.Title ($3 :: $4)                }
+  | OP sp HW sws CP    { ET.Slice (lc $3 :: $4)             }
+  | OP sp CP           { ET.Other (0, $1, $2, $3)           }
+  | OP sp inns_r CP    { ET.Other (0, $1, $2 ^ $3, $4)      }
+  | OP SR inns CP      { ET.Other (1, $1, $2 ^ $3, $4)      }
+  | OP SR SR inns CP   { ET.Other (2, $1, $2 ^ $3 ^ $4, $5) }
+  | OP SP SR inns CP   { ET.Mark  $4                        }
 
 src:
   | outs { ET.Text $1 }