module MetaAnnoZ
imports Stratego [ Term => StrategoTerm
                   Var => StrategoVar
                   Id => StrategoId
                   StrChar => StrategoStrChar ]
imports
  z/ext/Para
  z/ext/ISOMetalanguage
  z/anno/Main

exports
  context-free syntax
    "〚" Pred "〛" -> StrategoTerm {cons("ToTerm"),prefer}

    "%Z" Spec "Z%"  -> StrategoTerm {cons("ToTerm"),prefer}
    "%S" Para "S%"  -> StrategoTerm {cons("ToTerm"),prefer}
    "%P" Pred "P%"  -> StrategoTerm {cons("ToTerm"),prefer}
    "%E" ZExpr "E%" -> StrategoTerm {cons("ToTerm"),prefer}
    "%N" ZName "N%" -> StrategoTerm {cons("ToTerm"),prefer}
    "%T" Type2 "T%" -> StrategoTerm {cons("ToTerm"),prefer}

    "~^"  StrategoTerm    -> STROKE        {cons("FromTerm"),prefer}
    "~"   StrategoTerm    -> ZName         {cons("FromTerm"),prefer}
    "~*"  StrategoTerm    -> {ZName ","}+  {cons("FromTerm")}
    "~"   StrategoTerm    -> Signature     {cons("FromTerm"),prefer}
    "~"   StrategoTerm    -> ZTerm     	   {cons("FromTerm"),prefer}
    "~*"  StrategoTerm    -> {ZTerm ";"}+  {cons("FromTerm")}
    "~*"  StrategoTerm    -> {ZTerm ","}+  {cons("FromTerm")}
    "~"   StrategoTerm    -> Type2     	   {cons("FromTerm"),prefer}

  context-free start-symbols Module
