Cross Reference:
xref
: /
hets
/
ConstraintCASL
/
Print_AS.hs
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
hacapa.lhs revision 9a648682ccaa8ef63583548c3edb01c6542d7885
#!/
home
/
maeder
/
bin
/
runhugs
HetCATS
/
HasCASL
/
hacapa.lhs
$Id
$
Authors
:
Christian
Maeder
Year
:
2002
test
some
parsers
(
and
printers
)
\
begin
{
code
}
module
Main
where
import
HasCASL.ParseItem
import
HasCASL.ParseTerm
import
HasCASL.PrintAs
import
HasCASL.PrintLe
import
HasCASL.HToken
import
Common.RunParsers
import
HasCASL.RunStaticAna
import
Common.Lib.Parsec
import
Common.AnnoState
import
Common.PrettyPrint
import
Common.GlobalAnnotations
main
::
IO
()
main
=
exec
lineParser
fileParser
parseA
::
AParser
a ->
String
-> a
parseA
p s =
case
runParser
p
emptyAnnos
""
s
of
Right
a -> a
Left
err
->
error
$
show
err
lineParser
,
fileParser
:: [
(
String
,
StringParser
)
]
lineParser
= [
(
"MixIds"
,
fromAParser
uninstOpId
)
,
(
"Typenames"
,
fromAParser
typeId
)
,
(
"Kinds"
,
fromAParser
kind
)
,
(
"Types"
,
fromAParser
parseType
)
,
(
"Terms"
,
fromAParser
term
)
,
(
"Typepattern"
,
fromAParser
typePattern
)
,
(
"Pattern"
,
fromAParser
pattern
)
,
(
"BasicItems"
,
fromAParser
basicItems
)
,
(
"Items"
,
fromAParser
basicSpec
)
]
fileParser
= [
(
"BasicSpec"
,
fromAParser
basicSpec
)
,
(
"analysis"
,
fromAParser
anaParser
)
]
\
end
{
code
}