module rg-term
imports rg-identifier
exports
  sorts Term IntConst
  context-free syntax
    Id       -> Term {cons("Term")}
    "<conc>" -> Term {cons("ConcTerm")}
    "<cons>" -> Term {cons("ConsTerm")}
    "<nil>"  -> Term {cons("NilTerm")}
    "<(" IntConst ")>" -> Term {cons("TupleTerm")}

    "<some>" -> Term {cons("SomeTerm")}
    "<none>" -> Term {cons("NoneTerm")}

    "<string>" -> Term {cons("StringTerm")}
    "<int>"    -> Term {cons("IntTerm")}

  lexical syntax
    [0-9]+   -> IntConst
