Package org.jruby.parser

Examples of org.jruby.parser.RubyParserResult


    ParserSupport parserSupport = new ParserSupport();
    RubyStepMeta meta = new RubyStepMeta();
    Ruby runtime = RubyStepFactory.createScriptingContainer(true,meta.getRubyVersion()).getProvider().getRuntime();
    ParserConfiguration parserConfig = new ParserConfiguration(runtime, 0, true, CompatVersion.BOTH);
    parserSupport.setConfiguration(parserConfig);
    parserSupport.setResult(new RubyParserResult());
    parserSupport.setWarnings(new RubyWarnings(null));
    parserSupport.initTopLocalVariables();

    lexer.setEncoding(RubyYaccLexer.UTF8_ENCODING);
    lexer.setParserSupport(parserSupport);
View Full Code Here


    RubyParser parser = RubyParserPool.getInstance().borrowParser(rubyVersion);

    // Create a warnings collector to give to the parser
    RubyParserWarningsCollector warnings = new RubyParserWarningsCollector(rubyRuntime);
    parser.setWarnings(warnings);
    RubyParserResult parserResult = null;
    try {
      parserResult = parser.parse(parserConfiguration, source);
    } catch (SyntaxException e) {
      warnings.syntaxError(e);
    } finally {
View Full Code Here

TOP

Related Classes of org.jruby.parser.RubyParserResult

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.