Class: YARD::Parser::C::CParser

Inherits:
Base
  • Object
show all
Defined in:
lib/yard/parser/c/c_parser.rb

Instance Method Summary collapse

Methods inherited from Base

parse

Constructor Details

#initialize(source, file = '(stdin)') ⇒ CParser

Returns a new instance of CParser.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/yard/parser/c/c_parser.rb', line 6

def initialize(source, file = '(stdin)')
  @file = file
  @namespaces = {}
  @content = source
  @index = 0
  @line = 1
  @state = nil
  @newline = true
  @statements = []
  @last_comment = nil
  @last_statement = nil
end

Instance Method Details

#enumeratorObject



24
25
26
# File 'lib/yard/parser/c/c_parser.rb', line 24

def enumerator
  @statements
end

#parseObject



19
20
21
22
# File 'lib/yard/parser/c/c_parser.rb', line 19

def parse
  parse_toplevel
  enumerator
end

#tokenizeObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/yard/parser/c/c_parser.rb', line 28

def tokenize
  raise NotImplementedError, "no tokenization support for C/C++ files"
end