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.
26 27 28 |
# File 'lib/bitclust/functionreferenceparser.rb', line 26 def initialize(db) @db = db end |
Class Method Details
.parse_file(path, params = {"version" => "1.9.0"}) ⇒ Object
Returns an array of FunctionEntry
21 22 23 24 |
# File 'lib/bitclust/functionreferenceparser.rb', line 21 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
36 37 38 39 40 41 42 |
# File 'lib/bitclust/functionreferenceparser.rb', line 36 def parse(f, filename, params = {}) @filename = filename @path = f.path s = Preprocessor.read(f, params) file_entries LineInput.for_string(s) @db.functions end |