[LLVMdev] Oddity in StackerParser.y.

Jeff Cohen jeffc at jolt-lang.org
Thu Apr 20 09:52:42 PDT 2006


No, $2 is correct.  The { } code block before DefinitionList is counted 
(or more precisely, the empty sequence of terminals preceding it is 
counted).

Ralph Corderoy wrote:

>Hi,
>
>    $ g -1 '^Module' StackerParser.y
>    /* A module is just a DefinitionList */
>    Module    :                 { SCI->handle_module_start( ); }
>              DefinitionList    { $$ = SCI->handle_module_end( $2 ); } ;
>    $
>
>It's been years since I was heavily into yacc, but shouldn't it be
>s/$2/$1/?
>
>Cheers,
>
>
>Ralph.
>
>
>_______________________________________________
>LLVM Developers mailing list
>LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
>  
>




More information about the llvm-dev mailing list