mondokm / ltlverif

0 stars 2 forks source link

Workaround for Antlr bug #2

Open ghost opened 4 years ago

ghost commented 4 years ago

Antlr issue: https://github.com/antlr/antlr4/issues/2016

Work around is a small patch to the grammar:

binaryLtlExpr:
    ltlExpr |
    op1=binaryLtlExpr type=binaryLtlOp op2=binaryLtlExpr;

from the original one:

binaryLtlExpr:
    ltlExpr |
    ops+=binaryLtlExpr type=binaryLtlOp ops+=binaryLtlExpr;

The visitor must be patched too: ctx.ops.get(0) will become ctx.op1 in ToStringVisitor.java. Same goes for ctx.ops.get(1).