[antlr-interest] Again Cobol:

Jim Idle jimi at temporal-wave.com
Thu Jun 11 11:07:06 PDT 2009


Mark Taylor wrote:
> Dave: Yes, Cobol is that evil.  The period closes all previous scopes 
> that don't require explicit scope terminators (some constructs like 
> PERFORM do, some don't (COMPUTE)).  Thanks, that worked.  I replaced 
> the PERFORM rule with:
>
> perform:     'perform' ((stmt)=>stmt)+ 'end-perform' ;
That will parse every stmt twice and performance will be terrible. Make 
a predicate rule instead:

stmt_pred
    : 'if' | 'move' | 'foo'
    ;


((stmt_pred)=>stmt)+

Jim


More information about the antlr-interest mailing list