forked from GitHub/gf-core
remove all files that aren't used in GF-3.0
This commit is contained in:
@@ -1,381 +0,0 @@
|
||||
module GF.Source.SkelGF where
|
||||
|
||||
-- Haskell module generated by the BNF converter
|
||||
|
||||
import GF.Source.AbsGF
|
||||
import GF.Source.ErrM
|
||||
type Result = Err String
|
||||
|
||||
failure :: Show a => a -> Result
|
||||
failure x = Bad $ "Undefined case: " ++ show x
|
||||
|
||||
transLString :: LString -> Result
|
||||
transLString x = case x of
|
||||
LString str -> failure x
|
||||
|
||||
|
||||
transPIdent :: PIdent -> Result
|
||||
transPIdent x = case x of
|
||||
PIdent str -> failure x
|
||||
|
||||
|
||||
transGrammar :: Grammar -> Result
|
||||
transGrammar x = case x of
|
||||
Gr moddefs -> failure x
|
||||
|
||||
|
||||
transModDef :: ModDef -> Result
|
||||
transModDef x = case x of
|
||||
MMain pident0 pident concspecs -> failure x
|
||||
MModule complmod modtype modbody -> failure x
|
||||
|
||||
|
||||
transConcSpec :: ConcSpec -> Result
|
||||
transConcSpec x = case x of
|
||||
ConcSpec pident concexp -> failure x
|
||||
|
||||
|
||||
transConcExp :: ConcExp -> Result
|
||||
transConcExp x = case x of
|
||||
ConcExp pident transfers -> failure x
|
||||
|
||||
|
||||
transTransfer :: Transfer -> Result
|
||||
transTransfer x = case x of
|
||||
TransferIn open -> failure x
|
||||
TransferOut open -> failure x
|
||||
|
||||
|
||||
transModHeader :: ModHeader -> Result
|
||||
transModHeader x = case x of
|
||||
MModule2 complmod modtype modheaderbody -> failure x
|
||||
|
||||
|
||||
transModHeaderBody :: ModHeaderBody -> Result
|
||||
transModHeaderBody x = case x of
|
||||
MBody2 extend opens -> failure x
|
||||
MNoBody2 includeds -> failure x
|
||||
MWith2 included opens -> failure x
|
||||
MWithBody2 included opens0 opens -> failure x
|
||||
MWithE2 includeds included opens -> failure x
|
||||
MWithEBody2 includeds included opens0 opens -> failure x
|
||||
MReuse2 pident -> failure x
|
||||
MUnion2 includeds -> failure x
|
||||
|
||||
|
||||
transModType :: ModType -> Result
|
||||
transModType x = case x of
|
||||
MTAbstract pident -> failure x
|
||||
MTResource pident -> failure x
|
||||
MTInterface pident -> failure x
|
||||
MTConcrete pident0 pident -> failure x
|
||||
MTInstance pident0 pident -> failure x
|
||||
MTTransfer pident open0 open -> failure x
|
||||
|
||||
|
||||
transModBody :: ModBody -> Result
|
||||
transModBody x = case x of
|
||||
MBody extend opens topdefs -> failure x
|
||||
MNoBody includeds -> failure x
|
||||
MWith included opens -> failure x
|
||||
MWithBody included opens0 opens topdefs -> failure x
|
||||
MWithE includeds included opens -> failure x
|
||||
MWithEBody includeds included opens0 opens topdefs -> failure x
|
||||
MReuse pident -> failure x
|
||||
MUnion includeds -> failure x
|
||||
|
||||
|
||||
transExtend :: Extend -> Result
|
||||
transExtend x = case x of
|
||||
Ext includeds -> failure x
|
||||
NoExt -> failure x
|
||||
|
||||
|
||||
transOpens :: Opens -> Result
|
||||
transOpens x = case x of
|
||||
NoOpens -> failure x
|
||||
OpenIn opens -> failure x
|
||||
|
||||
|
||||
transOpen :: Open -> Result
|
||||
transOpen x = case x of
|
||||
OName pident -> failure x
|
||||
OQualQO qualopen pident -> failure x
|
||||
OQual qualopen pident0 pident -> failure x
|
||||
|
||||
|
||||
transComplMod :: ComplMod -> Result
|
||||
transComplMod x = case x of
|
||||
CMCompl -> failure x
|
||||
CMIncompl -> failure x
|
||||
|
||||
|
||||
transQualOpen :: QualOpen -> Result
|
||||
transQualOpen x = case x of
|
||||
QOCompl -> failure x
|
||||
QOIncompl -> failure x
|
||||
QOInterface -> failure x
|
||||
|
||||
|
||||
transIncluded :: Included -> Result
|
||||
transIncluded x = case x of
|
||||
IAll pident -> failure x
|
||||
ISome pident pidents -> failure x
|
||||
IMinus pident pidents -> failure x
|
||||
|
||||
|
||||
transDef :: Def -> Result
|
||||
transDef x = case x of
|
||||
DDecl names exp -> failure x
|
||||
DDef names exp -> failure x
|
||||
DPatt name patts exp -> failure x
|
||||
DFull names exp0 exp -> failure x
|
||||
|
||||
|
||||
transTopDef :: TopDef -> Result
|
||||
transTopDef x = case x of
|
||||
DefCat catdefs -> failure x
|
||||
DefFun fundefs -> failure x
|
||||
DefFunData fundefs -> failure x
|
||||
DefDef defs -> failure x
|
||||
DefData datadefs -> failure x
|
||||
DefTrans defs -> failure x
|
||||
DefPar pardefs -> failure x
|
||||
DefOper defs -> failure x
|
||||
DefLincat printdefs -> failure x
|
||||
DefLindef defs -> failure x
|
||||
DefLin defs -> failure x
|
||||
DefPrintCat printdefs -> failure x
|
||||
DefPrintFun printdefs -> failure x
|
||||
DefFlag flagdefs -> failure x
|
||||
DefPrintOld printdefs -> failure x
|
||||
DefLintype defs -> failure x
|
||||
DefPattern defs -> failure x
|
||||
DefPackage pident topdefs -> failure x
|
||||
DefVars defs -> failure x
|
||||
DefTokenizer pident -> failure x
|
||||
|
||||
|
||||
transCatDef :: CatDef -> Result
|
||||
transCatDef x = case x of
|
||||
SimpleCatDef pident ddecls -> failure x
|
||||
ListCatDef pident ddecls -> failure x
|
||||
ListSizeCatDef pident ddecls n -> failure x
|
||||
|
||||
|
||||
transFunDef :: FunDef -> Result
|
||||
transFunDef x = case x of
|
||||
FunDef pidents exp -> failure x
|
||||
|
||||
|
||||
transDataDef :: DataDef -> Result
|
||||
transDataDef x = case x of
|
||||
DataDef pident dataconstrs -> failure x
|
||||
|
||||
|
||||
transDataConstr :: DataConstr -> Result
|
||||
transDataConstr x = case x of
|
||||
DataId pident -> failure x
|
||||
DataQId pident0 pident -> failure x
|
||||
|
||||
|
||||
transParDef :: ParDef -> Result
|
||||
transParDef x = case x of
|
||||
ParDefDir pident parconstrs -> failure x
|
||||
ParDefIndir pident0 pident -> failure x
|
||||
ParDefAbs pident -> failure x
|
||||
|
||||
|
||||
transParConstr :: ParConstr -> Result
|
||||
transParConstr x = case x of
|
||||
ParConstr pident ddecls -> failure x
|
||||
|
||||
|
||||
transPrintDef :: PrintDef -> Result
|
||||
transPrintDef x = case x of
|
||||
PrintDef names exp -> failure x
|
||||
|
||||
|
||||
transFlagDef :: FlagDef -> Result
|
||||
transFlagDef x = case x of
|
||||
FlagDef pident0 pident -> failure x
|
||||
|
||||
|
||||
transName :: Name -> Result
|
||||
transName x = case x of
|
||||
IdentName pident -> failure x
|
||||
ListName pident -> failure x
|
||||
|
||||
|
||||
transLocDef :: LocDef -> Result
|
||||
transLocDef x = case x of
|
||||
LDDecl pidents exp -> failure x
|
||||
LDDef pidents exp -> failure x
|
||||
LDFull pidents exp0 exp -> failure x
|
||||
|
||||
|
||||
transExp :: Exp -> Result
|
||||
transExp x = case x of
|
||||
EIdent pident -> failure x
|
||||
EConstr pident -> failure x
|
||||
ECons pident -> failure x
|
||||
ESort sort -> failure x
|
||||
EString str -> failure x
|
||||
EInt n -> failure x
|
||||
EFloat d -> failure x
|
||||
EMeta -> failure x
|
||||
EEmpty -> failure x
|
||||
EData -> failure x
|
||||
EList pident exps -> failure x
|
||||
EStrings str -> failure x
|
||||
ERecord locdefs -> failure x
|
||||
ETuple tuplecomps -> failure x
|
||||
EIndir pident -> failure x
|
||||
ETyped exp0 exp -> failure x
|
||||
EProj exp label -> failure x
|
||||
EQConstr pident0 pident -> failure x
|
||||
EQCons pident0 pident -> failure x
|
||||
EApp exp0 exp -> failure x
|
||||
ETable cases -> failure x
|
||||
ETTable exp cases -> failure x
|
||||
EVTable exp exps -> failure x
|
||||
ECase exp cases -> failure x
|
||||
EVariants exps -> failure x
|
||||
EPre exp alterns -> failure x
|
||||
EStrs exps -> failure x
|
||||
EConAt pident exp -> failure x
|
||||
EPatt patt -> failure x
|
||||
EPattType exp -> failure x
|
||||
ESelect exp0 exp -> failure x
|
||||
ETupTyp exp0 exp -> failure x
|
||||
EExtend exp0 exp -> failure x
|
||||
EGlue exp0 exp -> failure x
|
||||
EConcat exp0 exp -> failure x
|
||||
EAbstr binds exp -> failure x
|
||||
ECTable binds exp -> failure x
|
||||
EProd decl exp -> failure x
|
||||
ETType exp0 exp -> failure x
|
||||
ELet locdefs exp -> failure x
|
||||
ELetb locdefs exp -> failure x
|
||||
EWhere exp locdefs -> failure x
|
||||
EEqs equations -> failure x
|
||||
EExample exp str -> failure x
|
||||
ELString lstring -> failure x
|
||||
ELin pident -> failure x
|
||||
|
||||
|
||||
transExps :: Exps -> Result
|
||||
transExps x = case x of
|
||||
NilExp -> failure x
|
||||
ConsExp exp exps -> failure x
|
||||
|
||||
|
||||
transPatt :: Patt -> Result
|
||||
transPatt x = case x of
|
||||
PChar -> failure x
|
||||
PChars str -> failure x
|
||||
PMacro pident -> failure x
|
||||
PM pident0 pident -> failure x
|
||||
PW -> failure x
|
||||
PV pident -> failure x
|
||||
PCon pident -> failure x
|
||||
PQ pident0 pident -> failure x
|
||||
PInt n -> failure x
|
||||
PFloat d -> failure x
|
||||
PStr str -> failure x
|
||||
PR pattasss -> failure x
|
||||
PTup patttuplecomps -> failure x
|
||||
PC pident patts -> failure x
|
||||
PQC pident0 pident patts -> failure x
|
||||
PDisj patt0 patt -> failure x
|
||||
PSeq patt0 patt -> failure x
|
||||
PRep patt -> failure x
|
||||
PAs pident patt -> failure x
|
||||
PNeg patt -> failure x
|
||||
|
||||
|
||||
transPattAss :: PattAss -> Result
|
||||
transPattAss x = case x of
|
||||
PA pidents patt -> failure x
|
||||
|
||||
|
||||
transLabel :: Label -> Result
|
||||
transLabel x = case x of
|
||||
LIdent pident -> failure x
|
||||
LVar n -> failure x
|
||||
|
||||
|
||||
transSort :: Sort -> Result
|
||||
transSort x = case x of
|
||||
Sort_Type -> failure x
|
||||
Sort_PType -> failure x
|
||||
Sort_Tok -> failure x
|
||||
Sort_Str -> failure x
|
||||
Sort_Strs -> failure x
|
||||
|
||||
|
||||
transBind :: Bind -> Result
|
||||
transBind x = case x of
|
||||
BIdent pident -> failure x
|
||||
BWild -> failure x
|
||||
|
||||
|
||||
transDecl :: Decl -> Result
|
||||
transDecl x = case x of
|
||||
DDec binds exp -> failure x
|
||||
DExp exp -> failure x
|
||||
|
||||
|
||||
transTupleComp :: TupleComp -> Result
|
||||
transTupleComp x = case x of
|
||||
TComp exp -> failure x
|
||||
|
||||
|
||||
transPattTupleComp :: PattTupleComp -> Result
|
||||
transPattTupleComp x = case x of
|
||||
PTComp patt -> failure x
|
||||
|
||||
|
||||
transCase :: Case -> Result
|
||||
transCase x = case x of
|
||||
Case patt exp -> failure x
|
||||
|
||||
|
||||
transEquation :: Equation -> Result
|
||||
transEquation x = case x of
|
||||
Equ patts exp -> failure x
|
||||
|
||||
|
||||
transAltern :: Altern -> Result
|
||||
transAltern x = case x of
|
||||
Alt exp0 exp -> failure x
|
||||
|
||||
|
||||
transDDecl :: DDecl -> Result
|
||||
transDDecl x = case x of
|
||||
DDDec binds exp -> failure x
|
||||
DDExp exp -> failure x
|
||||
|
||||
|
||||
transOldGrammar :: OldGrammar -> Result
|
||||
transOldGrammar x = case x of
|
||||
OldGr include topdefs -> failure x
|
||||
|
||||
|
||||
transInclude :: Include -> Result
|
||||
transInclude x = case x of
|
||||
NoIncl -> failure x
|
||||
Incl filenames -> failure x
|
||||
|
||||
|
||||
transFileName :: FileName -> Result
|
||||
transFileName x = case x of
|
||||
FString str -> failure x
|
||||
FIdent pident -> failure x
|
||||
FSlash filename -> failure x
|
||||
FDot filename -> failure x
|
||||
FMinus filename -> failure x
|
||||
FAddId pident filename -> failure x
|
||||
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
-- automatically generated by BNF Converter
|
||||
module Main where
|
||||
|
||||
|
||||
import IO ( stdin, hGetContents )
|
||||
import System ( getArgs, getProgName )
|
||||
|
||||
import GF.Source.LexGF
|
||||
import GF.Source.ParGF
|
||||
import GF.Source.SkelGF
|
||||
import GF.Source.PrintGF
|
||||
import GF.Source.AbsGF
|
||||
|
||||
|
||||
|
||||
|
||||
import GF.Source.ErrM
|
||||
|
||||
type ParseFun a = [Token] -> Err a
|
||||
|
||||
myLLexer = myLexer
|
||||
|
||||
type Verbosity = Int
|
||||
|
||||
putStrV :: Verbosity -> String -> IO ()
|
||||
putStrV v s = if v > 1 then putStrLn s else return ()
|
||||
|
||||
runFile :: (Print a, Show a) => Verbosity -> ParseFun a -> FilePath -> IO ()
|
||||
runFile v p f = putStrLn f >> readFile f >>= run v p
|
||||
|
||||
run :: (Print a, Show a) => Verbosity -> ParseFun a -> String -> IO ()
|
||||
run v p s = let ts = myLLexer s in case p ts of
|
||||
Bad s -> do putStrLn "\nParse Failed...\n"
|
||||
putStrV v "Tokens:"
|
||||
putStrV v $ show ts
|
||||
putStrLn s
|
||||
Ok tree -> do putStrLn "\nParse Successful!"
|
||||
showTree v tree
|
||||
|
||||
|
||||
|
||||
showTree :: (Show a, Print a) => Int -> a -> IO ()
|
||||
showTree v tree
|
||||
= do
|
||||
putStrV v $ "\n[Abstract Syntax]\n\n" ++ show tree
|
||||
putStrV v $ "\n[Linearized tree]\n\n" ++ printTree tree
|
||||
|
||||
main :: IO ()
|
||||
main = do args <- getArgs
|
||||
case args of
|
||||
[] -> hGetContents stdin >>= run 2 pGrammar
|
||||
"-s":fs -> mapM_ (runFile 0 pGrammar) fs
|
||||
fs -> mapM_ (runFile 2 pGrammar) fs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user