[antlr-interest] Re: Syntactic Predicate with Tree Grammar

Fred phreed at gmail.com
Thu Feb 14 12:38:05 PST 2008


Apparently, this is a known bug in the way the DFA is generated.
I introduced a k=4 option to the rule and all is well.

>  Given an AST as follows...
>  <A>
>   <B>
>     <C>
>       <E>
>         <F>
>     <D>
>       <F>
>
>  ...or expanded into a node list {where '(' means DOWN and ')' means UP}...
>
>  A ( B ( C ( E ( F ) ) D ( F ) ) )
>
>  ...and a tree grammar (fragment)...
>
>  expr
>   : (^(B ^(C .) .))=>
>     ^(B ^(C a1=.) b1=.) -> doX()
>   | ^(B a2=. b2=.) -> doY()
>   ;
>
>  ...I get an error like...
>
>  A.g: node from after line ..:.. no viable alternative at input 'UP'
>
>  ...where the line number corresponds to the C node.
>


More information about the antlr-interest mailing list