On Mon, Dec 15, 2008 at 6:09 PM, Patrick McCarty <pnor...@gmail.com> wrote:

> Hi Trevor,
>
> On Mon, Dec 15, 2008 at 2:12 PM, Trevor Bača <trevorb...@gmail.com> wrote:
> >
> > * OK, so based on this understanding, can somebody please correct my
> > understanding of the parsing (not the iteration, just the parsing) of the
> > following expression (which is the same as my original example #2):
> >
> >   {
> >     \new Voice {
> >       c'8 c'8 c'8 c'8
> >     }
> >     d'8 d'8 d'8 d'8
> >   }
> >
> > If I'm understanding how the parser works, then what should result here
> is a
> > music expression that looks like this:
> >
> >                  Global
> >                     V
> >                \new Score
> >                     V
> >                \new Staff
> >                     V
> >                \new Voice
> >                     V
> >                 Sequential
> >                     V
> >     \new Voice, d'8, d'8, d'8, d'8
> >        V
> >     Sequential
> >        V
> > c'8, c'8, c'8, c'8
> >
> >
> > If I'm counting correctly, that's 15 total nodes in the expression tree.
> > Eight atomic nodes and seven internal nodes. The Global, \new Score, \new
> > Staff and the first \new Voice are all created implicitly.
> >
> > I know that the next part in the process is iteration. But I want to stop
> > and check my understanding here: am I understanding the output of the
> parser
> > correctly at this point?
>
> I'm pretty sure this would be the result *after* iteration.
>
> The parser output can be visualized with \displayMusic.  So your
> example would look like this, using your convention above:
>
>          Sequential
>          V        V
>   \new Voice       d'8, d'8, d'8, d'8
>     V
>  Sequential
>     V
>  c'8, c'8, c'8, c'8
>
> After this, the iteration process starts, proceeding moment by moment
> and making sure everything is placed in the correct context.  Then you
> would end up with a tree that looks like the one you posted.  I
> believe the implicit creation of contexts happens during iteration.
>
> (I could be completely wrong, but it makes sense to me).


OK, and Han-Wen confirms what you're saying, too.

Much appreciated. Going back to look at more code now ...




-- 
Trevor Bača
trevorb...@gmail.com
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to