ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- U:RDoc::NormalClass[iI" Ripper:ET@I" Object;To:RDoc::Markup::Document: @parts[ o;;[%o:RDoc::Markup::Paragraph;[I"$Ripper is a Ruby script parser.;To:RDoc::Markup::BlankLineo; ;[I"EYou can get information from the parser with event-based style. ;TI"QInformation such as abstract syntax trees or simple lexical analysis of the ;TI"Ruby program.;T@S:RDoc::Markup::Heading: leveli: textI" Usage;T@o; ;[I"PRipper provides an easy interface for parsing your program into a symbolic ;TI"'expression tree (or S-expression).;T@o; ;[I"JUnderstanding the output of the parser may come as a challenge, it's ;TI"@recommended you use PP to format the output for legibility.;T@o:RDoc::Markup::Verbatim;[I"require 'ripper' ;TI"require 'pp' ;TI" ;TI"@pp Ripper.sexp('def hello(world) "Hello, #{world}!"; end') ;TI" #=> [:program, ;TI" [[:def, ;TI"* [:@ident, "hello", [1, 4]], ;TI" [:paren, ;TI"X [:params, [[:@ident, "world", [1, 10]]], nil, nil, nil, nil, nil, nil]], ;TI" [:bodystmt, ;TI"" [[:string_literal, ;TI"# [:string_content, ;TI"; [:@tstring_content, "Hello, ", [1, 18]], ;TI"P [:string_embexpr, [[:var_ref, [:@ident, "world", [1, 27]]]]], ;TI"8 [:@tstring_content, "!", [1, 33]]]]], ;TI" nil, ;TI" nil, ;TI" nil]]]] ;T: @format0o; ;[I"MYou can see in the example above, the expression starts with +:program+.;T@o; ;[I"SFrom here, a method definition at +:def+, followed by the method's identifier ;TI"O:@ident. After the method's identifier comes the parentheses ;TI"8+:paren+ and the method parameters under +:params+.;T@o; ;[I"RNext is the method body, starting at +:bodystmt+ (+stmt+ meaning statement), ;TI"6which contains the full definition of the method.;T@o; ;[I"GIn our case, we're simply returning a String, so next we have the ;TI""+:string_literal+ expression.;T@o; ;[ I"SWithin our +:string_literal+ you'll notice two @tstring_content, ;TI"Sthis is the literal part for Hello, and !. Between ;TI"Nthe two @tstring_content statements is a +:string_embexpr+, ;TI"Swhere _embexpr_ is an embedded expression. Our expression consists of a local ;TI"Rvariable, or +var_ref+, with the identifier (@ident) of +world+.;T@S; ; i; I"Resources;T@o:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0;[o; ;[I"i{Ruby Inside}[http://www.rubyinside.com/using-ripper-to-see-how-ruby-is-parsing-your-code-5270.html];T@S; ; i; I"Requirements;T@o;;;;[o;;0;[o; ;[I"%ruby 1.9 (support CVS HEAD only);To;;0;[o; ;[I"2bison 1.28 or later (Other yaccs do not work);T@S; ; i; I" License;T@o; ;[I"Ruby License.;T@o;;;;[o;;0;[o; ;[I"Minero Aoki;To;;0;[o; ;[I"aamine@loveruby.net;To;;0;[o; ;[I"http://i.loveruby.net;T: @fileI"ext/ripper/lib/ripper.rb;T:0@omit_headings_from_table_of_contents_below0o;;[;I""ext/ripper/lib/ripper/core.rb;T;0o;;[;I"$ext/ripper/lib/ripper/filter.rb;T;0o;;[;I"#ext/ripper/lib/ripper/lexer.rb;T;0o;;[;I""ext/ripper/lib/ripper/sexp.rb;T;0o;;[;I" parse.c;T;0o;;[;I" parse.y;T;0;0;0[[ U:RDoc::Constant[iI"PARSER_EVENTS;TI"Ripper::PARSER_EVENTS;T: public0o;;[o; ;[I"/This array contains name of parser events.;T;@{;0@{@cRDoc::NormalClass0U;[iI"SCANNER_EVENTS;TI"Ripper::SCANNER_EVENTS;T;0o;;[o; ;[I"0This array contains name of scanner events.;T;@{;0@{@@‘0U;[iI" EVENTS;TI"Ripper::EVENTS;T;0o;;[o; ;[I"3This array contains name of all ripper events.;T;@{;0@{@@‘0U;[iI" Version;TI"Ripper::Version;T;0o;;[o; ;[I"version of Ripper;T@;@‚;0@‚@@‘0[[[I" class;T[[;[[:protected[[: private[[I"dedent_string;TI" parse.c;T[I"lex;TI"#ext/ripper/lib/ripper/lexer.rb;T[I"lex_state_name;T@º[I"new;T@º[I" parse;TI""ext/ripper/lib/ripper/core.rb;T[I" sexp;TI""ext/ripper/lib/ripper/sexp.rb;T[I" sexp_raw;T@Ç[I" slice;T@½[I" tokenize;T@½[I" instance;T[[;[[;[[;[[I" column;T@º[I"compile_error;T@Ä[I"debug_output;T@º[I"debug_output=;T@º[I"dedent_string;T@º[I" encoding;T@º[I"end_seen?;T@º[I" error?;T@º[I" filename;T@º[I" lineno;T@º[I" parse;T@º[I" state;T@º[I" token;T@º[I" warn;T@Ä[I" warning;T@Ä[I" yydebug;T@º[I" yydebug=;T@º[[U:RDoc::Context::Section[i0o;;[;0;0[I"ext/ripper/lib/ripper.rb;TI""ext/ripper/lib/ripper/core.rb;TI"$ext/ripper/lib/ripper/filter.rb;TI"#ext/ripper/lib/ripper/lexer.rb;TI""ext/ripper/lib/ripper/sexp.rb;TI"lib/irb/color.rb;TI"lib/irb/ruby-lex.rb;TI"(lib/rdoc/parser/ripper_state_lex.rb;TI" parse.c;TI" parse.y;T@…cRDoc::TopLevel