Exception: DrgDSL::UnknownCstError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/drgdsl/ast_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cst, result) ⇒ UnknownCstError

Returns a new instance of UnknownCstError.

Parameters:

  • cst (Hash)

    CST obtained by parser

  • result (Object)

    whatever the AstBuilder was able to generate



11
12
13
14
# File 'lib/drgdsl/ast_builder.rb', line 11

def initialize(cst, result)
  @cst = cst
  @result = result
end

Instance Attribute Details

#cstObject (readonly)

Returns the value of attribute cst.



7
8
9
# File 'lib/drgdsl/ast_builder.rb', line 7

def cst
  @cst
end

#resultObject (readonly)

Returns the value of attribute result.



7
8
9
# File 'lib/drgdsl/ast_builder.rb', line 7

def result
  @result
end

Instance Method Details

#messageObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/drgdsl/ast_builder.rb', line 16

def message
  <<~EOM
    Don't know how to build AST from this CST:

      #{pretty cst}

    Intermediate result:

      #{pretty result}
  EOM
end