module SimpleEditor.Syntax where
type Id = String
type ModId = Id
type Cat = Id
type FunId = Id
type Type = [Cat]
data Grammar = Grammar { basename :: ModId,
extends :: [ModId],
abstract :: Abstract,
concretes:: [Concrete] }
deriving Show
data Abstract = Abstract { startcat:: Cat, cats:: [Cat], funs:: [Fun] }
deriving Show
data Fun = Fun { fname:: FunId, ftype:: Type }
deriving Show
data Concrete = Concrete { langcode:: Id,
opens:: [ModId],
params:: [Param],
lincats:: [Lincat],
opers:: [Oper],
lins:: [Lin] }
deriving Show
data Param = Param {pname:: Id, prhs:: String} deriving Show
data Lincat = Lincat {cat :: Cat, lintype:: Term} deriving Show
data Oper = Oper {oname:: Lhs, orhs:: Term} deriving Show
data Lin = Lin {fun :: FunId, args:: [Id], lin:: Term} deriving Show
type Lhs = String
type Term = String