Class: Baykit::BayServer::Bcf::BcfParser
- Inherits:
-
Object
- Object
- Baykit::BayServer::Bcf::BcfParser
- Defined in:
- lib/baykit/bayserver/bcf/bcf_parser.rb
Defined Under Namespace
Classes: LineInfo
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#indent_map ⇒ Object
readonly
Returns the value of attribute indent_map.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#line_no ⇒ Object
readonly
Returns the value of attribute line_no.
-
#prev_line_info ⇒ Object
readonly
Returns the value of attribute prev_line_info.
Instance Method Summary collapse
-
#initialize ⇒ BcfParser
constructor
A new instance of BcfParser.
- #parse(file) ⇒ Object
Constructor Details
#initialize ⇒ BcfParser
Returns a new instance of BcfParser.
29 30 31 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 29 def initialize @indent_map = [] end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
10 11 12 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 10 def file_name @file_name end |
#indent_map ⇒ Object (readonly)
Returns the value of attribute indent_map.
14 15 16 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 14 def indent_map @indent_map end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
12 13 14 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 12 def input @input end |
#line_no ⇒ Object (readonly)
Returns the value of attribute line_no.
11 12 13 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 11 def line_no @line_no end |
#prev_line_info ⇒ Object (readonly)
Returns the value of attribute prev_line_info.
13 14 15 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 13 def prev_line_info @prev_line_info end |
Instance Method Details
#parse(file) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/baykit/bayserver/bcf/bcf_parser.rb', line 33 def parse(file) doc = BcfDocument.new @file_name = file @line_no = 0 @input = File.open(file) parse_same_level(doc.content_list, 0) @input.close return doc end |