-
Notifications
You must be signed in to change notification settings - Fork 1
/
LogExtractorListener.java
37 lines (32 loc) · 1.04 KB
/
LogExtractorListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class LogExtractorListener extends SASLogBaseListener {
private boolean source;
private boolean source2;
private boolean mprint;
public LogExtractorListener(boolean source, boolean source2, boolean mprint) {
this.source = source;
this.source2 = source2;
this.mprint = mprint;
}
@Override
public void exitSource(SASLogParser.SourceContext ctx) {
if (source) {
if (ctx.SOURCE().getText().length() > 12) {
System.out.print(ctx.SOURCE().getText().substring(11));
}
}
}
@Override
public void exitSource2(SASLogParser.Source2Context ctx) {
if (source2) {
if (ctx.SOURCE2().getText().length() > 12) {
System.out.print(ctx.SOURCE2().getText().substring(11));
}
}
}
@Override
public void exitMprint(SASLogParser.MprintContext ctx) {
if (mprint) {
System.out.print(ctx.MPRINT().getText().substring(ctx.MPRINT().getText().indexOf(':') + 1));
}
}
}