Class: DeepAlgo::IL::Parser
- Inherits:
-
Object
- Object
- DeepAlgo::IL::Parser
- Defined in:
- lib/parser.rb
Constant Summary collapse
- BASE_PATH =
__dir__
Instance Method Summary collapse
-
#initialize(curr_backend) ⇒ Parser
constructor
A new instance of Parser.
- #parse(input) ⇒ Object
Constructor Details
Instance Method Details
#parse(input) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/parser.rb', line 18 def parse(input) data = input.gsub(/(?:#.+?#)/, '') tree = nil begin tree = @parser.parse(data) rescue StandardError DeepAlgo::IL.log.debug('Error when parsing the file') DeepAlgo::IL.log.debug(input.to_s) end DeepAlgo::IL.log.debug(@parser.failure_reason) if tree.nil? tree end |