Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
compilerconstruction
ssm
Commits
019f3055
Commit
019f3055
authored
Jun 16, 2015
by
Atze Dijkstra
Browse files
2.2.0 distr
parent
bb5bf64e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Tests/t01.ssm
View file @
019f3055
lx:
lx:
bra lz
ly:
l1:
lz: ldc 3
ldc 4
ldc -4
ldc 0x5
ldc -0x6
ldc l3
annote SP -3 0 red "Pushed constants"
add
mul
sub
bra l2
l3: bra l1
l2: bra l3
ldc l4
l4: bsr l4
l1: halt
lz: ldc 3
ldc 4
ldc -4
ldc 0x5
ldc -0x6
ldc ly
annote SP -3 0 red "Pushed constants"
add
mul
sub
trap 0
bra l1
src/nl/uu/cs/ssm/Config.java
View file @
019f3055
...
...
@@ -37,7 +37,7 @@ public class Config
public
static
final
String
version
()
{
return
"2.2.0"
;
}
public
static
final
String
versionDate
()
{
return
"June
3
, 2015"
;
}
public
static
final
String
versionDate
()
{
return
"June
16
, 2015"
;
}
public
static
final
String
author
()
{
return
"Atze Dijkstra, Utrecht University"
;
}
...
...
src/nl/uu/cs/ssmui/Runner.java
View file @
019f3055
...
...
@@ -56,11 +56,13 @@ public class Runner extends Thread
System
.
out
.
println
(
"Simple Stack Machine Interpreter"
);
System
.
out
.
println
(
"Version "
+
Config
.
version
()
+
", "
+
Config
.
versionDate
());
System
.
out
.
println
(
"usage: [--clisteps <steps>] [--cli] [--file <path> OR --stdin]"
);
System
.
out
.
println
(
"\t--clisteps <steps>: The amount of steps to run. -1 for infinite(default). Only in cli mode"
);
System
.
out
.
println
(
"\t--stdin: Read code from stdin"
);
System
.
out
.
println
(
"\t--file <path>: Read code from path"
);
System
.
out
.
println
(
"\t--cli: No GUI, runs code and exits on halt"
);
System
.
out
.
println
(
"\t--guidelay: Amount of time to sleep in milliseconds between steps in the GUI. Default: 50"
);
System
.
out
.
println
(
" --help : Print this help"
);
System
.
out
.
println
(
" --version : Print version"
);
System
.
out
.
println
(
" --clisteps <steps> : The amount of steps to run. -1 for infinite(default). Only in cli mode"
);
System
.
out
.
println
(
" --stdin : Read code from stdin"
);
System
.
out
.
println
(
" --file <path> : Read code from path"
);
System
.
out
.
println
(
" --cli : No GUI, runs code and exits on halt"
);
System
.
out
.
println
(
" --guidelay : Amount of time to sleep in milliseconds between steps in the GUI. Default: 50"
);
System
.
exit
(
1
);
}
...
...
@@ -92,6 +94,13 @@ public class Runner extends Thread
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
String
key
=
args
[
i
];
switch
(
key
)
{
case
"--help"
:
usage
();
break
;
case
"--version"
:
System
.
out
.
println
(
Config
.
version
()
);
System
.
exit
(
0
);
break
;
case
"--clisteps"
:
i
++;
steps
=
Long
.
parseLong
(
args
[
i
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment