grammar CSV; @members { public static void main(String[] args) throws Exception { CSVLexer lex = new CSVLexer(new ANTLRFileStream(args[0])); CommonTokenStream tokens = new CommonTokenStream(lex); CSVParser parser = new CSVParser(tokens); try { parser.s(); } catch (RecognitionException e) { e.printStackTrace(); } } } /*------------------------------------------------------------------ * LEXER RULES *------------------------------------------------------------------*/ PV : ';' ; US : '\r'? '\n'; NUM : ('0'..'9')+; /*------------------------------------------------------------------ * PARSER RULES *------------------------------------------------------------------*/ s : (sor US)*; sor : oszlop (PV oszlop)+; oszlop : NUM;