Class: Idl::ParseTimeDetectedTypeError

Inherits:
AstNode
  • Object
show all
Defined in:
lib/idlc/ast.rb

Overview

AstNode for an error detected during to_ast. Always causes a type error

Constant Summary

Constants inherited from AstNode

AstNode::Bits1Type, AstNode::Bits32Type, AstNode::Bits64Type, AstNode::BoolType, AstNode::ConstBoolType, AstNode::PossiblyUnknownBits1Type, AstNode::PossiblyUnknownBits32Type, AstNode::PossiblyUnknownBits64Type, AstNode::ReachableFunctionCacheType, AstNode::StringType, AstNode::VoidType

Instance Attribute Summary

Attributes inherited from AstNode

#children, #input, #interval, #parent

Instance Method Summary collapse

Methods inherited from AstNode

#always_terminates?, #declaration?, #executable?, extract_base_var_name, #find_ancestor, #find_dst_registers, #find_referenced_csrs, #find_src_registers, #freeze_tree, from_h, #gen_adoc, #gen_option_adoc, #input_file, input_from_source_yaml, #inspect, #internal_error, interval_from_source_yaml, #lineno, #lines_around, #nullify_assignments, #pass_find_return_values, #path, #print_ast, #prune, #reachable_exceptions, #reachable_functions, #set_input_file, #set_input_file_unless_already_set, #source_line_file_offsets, #source_starting_offset, #source_yaml, #starting_line, #text_value, #truncation_warn, #type_error, #unindent, value_else, #value_else, value_error, #value_error, value_try, #value_try, write_back_nested

Constructor Details

#initialize(input, interval, reason) ⇒ ParseTimeDetectedTypeError

Returns a new instance of ParseTimeDetectedTypeError.



5882
5883
5884
5885
# File 'lib/idlc/ast.rb', line 5882

def initialize(input, interval, reason)
  super(input, interval, EMPTY_ARRAY)
  @reason = reason
end

Instance Method Details

#const_eval?(symtab) ⇒ Boolean

Returns:

  • (Boolean)


5880
# File 'lib/idlc/ast.rb', line 5880

def const_eval?(symtab) = true

#to_hObject



5902
# File 'lib/idlc/ast.rb', line 5902

def to_h = { "kind" => "ParseTimeDetectedTypeError", "reason" => @reason, "source" => source_yaml }

#to_idlObject



5899
# File 'lib/idlc/ast.rb', line 5899

def to_idl = text_value

#type(symtab) ⇒ Object



5893
# File 'lib/idlc/ast.rb', line 5893

def type(symtab) = type_error(@reason)

#type_check(symtab, strict:) ⇒ Object



5888
5889
5890
# File 'lib/idlc/ast.rb', line 5888

def type_check(symtab, strict:)
  type_error @reason
end

#value(symtab) ⇒ Object



5896
# File 'lib/idlc/ast.rb', line 5896

def value(symtab) = value_error "Can't take value of a type error"