[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sablecc-user] new SableCC.altgen.20040110 release



From Agbakpem Komivi Kevin:

> You can find the most changes done to SableCC3  inside  the ChangeLog
> file within the SableCC directory.
> Here are the most importants :
>
>     *   1 - Strict type checking of alternative transformations .
>
>           Exemple :
>              prod                                             {->
> ast_node1   ast_node2? }
>                    =   elem1 elem2 elem3       {-> Null      Null };
>       This is incorrect because *ast_node *does not have ? operator
> which indicates that it can be transformed to Null.
>        So the type checking is really strict. In the same way, it is not
> allowed to create an empty list ([ ]) if there is no * operator in the
> corresponding production transformation. Let look at this example :
>           Exemple :
>             prod                                             {->
> ast_node1+  }
>                    =   elem1 elem2 elem3      {-> [ ] };
>
>       This is also incorrect because  + operator indicates that there is
> at least one element in the list whereas the alternative transformation
> list is empty.
>        So due to the strict type checking, this kind of transformation
> is incorrect. It shoud be something like :
>                     ....
>                     =   elem1 elem2 elem3      {-> [  New ast_node1( ...
> ) ... ] };
>
>     * 2 - Automatic empty transformation addition :
>
>              If a whole production (with its alternatives) in section
> *Productions* doesn't have any transformation and there is no production
> with the same name in the section *Abstract Syntax Tree*,  SableCC3
> automatically adds to the production, empty transformation that is :
>                 Example :
>                       ...
>                       Productions
>                              ...
>                              prod_grammar
>                                     =  {alt1} elem1 elem2 elem3
>
>                                      |   {alt2} elem1 elem2
>
>                              ;
>                              ...
>                        Abstract Syntax Tree
>                              ....
>                              // If there is no productions with the name
> *prod_grammar *in this section, the productions *prod_grammar* in the
> section Productions
>                              //will become :
> __________________________________
>                         Productions
>                              ...
>                              prod_grammar
>    {->  }
>                                     =  {alt1} elem1 elem2 elem3   {->   }
>
>                                      |   {alt2} elem1 elem2
>
>    {->   }
>                              ;
>                              ...
>
>
>     * 3  -  Reintroduction of filter() method in the class Parser. Patch
>       submitted by Jon Shapcott and was a little bit modify.
>     * 4  -  List elements in alternative transformationshould now be
>       comma-separated. ( [ elem1, elem2, elem3 ] )
>     * 5  -  ? and + operator are re-allowed in section Abstract Syntax
> Tree. * 6  -  Fix inlining-related bug and some cleanup of the code.
>
> Cheers,
>
> kevin
>
>
> New feature added to SableCC3 : Automatic empty transformation addition
> to production transformation if necessary.