123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: YARD::Parser::Base
Defined in: lib/yard/parser/ruby/legacy/ruby_parser.rb

Overview

Since:

  • 0.5.6

Class Method Summary

::YARD::Parser::Base - Inherited

.new

This default constructor does nothing.

.parse

Convenience method to create a new parser and #parse

Instance Method Summary

::YARD::Parser::Base - Inherited

#enumerator

This method should be implemented to return a list of semantic tokens representing the source code to be post-processed.

#parse

This method should be implemented to parse the source and return itself.

#tokenize

This method should be implemented to tokenize given source.

Constructor Details

.new(source, _filename) ⇒ RubyParser

Since:

  • 0.5.6

[ GitHub ]

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

def initialize(source, _filename)
  @source = source
end

Instance Method Details

#encoding_line

Since:

  • 0.5.6

[ GitHub ]

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

def encoding_line; @parse.encoding_line end

#enumerator

Since:

  • 0.5.6

[ GitHub ]

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

def enumerator
  @parse
end

#parse

Since:

  • 0.5.6

[ GitHub ]

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

def parse
  @parse ||= StatementList.new(@source)
  self
end

#shebang_line

Since:

  • 0.5.6

[ GitHub ]

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

def shebang_line; @parse.shebang_line end

#tokenize

Since:

  • 0.5.6

[ GitHub ]

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

def tokenize
  @tokenize ||= TokenList.new(@source)
end