sdr 0.3

net.cscott.sdr.calls.transform
Class Elaborate

java.lang.Object
  extended by net.cscott.sdr.calls.transform.TransformVisitor<Formation>
      extended by net.cscott.sdr.calls.transform.Elaborate

public class Elaborate
extends TransformVisitor<Formation>

The Elaborate class does formation evaluation to eliminate Opt elements in the call tree and identify the dancers in Pars. It inserts Warp elements as needed. The result is a 'simplified tree'.

Version:
$Id: Elaborate.java,v 1.6 2009-02-06 06:27:55 cananian Exp $
Author:
C. Scott Ananian

Method Summary
 List<ParCall> doOptCall(OptCall oc, Formation f)
           
static Comp elaborate(DanceState ds, Formation f, Comp c, boolean doFully)
          Evaluate formations to eliminate Opt elements and identify the dancers in Pars.
 SeqCall visit(Apply a, Formation f)
          Expand any 'Apply' node we come to.
 Comp visit(If iff, Formation f)
           
 OptCall visit(OptCall oc, Formation f)
           
 Comp visit(Opt opt, Formation f)
          Go through list of possible formations, and pick the first one which works.
 ParCall visit(ParCall pc, Formation f)
          Select the given dancers in the formation, and evaluate the child.
 Comp visit(Par p, Formation _f)
          For each select clause, rephrase using 'primitive' tags.
 Comp visit(Warped w, Formation f)
          A little optimization: for pairs of Warps, compose them into one node.
 
Methods inherited from class net.cscott.sdr.calls.transform.TransformVisitor
visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

elaborate

public static Comp elaborate(DanceState ds,
                             Formation f,
                             Comp c,
                             boolean doFully)
Evaluate formations to eliminate Opt elements and identify the dancers in Pars. It inserts Warp elements as needed. The result is a 'simplified tree'.

Parameters:
ds - current static DanceState (program, etc)
f - current Formation (dynamic state)
c - the call component to elaborate
doFully - if false, performs just one step of elaboration; otherwise, evaluate all the way down to a simplified tree.
Returns:
the elaborated call component

visit

public SeqCall visit(Apply a,
                     Formation f)
Expand any 'Apply' node we come to.

Overrides:
visit in class TransformVisitor<Formation>

visit

public Comp visit(If iff,
                  Formation f)
Overrides:
visit in class TransformVisitor<Formation>

visit

public Comp visit(Opt opt,
                  Formation f)
Go through list of possible formations, and pick the first one which works. Generate SELECT and WARP nodes to pull out the subformations.

Overrides:
visit in class TransformVisitor<Formation>

doOptCall

public List<ParCall> doOptCall(OptCall oc,
                               Formation f)

visit

public OptCall visit(OptCall oc,
                     Formation f)
Overrides:
visit in class TransformVisitor<Formation>

visit

public Comp visit(Par p,
                  Formation _f)
For each select clause, rephrase using 'primitive' tags. Ensure that every selected dancer matches one of the clauses.

Overrides:
visit in class TransformVisitor<Formation>

visit

public ParCall visit(ParCall pc,
                     Formation f)
Select the given dancers in the formation, and evaluate the child.

Overrides:
visit in class TransformVisitor<Formation>

visit

public Comp visit(Warped w,
                  Formation f)
A little optimization: for pairs of Warps, compose them into one node.

Overrides:
visit in class TransformVisitor<Formation>

sdr 0.3

Copyright © 2006-2009 C. Scott Ananian