module Stratego-Box
imports Box StrategoRenamed
hiddens
  context-free start-symbols StrategoModule

exports
  context-free syntax

                BOX      -> StrategoTerm  {cons("ToTerm"), avoid}
          "|["  BOX "]|" -> StrategoTerm  {cons("ToTerm"), prefer}
    "box" "|["  BOX "]|" -> StrategoTerm  {cons("ToTerm")}

           "|["  BOX* "]|" -> StrategoTerm {cons("ToTerm")}
    "box*" "|["  BOX* "]|" -> StrategoTerm {cons("ToTerm")}

    "~"  StrategoTerm    -> BOX   {cons("FromTerm"), prefer}
    "~*" StrategoTerm    -> BOX*  {cons("FromTerm"), prefer}

    "~lit:" StrategoTerm -> BoxLiteral {cons("FromTerm"), prefer}

  variables
    "b" [0-9]*     -> BOX
    "b" [0-9]* "*" -> BOX*
    "s" [0-9]*     -> BoxLiteral
