Package org.jruby.parser

Examples of org.jruby.parser.ParserConfiguration


        globalVariables.defineReadonly(name, new ValueAccessor(value));
    }
   
    public Node parseFile(InputStream in, String file, DynamicScope scope) {
        if (parserStats != null) parserStats.addLoadParse();
        return parser.parse(file, in, scope, new ParserConfiguration(0, false, false, true));
    }
View Full Code Here


        return parser.parse(file, in, scope, new ParserConfiguration(0, false, false, true));
    }

    public Node parseInline(InputStream in, String file, DynamicScope scope) {
        if (parserStats != null) parserStats.addEvalParse();
        return parser.parse(file, in, scope, new ParserConfiguration(0, false, true));
    }
View Full Code Here

            bytes = content.getBytes();
        }
       
        if (parserStats != null) parserStats.addEvalParse();
        return parser.parse(file, new ByteArrayInputStream(bytes), scope,
                new ParserConfiguration(lineNumber, false));
    }
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            bytes = content.getBytes();
        }

        return parser.parse(file, new ByteArrayInputStream(bytes), scope,
                new ParserConfiguration(lineNumber, extraPositionInformation, false));
    }
View Full Code Here

                new ParserConfiguration(lineNumber, extraPositionInformation, false));
    }
   
    public Node parseEval(ByteList content, String file, DynamicScope scope, int lineNumber) {
        if (parserStats != null) parserStats.addEvalParse();
        return parser.parse(file, content, scope, new ParserConfiguration(lineNumber, false));
    }
View Full Code Here

    public Node parse(ByteList content, String file, DynamicScope scope, int lineNumber,
            boolean extraPositionInformation) {
        if (parserStats != null) parserStats.addJRubyModuleParse();
        return parser.parse(file, content, scope,
                new ParserConfiguration(lineNumber, extraPositionInformation, false));
    }
View Full Code Here

    lexer = new RubyYaccLexer();

    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();
View Full Code Here

  public static String generateSource(String original) {
    if (original.equals("")) return original;
       
        StringWriter outputWriter = new StringWriter();
        ReWriteVisitor visitor = new ReWriteVisitor(outputWriter, original);
        ParserConfiguration configuration = new ParserConfiguration(0, true, false);
        new Parser(null).parseRewriter("", new ByteArrayInputStream(original.getBytes()), configuration).accept(visitor);
    visitor.flushStream();
    return outputWriter.getBuffer().toString();
  }
View Full Code Here

            System.out.println("Parsing " + args[0] + " " + iterations + " times");
            DefaultRubyParser parser = new DefaultRubyParser();
            parser.setWarnings(new NullWarnings(null));
            Ruby runtime = Ruby.getGlobalRuntime();
            RubyInstanceConfig rconfig = new RubyInstanceConfig();
            ParserConfiguration config = new ParserConfiguration(runtime, 0, false, false, true, rconfig);

            for (int x = 0; x < parsers.length; x++) {
                System.out.println("Benching parse with " + (parsers[x] == 0 ? "InputStream" : "ByteArray") + "LexerSource");
                long start = System.nanoTime();
                for (int i = 0; i < iterations; i++) {
View Full Code Here

        globalVariables.defineReadonly(name, new ValueAccessor(value));
    }

    public Node parseFile(InputStream in, String file, DynamicScope scope, int lineNumber) {
        if (parserStats != null) parserStats.addLoadParse();
        return parser.parse(file, in, scope, new ParserConfiguration(this,
                lineNumber, false, false, true, config));
    }
View Full Code Here

TOP

Related Classes of org.jruby.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.