sdr 0.7

net.cscott.sdr.calls.transform
Class Finish

java.lang.Object
  extended by net.cscott.sdr.calls.transform.TransformVisitor<T>
      extended by net.cscott.sdr.calls.transform.PartsVisitor<Void>
          extended by net.cscott.sdr.calls.transform.Finish
Direct Known Subclasses:
FirstPart, LikeA

public class Finish
extends PartsVisitor<Void>

Transformation implementing C1List.FINISH. Removes the first part of the call.

Author:
C. Scott Ananian
See Also:
C4List.LIKE_A, C4List._FIRST_PART
Tests:
Use Finish class to evaluate FINISH SWING THRU and FINISH FINISH SWING THRU:
js> importPackage(net.cscott.sdr.calls)
js> importPackage(net.cscott.sdr.calls.ast)
js> importPackage(net.cscott.sdr.util)
js> ds = new DanceState(new DanceProgram(Program.C1), Formation.SQUARED_SET); undefined;
js> callname="swing thru"
swing thru
js> call = net.cscott.sdr.calls.CallDB.INSTANCE.lookup(callname)
swing thru[basic]
js> comp = call.getEvaluator(null, java.util.Arrays.asList()).simpleExpansion()
(In '6 (Seq (Apply (Expr _maybe touch (Expr _quarter thru '1/2) '2))))
js> fst = comp.accept(new Finish(ds), null)
(Seq (Part 'DIVISIBLE '1 (Opt (From 'ANY (Seq (Part 'DIVISIBLE '1 (Seq (Apply (Expr _those who can turn left not grand '1/2)))))))))
js> try {
  >   fst.accept(new Finish(ds), null)
  > } catch (e) {
  >   print(e.javaException)
  > }
net.cscott.sdr.calls.BadCallException: Only one part

Nested Class Summary
static class Finish.PartSelectorCall
          Helper class to define concepts based on this class (and subclasses of it).
 
Constructor Summary
  Finish(DanceState ds)
           
protected Finish(String conceptName, Set<String> safeConcepts, DanceState ds)
           
 
Method Summary
 Comp visit(If iff, Void t)
           
 Comp visit(In in, Void t)
           
 OptCall visit(OptCall oc, Void t)
           
 Part visit(Part p, Void t)
           
 SeqCall visit(Prim p, Void t)
           
 Comp visit(Seq s, Void t)
           
 
Methods inherited from class net.cscott.sdr.calls.transform.PartsVisitor
desugarAnd, visit
 
Methods inherited from class net.cscott.sdr.calls.transform.TransformVisitor
visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Finish

public Finish(DanceState ds)

Finish

protected Finish(String conceptName,
                 Set<String> safeConcepts,
                 DanceState ds)
Method Detail

visit

public Comp visit(In in,
                  Void t)
Overrides:
visit in class TransformVisitor<Void>

visit

public SeqCall visit(Prim p,
                     Void t)
Overrides:
visit in class TransformVisitor<Void>

visit

public Part visit(Part p,
                  Void t)
Overrides:
visit in class TransformVisitor<Void>

visit

public Comp visit(Seq s,
                  Void t)
Overrides:
visit in class TransformVisitor<Void>

visit

public OptCall visit(OptCall oc,
                     Void t)
Overrides:
visit in class TransformVisitor<Void>

visit

public Comp visit(If iff,
                  Void t)
Overrides:
visit in class TransformVisitor<Void>

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian