"Joel E. Denny" <[EMAIL PROTECTED]> writes:

> I like the conciseness of:
>
>   bison_spec(): definition_section() rules_section() user_subroutines() {
>     $bison_spec = new Node();
>     $bison_spec->addNode( $definition_section );
>     $bison_spec->addNode( $rules_section );
>     $bison_spec->addNode( $user_subroutines );
>   }

How about if we support something like this:

  bison_spec: definition_section rules_section user_subroutines {$%};

where "$%" expands to all the "$$ = new...;" stuff.  That's more
concise yet.  Obviously this is just a sketch and more detail would
need to be added, but I hope you get the idea.

I suspect lots of parser-generators do this sort of thing; one that
springs to mind (because we use it locally) is JTB
<http://compilers.cs.ucla.edu/jtb/>.


Reply via email to