Package org.jrubyparser.parser

Examples of org.jrubyparser.parser.ParserConfiguration


    private Module loadFunctionsFromFile(File file, Module parent) {
        try {
            Properties docNodes = collectDocNodes(file);
            Module module = new Module(getModuleName(file), true, parent);
            Parser parser = new Parser();
            Node node = parser.parse(file.getName(), new FileReader(file), new ParserConfiguration());
            List<Node> defnNodes = findNodes(node, new INodeFilter() {

                public void visitStart(Node node) {
                }
View Full Code Here


        return null;
    }

    private Properties collectDocNodes(File file) throws IOException {
        Lexer lexer = new Lexer();
        lexer.setSource(LexerSource.getSource(file.getName(), new FileReader(file), new ParserConfiguration()));
        lexer.setPreserveSpaces(true);
        lexer.setWarnings(new Parser.NullWarnings());
        String doc;
        int token = -1;
        Properties props = new Properties();
View Full Code Here

      try {
        if(MODULEFILE_NAME.equals(path.lastSegment())) {
          if(rubyParser == null) {
            serializer = RubyValueSerializer.INSTANCE;
            rubyParser = new Parser();
            rubyParserConfig = new ParserConfiguration(0, CompatVersion.RUBY1_9);
          }
          RootNode root = (RootNode) rubyParser.parse(
            path.toOSString(), new StringReader(document.get()), rubyParserConfig);
          new LenientModulefileParser(this).parseRubyAST(root, chain);
        }
View Full Code Here

  /**
   * Configure the ruby environment... (very little is needed in this impl).
   */
  public void setUp() {
    parserConfiguration = new ParserConfiguration(startLine, rubyVersion);
  }
View Full Code Here

    }
  }

  public static RootNode parse(String id, Reader reader) throws SyntaxException {
    Parser parser = new Parser();
    return (RootNode) parser.parse(id, reader, new ParserConfiguration(0, CompatVersion.RUBY1_9));
  }
View Full Code Here

TOP

Related Classes of org.jrubyparser.parser.ParserConfiguration

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.