@Test public void testParser3() throws RecognitionException, TokenStreamException { String string = "{importDirectory=/home/pavels/.kramerius4/import;ingestUrl=http\\: ParamsParser paramsParser = new ParamsParser(new ParamsLexer(new StringReader(string))); List params = paramsParser.params(); Assert.assertTrue(params.size() == 2); Assert.assertTrue(params.get(0).equals("importDirectory=/home/pavels/.kramerius4/import")); Assert.assertTrue(params.get(1).equals("ingestUrl=http: }
public final List params() throws RecognitionException, TokenStreamException { List prms; prms=new java.util.ArrayList(); String pr1 = null; List lpr1 = null; String pr2=null; List lpr2=null; try { match(LPAREN); { switch ( LA(1)) { case ANY: { pr1=param(); prms.add(pr1); break; } case LPAREN: { lpr1=params(); prms.add(lpr1); break; } case SEMI: case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { _loop5: do { if ((LA(1)==SEMI)) { match(SEMI); { switch ( LA(1)) { case ANY: { pr2=param(); prms.add(pr2); break; } case LPAREN: { lpr2=params(); prms.add(lpr2); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop5; } } while (true); } match(RPAREN); } catch (RecognitionException ex) { reportError(ex); recover(ex,_tokenSet_0); } return prms; }
ParamsParser extends antlr.LLkParser implements ParamsParserTokenTypes { public final List params() throws RecognitionException, TokenStreamException { List prms; prms=new java.util.ArrayList(); String pr1 = null; List lpr1 = null; String pr2=null; List lpr2=null; try { match(LPAREN); { switch ( LA(1)) { case ANY: { pr1=param(); prms.add(pr1); break; } case LPAREN: { lpr1=params(); prms.add(lpr1); break; } case SEMI: case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { _loop5: do { if ((LA(1)==SEMI)) { match(SEMI); { switch ( LA(1)) { case ANY: { pr2=param(); prms.add(pr2); break; } case LPAREN: { lpr2=params(); prms.add(lpr2); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop5; } } while (true); } match(RPAREN); } catch (RecognitionException ex) { reportError(ex); recover(ex,_tokenSet_0); } return prms; } }
ParamsParser extends antlr.LLkParser implements ParamsParserTokenTypes { public final List params() throws RecognitionException, TokenStreamException { List prms; prms=new java.util.ArrayList(); String pr1 = null; List lpr1 = null; String pr2=null; List lpr2=null; try { match(LPAREN); { switch ( LA(1)) { case ANY: { pr1=param(); prms.add(pr1); break; } case LPAREN: { lpr1=params(); prms.add(lpr1); break; } case SEMI: case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { _loop5: do { if ((LA(1)==SEMI)) { match(SEMI); { switch ( LA(1)) { case ANY: { pr2=param(); prms.add(pr2); break; } case LPAREN: { lpr2=params(); prms.add(lpr2); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop5; } } while (true); } match(RPAREN); } catch (RecognitionException ex) { reportError(ex); recover(ex,_tokenSet_0); } return prms; } protected  ParamsParser(TokenBuffer tokenBuf, int k);  ParamsParser(TokenBuffer tokenBuf); protected  ParamsParser(TokenStream lexer, int k);  ParamsParser(TokenStream lexer);  ParamsParser(ParserSharedInputState state); }
ParamsParser extends antlr.LLkParser implements ParamsParserTokenTypes { public final List params() throws RecognitionException, TokenStreamException { List prms; prms=new java.util.ArrayList(); String pr1 = null; List lpr1 = null; String pr2=null; List lpr2=null; try { match(LPAREN); { switch ( LA(1)) { case ANY: { pr1=param(); prms.add(pr1); break; } case LPAREN: { lpr1=params(); prms.add(lpr1); break; } case SEMI: case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { _loop5: do { if ((LA(1)==SEMI)) { match(SEMI); { switch ( LA(1)) { case ANY: { pr2=param(); prms.add(pr2); break; } case LPAREN: { lpr2=params(); prms.add(lpr2); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop5; } } while (true); } match(RPAREN); } catch (RecognitionException ex) { reportError(ex); recover(ex,_tokenSet_0); } return prms; } protected  ParamsParser(TokenBuffer tokenBuf, int k);  ParamsParser(TokenBuffer tokenBuf); protected  ParamsParser(TokenStream lexer, int k);  ParamsParser(TokenStream lexer);  ParamsParser(ParserSharedInputState state); final List params(); final String param(); final String paramkey(); }
ParamsParser extends antlr.LLkParser implements ParamsParserTokenTypes { public final List params() throws RecognitionException, TokenStreamException { List prms; prms=new java.util.ArrayList(); String pr1 = null; List lpr1 = null; String pr2=null; List lpr2=null; try { match(LPAREN); { switch ( LA(1)) { case ANY: { pr1=param(); prms.add(pr1); break; } case LPAREN: { lpr1=params(); prms.add(lpr1); break; } case SEMI: case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } { _loop5: do { if ((LA(1)==SEMI)) { match(SEMI); { switch ( LA(1)) { case ANY: { pr2=param(); prms.add(pr2); break; } case LPAREN: { lpr2=params(); prms.add(lpr2); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop5; } } while (true); } match(RPAREN); } catch (RecognitionException ex) { reportError(ex); recover(ex,_tokenSet_0); } return prms; } protected  ParamsParser(TokenBuffer tokenBuf, int k);  ParamsParser(TokenBuffer tokenBuf); protected  ParamsParser(TokenStream lexer, int k);  ParamsParser(TokenStream lexer);  ParamsParser(ParserSharedInputState state); final List params(); final String param(); final String paramkey(); static final String[] _tokenNames; static final BitSet _tokenSet_0; }