-- Copyright 2022 University of Freiburg -- Janek Spaderna module Templates where import qualified Data.Map as Map data Template = -- | A literal string. T String | -- | A variable. The template resolves to the variables name. V Template | -- | Include a subtemplate with a set of new bindings. The name of the -- subtemplate is a template itself. I Template [Definition] | -- | Concatenation of multiple templates. C [Template] -- | Defines a new variable. The variables name and value are templates. data Definition = D Template Template data Environment = Environment { envTemplates :: Map.Map String Template, envVariables :: Map.Map String String }