Package org.renjin.parser

Examples of org.renjin.parser.RdParser$Lexer


public class RdParserTest extends EvalTestCase {

  @Test
  public void simple() throws IOException {
   
    RdParser parser = new RdParser();
    ListVector result = (ListVector) parser.R_ParseRd(new StringReader("\\name{plotf}"), Null.INSTANCE, false);
    assertThat(result.length(), equalTo(1));
    ListVector header = (ListVector) result.getElementAsSEXP(0);
    assertThat(header.getAttribute(Symbol.get("Rd_tag")), equalTo(c("\\name")));
View Full Code Here


  private void compareTree(String resourceName, SEXP expected) throws IOException {
    InputStream in = getClass().getResourceAsStream(resourceName);
    InputStreamReader reader = new InputStreamReader(in);
   
    RdParser parser = new RdParser();
    ListVector result = (ListVector) parser.R_ParseRd(reader, Null.INSTANCE, false);

    compareNode(resourceName, result, expected);
  }
View Full Code Here

   * @throws IOException
   */
  public static String parseExamples(File file) throws IOException {
    try {
      FileReader reader = new FileReader(file);
      RdParser parser = new RdParser();
      SEXP rd = parser.R_ParseRd(reader, StringVector.valueOf(file.getName()), false);

      ExamplesParser examples = new ExamplesParser();
      rd.accept(examples);

      return examples.code.toString();
View Full Code Here

TOP

Related Classes of org.renjin.parser.RdParser$Lexer

Copyright © 2018 www.massapicom. 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.