Class: YARD::Parser::Ruby::RubyParser

Inherits:
Base
  • Object
show all
Defined in:
lib/yard/parser/ruby/ruby_parser.rb

Overview

Ruby 1.9 parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, filename) ⇒ RubyParser

Returns a new instance of RubyParser.



13
14
15
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 13

def initialize(source, filename)
  @parser = RipperParser.new(source, filename)
end

Instance Attribute Details

#encoding_lineObject (readonly)

Ruby 1.9 parser



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 12

class RubyParser < Parser::Base
  def initialize(source, filename)
    @parser = RipperParser.new(source, filename)
  end

  def parse; @parser.parse end
  def tokenize; @parser.tokens end
  def enumerator; @parser.enumerator end
  def shebang_line; @parser.shebang_line end
  def encoding_line; @parser.encoding_line end
  def frozen_string_line; @parser.frozen_string_line end
end

#enumeratorObject (readonly)

Ruby 1.9 parser



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 12

class RubyParser < Parser::Base
  def initialize(source, filename)
    @parser = RipperParser.new(source, filename)
  end

  def parse; @parser.parse end
  def tokenize; @parser.tokens end
  def enumerator; @parser.enumerator end
  def shebang_line; @parser.shebang_line end
  def encoding_line; @parser.encoding_line end
  def frozen_string_line; @parser.frozen_string_line end
end

#frozen_string_lineObject (readonly)

Ruby 1.9 parser



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 12

class RubyParser < Parser::Base
  def initialize(source, filename)
    @parser = RipperParser.new(source, filename)
  end

  def parse; @parser.parse end
  def tokenize; @parser.tokens end
  def enumerator; @parser.enumerator end
  def shebang_line; @parser.shebang_line end
  def encoding_line; @parser.encoding_line end
  def frozen_string_line; @parser.frozen_string_line end
end

#shebang_lineObject (readonly)

Ruby 1.9 parser



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 12

class RubyParser < Parser::Base
  def initialize(source, filename)
    @parser = RipperParser.new(source, filename)
  end

  def parse; @parser.parse end
  def tokenize; @parser.tokens end
  def enumerator; @parser.enumerator end
  def shebang_line; @parser.shebang_line end
  def encoding_line; @parser.encoding_line end
  def frozen_string_line; @parser.frozen_string_line end
end

Instance Method Details

#parseObject



17
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 17

def parse; @parser.parse end

#tokenizeObject



18
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 18

def tokenize; @parser.tokens end