INPUT:
Mar 9 10:19:07 west info tmm1[17280]: 01870003:6:
/Common/mysaml.app/mysaml:Common:00000000: helloasdfasdf asdfadf vgnfg
GRAMMAR:
grammar scratch;
lines : datestamp hostname level proc msgnum module msgstring;
datestamp: month day time;
//month : MONTH;
day : INTEGER;
time : INTEGER ':' INTEGER ':' INTEGER;
hostname : STRING;
level : ALPHA;
proc: procname '[' procnum ']' ':';
procname : STRING;
procnum : INTEGER;
msgnum : INTEGER ':' DIGIT':';
module : '/' DOTSLASHSTRING ':' PARTITION ':' SESSID ':';
PARTITION: STRING;
sessid : HEX;
msgstring: MSGSTRING;
DOTSLASHSTRING : [a-zA-Z./]+;
SESSID : HEX;
INTEGER : [0-9]+;
DIGIT: [0-9];
STRING : [a-zA-Z][a-zA-Z0-9]*;
HEX : [a-f0-9]+;
//ALPHA: [a-zA-Z]+;
ALPHA: ('['|'(') .*? (']'|')');
MSGSTRING : [a-zA-Z0-9':,_(). ]+ [\r];
// | 'Agent' MSGSTRING;
month : 'Jan' | 'Feb' | 'Mar' | 'Apr' | 'May' | 'Jun' | 'Jul' | 'Aug' | 'Sep' | 'Oct' | 'Nov' | 'Dec' ;
WS : [ \t\r\n]+ -> skip;
PROBLEM: the parse tree shows that the month is populated properly, but the next item, day is not. In the parse tree, it shows day is set to the entire rest of the input. Don't see how this is possible.
Error from parser is:
line 1:4 mismatched input '9' expecting INTEGER