[Fai-commit] r3512 - in people/michael/features/setup_harddisks_2: . implementation
Sam Vilain
sam at vilain.net
Wed Jun 14 09:08:40 CEST 2006
fai-commit at lists.alioth.debian.org wrote:
> Author: michael-guest
> Date: 2006-06-12 22:28:28 +0000 (Mon, 12 Jun 2006)
> New Revision: 3512
>
> Modified:
> people/michael/features/setup_harddisks_2/implementation/shdd2-parser
> people/michael/features/setup_harddisks_2/setup_harddisks_2
> Log:
> integrated Sam's parser, minor fixes
>
Hey, nice work.
Note that you can return structured objects from inside the parser code
- in effect building a data structure as you go along - using code
blocks. The return of the code block is the object that you 'return'
from the rule - and the values from those are passed as @item (and
%item) to the code blocks for the rules above them.
I think the example under "Autotrees" in the Parse::RecDescent man page
(http://search.cpan.org/dist/Parse-RecDescent/lib/Parse/RecDescent.pod#Autotrees)
shows how this works visually.
Note that this kind of parsing is core in Perl 6 - using the system of
'rules' (http://dev.perl.org/perl6/doc/design/syn/S05.html).
I hope to have a crack on the code base this week - we've got a
deployment or three coming up now that needs this.
Sam.
More information about the linux-fai-devel
mailing list