|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.sdr.PMSD
public class PMSD
Poor Man's SD is a very simple text-based front-end for debugging and testing.
js> PMSD.scrub(PMSD.runTest("<stdio>", > "Comment or title lines at the top are ignored", > "sdr> /setFormation(Formation.SQUARED_SET)", > "sdr> u turn back", > "sdr> /program = Program.PLUS; setFormation(Formation.SQUARED_SET)", > "sdr> do half of a u turn back", > "sdr> /setFormationWithDancers(FormationList.RH_COLUMN, 0, 1, 2, 3)")) |sdr> /setFormation(Formation.SQUARED_SET) || 3Gv 3Bv || || 4B> 2G< || || 4G> 2B< || || 1B^ 1G^ |sdr> u turn back || 3G^ 3B^ || || 4B< 2G> || || 4G< 2B> || || 1Bv 1Gv |sdr> /program = Program.PLUS; setFormation(Formation.SQUARED_SET) || 3Gv 3Bv || || 4B> 2G< || || 4G> 2B< || || 1B^ 1G^ |sdr> do half of a u turn back || 3G> 3B< || || 4Bv 2Gv || || 4G^ 2B^ || || 1B> 1G< |sdr> /setFormationWithDancers(FormationList.RH_COLUMN, 0, 1, 2, 3) || 1B^ 1Gv || || 2B^ 2Gv || || 4G^ 4Bv || || 3G^ 3Bv
js> PMSD.scrub(PMSD.runTest("<stdio>", "sdr> /printFormation")) |sdr> /printFormation || 3Gv 3Bv || || 4B> 2G< || || 4G> 2B< || || 1B^ 1G^ js> PMSD.scrub(PMSD.runTest("<stdio>", "sdr> /ds.currentTime()")) |sdr> /ds.currentTime() |0/1
js> PMSD.scrub(PMSD.runTest("<stdio>", "sdr> /1+2")) |sdr> /1+2 |3 js> PMSD.scrub(PMSD.runTest("<stdio>", "sdr> /function f(x) { return x*2 } ; f(4)")) |sdr> /function f(x) { return x*2 } ; f(4) |8
js> PMSD.scrub(PMSD.runTest("<outer>", > "sdr> /const PMSD=net.cscott.sdr.PMSD;", > "sdr> /PMSD.scrub(PMSD.runTest('<inner>',"+ > "'sdr> /\"whee!\"'))")) |sdr> /const PMSD=net.cscott.sdr.PMSD; |sdr> /PMSD.scrub(PMSD.runTest('<inner>','sdr> /"whee!"')) ||sdr> /"whee!" ||whee!
Nested Class Summary | |
---|---|
static class |
PMSD.State
Class holding properties accessible from the PMSD front-end. |
Method Summary | |
---|---|
static void |
main(String[] args)
Console front end entry point. |
static void |
repl(org.mozilla.javascript.Context cx,
PMSD.State s,
net.cscott.sdr.PMSD.ReaderWriter rw)
Read-evaluate-print loop reusing an existing context and state. |
static void |
repl(net.cscott.sdr.PMSD.ReaderWriter rw,
boolean interactive)
The main read-eval-print loop. |
static String |
runAllTests()
Run all tests from the net.cscott.sdr.tests.index resource. |
static String |
runTest(PMSD.State s,
String sourceName,
List<String> lines)
Run a test transcript, returning the output. |
static String |
runTest(String sourceName,
String... transcript)
Run a test transcript, returning the output. |
static String |
scrub(String input)
Helper function from doctests to tweak output of runTest(java.lang.String, java.lang.String...) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String runAllTests() throws IOException
net.cscott.sdr.tests.index
resource.
IOException
public static String runTest(String sourceName, String... transcript)
public static String scrub(String input)
runTest(java.lang.String, java.lang.String...)
.
public static String runTest(PMSD.State s, String sourceName, List<String> lines)
public static void main(String[] args) throws IOException
IOException
public static void repl(net.cscott.sdr.PMSD.ReaderWriter rw, boolean interactive) throws IOException
IOException
public static void repl(org.mozilla.javascript.Context cx, PMSD.State s, net.cscott.sdr.PMSD.ReaderWriter rw) throws IOException
cx
- JavaScript contexts
- JavaScript scope and staterw
- ReaderWriter object for interaction
IOException
- if interaction object can't read/write
|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |