Class: BitClust::FunctionReferenceParser
- Defined in:
- lib/bitclust/functionreferenceparser.rb
Overview
Parser for C API reference file (refm/capi/src/*) Much simpler than Ruby API reference parser(RRDParser) because C APIs does not have library, class, etc.
Class Method Summary collapse
-
.parse_file(path, params = {"version" => "1.9.0"}) ⇒ Object
Returns an array of FunctionEntry.
Instance Method Summary collapse
-
#initialize(db) ⇒ FunctionReferenceParser
constructor
A new instance of FunctionReferenceParser.
- #parse(f, filename, params = {}) ⇒ Object
- #parse_file(path, filename, properties) ⇒ Object
Constructor Details
#initialize(db) ⇒ FunctionReferenceParser
Returns a new instance of FunctionReferenceParser.
25 26 27 |
# File 'lib/bitclust/functionreferenceparser.rb', line 25 def initialize(db) @db = db end |
Class Method Details
.parse_file(path, params = {"version" => "1.9.0"}) ⇒ Object
Returns an array of FunctionEntry
20 21 22 23 |
# File 'lib/bitclust/functionreferenceparser.rb', line 20 def FunctionReferenceParser.parse_file(path, params = {"version" => "1.9.0"}) parser = new(FunctionDatabase.dummy(params)) parser.parse_file(path, File.basename(path, ".rd"), params) end |
Instance Method Details
#parse(f, filename, params = {}) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/bitclust/functionreferenceparser.rb', line 35 def parse(f, filename, params = {}) @filename = filename @path = f.path s = Preprocessor.read(f, params) file_entries LineInput.for_string(s) @db.functions end |