yalep.antlr.LogicalExpressionErrorListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 3
b 0
f 2
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A syntaxError(Recognizer,Object,int,int,String,RecognitionException) 0 3 1
A reportAmbiguity(Parser,DFA,int,int,boolean,BitSet,ATNConfigSet) 0 3 1
1
package yalep.antlr;
2
3
import org.antlr.v4.runtime.BaseErrorListener;
4
import org.antlr.v4.runtime.Parser;
5
import org.antlr.v4.runtime.RecognitionException;
6
import org.antlr.v4.runtime.Recognizer;
7
import org.antlr.v4.runtime.atn.ATNConfigSet;
8
import org.antlr.v4.runtime.dfa.DFA;
9
10
import java.util.BitSet;
11
12
public class LogicalExpressionErrorListener extends BaseErrorListener {
13
14
15
    @Override
16
    public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
17
        throw new RuntimeException("Expression is ambiguous");
0 ignored issues
show
Best Practice introduced by
Dedicated exceptions should be preferred over throwing the generic Exception.
Loading history...
18
    }
19
20
    @Override
21
    public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {
22
        throw new RuntimeException("Expression has wrong syntax");
0 ignored issues
show
Best Practice introduced by
Dedicated exceptions should be preferred over throwing the generic Exception.
Loading history...
23
    }
24
}
25