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

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CParser.



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

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



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

def enumerator
  @statements
end

#parseObject



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

def parse
  parse_toplevel
  enumerator
end

#tokenizeObject

Raises:

  • (NotImplementedError)


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

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