Class: ADSL::Parser::ASTDereference

Inherits:
ASTNode show all
Defined in:
lib/adsl/parser/ast_nodes.rb

Instance Method Summary collapse

Methods inherited from ASTNode

#==, #adsl_ast, #adsl_ast_size, #block_replace, #dup, #hash, is_formula?, is_objset?, is_statement?, node_type, #optimize, #preorder_traverse

Methods included from Verification::FormulaGenerators

#[], #and, #binary_op, #binary_op_with_any_number_of_params, #equiv, #exists, #false, #forall, #handle_quantifier, #implies, #in_formula_builder, #not, #or, #true

Methods included from Verification::Utils

#classname_for_classname, #infer_classname_from_varname, #t

Instance Method Details

#objset_has_side_effects?Boolean

Returns:

  • (Boolean)


1121
1122
1123
# File 'lib/adsl/parser/ast_nodes.rb', line 1121

def objset_has_side_effects?
  @objset.nil? ? false : @objset.objset_has_side_effects?
end

#to_adslObject



1133
1134
1135
# File 'lib/adsl/parser/ast_nodes.rb', line 1133

def to_adsl
  "#{ @objset.to_adsl }.#{ rel_name.text }"
end

#typecheck_and_resolve(context) ⇒ Object

Raises:



1125
1126
1127
1128
1129
1130
1131
# File 'lib/adsl/parser/ast_nodes.rb', line 1125

def typecheck_and_resolve(context)
  objset = @objset.typecheck_and_resolve context
  klass = objset.type
  raise ADSLError, 'Empty objset dereference' if klass.nil?
  relation = context.find_relation objset.type, @rel_name.text, @rel_name.lineno
  return ADSL::DS::DSDereference.new :objset => objset, :relation => relation
end