/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getDefaultEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getDefaultEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getDefaultEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getDefaultEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getKCode().getEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
/** The parse method use an lexer stream and parse it to an AST node * structure */ public RubyParserResult parse(ParserConfiguration configuration, LexerSource source) throws IOException { support.reset(); support.setConfiguration(configuration); support.setResult(new RubyParserResult()); lexer.reset(); lexer.setSource(source); lexer.setEncoding(configuration.getKCode().getEncoding()); yyparse(lexer, configuration.isDebug() ? new YYDebug() : null); return support.getResult(); } }
private void initLexer(String title) { LexerSource lexerSource = new ByteListLexerSource(title, 0, new ByteList(utf8Bytes), null); lexerSource.setEncoding(UTF8Encoding.INSTANCE); ParserSupport parserSupport = new ParserSupport(); lexer = new RubyLexer(parserSupport, lexerSource, new NullWarnings(Ruby.getGlobalRuntime())); parserSupport.setLexer(lexer); parserSupport.setConfiguration(new ParserConfiguration(Ruby.getGlobalRuntime(), 0, false, true, false)); parserSupport.setResult(new RubyParserResult()); parserSupport.setWarnings(new NullWarnings(Ruby.getGlobalRuntime())); parserSupport.initTopLocalVariables(); lexer.setState(LexingCommon.EXPR_BEG); }