src/Pure/Thy/export_theory.scala
changeset 75425 b958e053d993
parent 75394 42267c650205
child 75436 40630fec3b5d
equal deleted inserted replaced
75424:5f8f0bf8c72c 75425:b958e053d993
   262   case class Prefix(delim: String) extends Syntax
   262   case class Prefix(delim: String) extends Syntax
   263   case class Infix(assoc: Assoc.Value, delim: String, pri: Int) extends Syntax
   263   case class Infix(assoc: Assoc.Value, delim: String, pri: Int) extends Syntax
   264 
   264 
   265   def decode_syntax: XML.Decode.T[Syntax] =
   265   def decode_syntax: XML.Decode.T[Syntax] =
   266     XML.Decode.variant(List(
   266     XML.Decode.variant(List(
   267       { case (Nil, Nil) => No_Syntax },
   267       { case (Nil, Nil) => No_Syntax case _ => ??? },
   268       { case (List(delim), Nil) => Prefix(delim) },
   268       { case (List(delim), Nil) => Prefix(delim) case _ => ??? },
   269       { case (Nil, body) =>
   269       { case (Nil, body) =>
   270           import XML.Decode._
   270           import XML.Decode._
   271           val (ass, delim, pri) = triple(int, string, int)(body)
   271           val (ass, delim, pri) = triple(int, string, int)(body)
   272           Infix(Assoc(ass), delim, pri) }))
   272           Infix(Assoc(ass), delim, pri)
       
   273         case _ => ??? }))
   273 
   274 
   274 
   275 
   275   /* types */
   276   /* types */
   276 
   277 
   277   sealed case class Type(syntax: Syntax, args: List[String], abbrev: Option[Term.Typ])
   278   sealed case class Type(syntax: Syntax, args: List[String], abbrev: Option[Term.Typ])
   682   case object Unknown_Recursion extends Recursion
   683   case object Unknown_Recursion extends Recursion
   683 
   684 
   684   val decode_recursion: XML.Decode.T[Recursion] = {
   685   val decode_recursion: XML.Decode.T[Recursion] = {
   685     import XML.Decode._
   686     import XML.Decode._
   686     variant(List(
   687     variant(List(
   687       { case (Nil, a) => Primrec(list(string)(a)) },
   688       { case (Nil, a) => Primrec(list(string)(a)) case _ => ??? },
   688       { case (Nil, Nil) => Recdef },
   689       { case (Nil, Nil) => Recdef case _ => ??? },
   689       { case (Nil, a) => Primcorec(list(string)(a)) },
   690       { case (Nil, a) => Primcorec(list(string)(a)) case _ => ??? },
   690       { case (Nil, Nil) => Corec },
   691       { case (Nil, Nil) => Corec case _ => ??? },
   691       { case (Nil, Nil) => Unknown_Recursion }))
   692       { case (Nil, Nil) => Unknown_Recursion case _ => ??? }))
   692   }
   693   }
   693 
   694 
   694 
   695 
   695   sealed abstract class Rough_Classification {
   696   sealed abstract class Rough_Classification {
   696     def is_equational: Boolean = this.isInstanceOf[Equational]
   697     def is_equational: Boolean = this.isInstanceOf[Equational]
   711   case object Unknown extends Rough_Classification
   712   case object Unknown extends Rough_Classification
   712 
   713 
   713   val decode_rough_classification: XML.Decode.T[Rough_Classification] = {
   714   val decode_rough_classification: XML.Decode.T[Rough_Classification] = {
   714     import XML.Decode._
   715     import XML.Decode._
   715     variant(List(
   716     variant(List(
   716       { case (Nil, a) => Equational(decode_recursion(a)) },
   717       { case (Nil, a) => Equational(decode_recursion(a)) case _ => ??? },
   717       { case (Nil, Nil) => Inductive },
   718       { case (Nil, Nil) => Inductive case _ => ??? },
   718       { case (Nil, Nil) => Co_Inductive },
   719       { case (Nil, Nil) => Co_Inductive case _ => ??? },
   719       { case (Nil, Nil) => Unknown }))
   720       { case (Nil, Nil) => Unknown case _ => ??? }))
   720   }
   721   }
   721 
   722 
   722 
   723 
   723   sealed case class Spec_Rule(
   724   sealed case class Spec_Rule(
   724     pos: Position.T,
   725     pos: Position.T,