Package org.renjin.parser

Examples of org.renjin.parser.RLexer.yylex()


  private void assertTokenSequence(String source, LexExpectation... expects) {
    Reader reader = new StringReader(source);
    RLexer lexer = new RLexer(ParseOptions.defaults(), new ParseState(), reader);

    for (int i = 0; i != expects.length; ++i) {
      assertThat("token " + (i + 1), lexer.yylex(), equalTo(expects[i].expectedToken));
      assertThat(lexer.getLVal(), expects[i].sexpMatcher);
    }
    assertThat("end of input", lexer.yylex(), equalTo(END_OF_INPUT));
  }
}
View Full Code Here


    for (int i = 0; i != expects.length; ++i) {
      assertThat("token " + (i + 1), lexer.yylex(), equalTo(expects[i].expectedToken));
      assertThat(lexer.getLVal(), expects[i].sexpMatcher);
    }
    assertThat("end of input", lexer.yylex(), equalTo(END_OF_INPUT));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.