Package org.jrubyparser.parser

Examples of org.jrubyparser.parser.RubyParser


   * @param configuration
   * @return
   * @throws IOException
   */
  protected Result internalParse(String file, Reader content, ParserConfiguration configuration) throws IOException {
    RubyParser parser;
    if(configuration.getVersion() == CompatVersion.RUBY1_8) {
      parser = new Ruby18Parser();
    }
    else {
      parser = new Ruby19Parser();
    }
    RubyParserWarningsCollector warnings = new RubyParserWarningsCollector();
    parser.setWarnings(warnings);

    LexerSource lexerSource = LexerSource.getSource(file, content, configuration);

    Node parserResult = null;
    try {
      parserResult = parser.parse(configuration, lexerSource).getAST();

    }
    catch(SyntaxException e) {
      warnings.syntaxError(e);
    }
View Full Code Here

TOP

Related Classes of org.jrubyparser.parser.RubyParser

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.