Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Typeching PostScript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hendrik Rassmann
Typeching PostScript
Commits
0ba61775
Commit
0ba61775
authored
11 months ago
by
Hendrik Rassmann
Browse files
Options
Downloads
Patches
Plain Diff
works downstairs
parent
080f397b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gen0_virtuous_cycle/app/TC0.hs
+1
-1
1 addition, 1 deletion
gen0_virtuous_cycle/app/TC0.hs
gen0_virtuous_cycle/gen0-virtuous-cycle.cabal
+2
-2
2 additions, 2 deletions
gen0_virtuous_cycle/gen0-virtuous-cycle.cabal
gen0_virtuous_cycle/lib/TC.hs
+3
-3
3 additions, 3 deletions
gen0_virtuous_cycle/lib/TC.hs
with
6 additions
and
6 deletions
gen0_virtuous_cycle/app/TC0.hs
+
1
−
1
View file @
0ba61775
...
@@ -116,7 +116,7 @@ mainloop input =
...
@@ -116,7 +116,7 @@ mainloop input =
mainloop
$
step
state
mainloop
$
step
state
Nothing
->
do
putStrLn
"no next State"
Nothing
->
do
putStrLn
"no next State"
main
=
do
main
'
=
do
s
<-
readFile
"output.ps"
s
<-
readFile
"output.ps"
let
program
=
token2Type
<$>
parseBlocks
(
scanPS
s
)
let
program
=
token2Type
<$>
parseBlocks
(
scanPS
s
)
mainloop
(
Just
(
"Starting Eval"
,(
buildins
,
[]
,
program
)))
mainloop
(
Just
(
"Starting Eval"
,(
buildins
,
[]
,
program
)))
...
...
This diff is collapsed.
Click to expand it.
gen0_virtuous_cycle/gen0-virtuous-cycle.cabal
+
2
−
2
View file @
0ba61775
...
@@ -14,7 +14,7 @@ Library StaX
...
@@ -14,7 +14,7 @@ Library StaX
executable Main.hs
executable Main.hs
main-is: Main.hs
main-is: Main.hs
other-modules: TC0, TC, PSLex, AnnoLex, AnnoParse, ExpTerm, BaseTypes
other-modules: TC0, TC, PSLex, AnnoLex, AnnoParse, ExpTerm, BaseTypes
build-depends: base >=4.1
7.2.1
,
build-depends: base >=4.1
3.0.0
,
QuickCheck ^>= 2.15,
QuickCheck ^>= 2.15,
process >= 1.5,
process >= 1.5,
StaX -any, array
StaX -any, array
...
@@ -26,7 +26,7 @@ Test-Suite Test
...
@@ -26,7 +26,7 @@ Test-Suite Test
type: exitcode-stdio-1.0
type: exitcode-stdio-1.0
main-is: Test.hs
main-is: Test.hs
other-modules: AnnoLex, PSLex, TC0, TC
other-modules: AnnoLex, PSLex, TC0, TC
build-depends: base >= 4.
3 && <5
,
build-depends: base >= 4.
13.0.0
,
QuickCheck ^>=2.15,
QuickCheck ^>=2.15,
hspec >=2.10,
hspec >=2.10,
process >=1.5,
process >=1.5,
...
...
This diff is collapsed.
Click to expand it.
gen0_virtuous_cycle/lib/TC.hs
+
3
−
3
View file @
0ba61775
...
@@ -5,7 +5,6 @@ import AnnoLex
...
@@ -5,7 +5,6 @@ import AnnoLex
import
AnnoParse
(
annoParse
)
import
AnnoParse
(
annoParse
)
import
BaseTypes
import
BaseTypes
main
=
putStrLn
"check some types!"
type
Term
=
Expr
BaseType
type
Term
=
Expr
BaseType
ps2exp
::
Token
->
Term
ps2exp
::
Token
->
Term
...
@@ -14,11 +13,11 @@ ps2exp (Unknown "add") = Seq [Neg (Node (IntType)), Neg (Node (IntType)), Node (
...
@@ -14,11 +13,11 @@ ps2exp (Unknown "add") = Seq [Neg (Node (IntType)), Neg (Node (IntType)), Node (
ps2exp
(
Unknown
"pop"
)
=
Neg
Thing
ps2exp
(
Unknown
"pop"
)
=
Neg
Thing
ps2exp
(
Unknown
"dup"
)
=
Seq
[
Neg
Thing
,
Var
0
,
Var
0
]
ps2exp
(
Unknown
"dup"
)
=
Seq
[
Neg
Thing
,
Var
0
,
Var
0
]
ps2exp
(
Annotation
s
)
=
Tag
$
annoParse
$
scanAnnos
s
ps2exp
(
Annotation
s
)
=
Tag
$
annoParse
$
scanAnnos
s
ps2exp
_
=
error
"no Term defined for this PS Token"
data
Env
=
Env
{
stack
::
Term
data
Env
=
Env
{
stack
::
Term
,
popped
::
Term
}
deriving
(
Show
)
,
popped
::
Term
}
deriving
(
Show
)
--longTerm: popped can't really be a list.
--assume NNF
--assume NNF
step
::
Env
->
Term
->
Env
step
::
Env
->
Term
->
Env
step
env
(
Node
a
)
=
env
{
stack
=
stack
env
<>
(
Node
a
)}
step
env
(
Node
a
)
=
env
{
stack
=
stack
env
<>
(
Node
a
)}
...
@@ -28,6 +27,7 @@ step env (Seq (x:xs)) = step (step env x) (Seq xs)
...
@@ -28,6 +27,7 @@ step env (Seq (x:xs)) = step (step env x) (Seq xs)
step
env
(
Neg
(
Node
x
))
=
env
{
stack
=
(
pop
(
stack
env
)),
popped
=
(
popped
env
<>
(
Node
x
))}
-- NO TEST, FIX
step
env
(
Neg
(
Node
x
))
=
env
{
stack
=
(
pop
(
stack
env
)),
popped
=
(
popped
env
<>
(
Node
x
))}
-- NO TEST, FIX
step
env
(
Neg
Thing
)
=
env
{
stack
=
(
pop
(
stack
env
)),
popped
=
(
popped
env
<>
(
top
(
stack
env
)))}
-- << HERE poped thing
step
env
(
Neg
Thing
)
=
env
{
stack
=
(
pop
(
stack
env
)),
popped
=
(
popped
env
<>
(
top
(
stack
env
)))}
-- << HERE poped thing
step
env
(
Var
i
)
=
env
{
stack
=
(
stack
env
)
<>
(
popped
env
!!!
i
)}
-- !! scarry
step
env
(
Var
i
)
=
env
{
stack
=
(
stack
env
)
<>
(
popped
env
!!!
i
)}
-- !! scarry
step
env
x
=
error
$
"next step not known for "
<>
show
x
newEnv
::
Env
newEnv
::
Env
newEnv
=
Env
(
Seq
[]
)
(
Seq
[]
)
newEnv
=
Env
(
Seq
[]
)
(
Seq
[]
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment