Module: Idl::Rvalue

Overview

interface for R-values (e.g., expressions that have a value)

Instance Method Summary collapse

Instance Method Details

#type(symtab) ⇒ Type

This method is abstract.

Given a specific symbol table, return the type of this node.

Should not be called until #type_check is called with the same arguments

Parameters:

Returns:

  • (Type)

    The type of the node

Raises:



479
# File 'lib/idl/ast.rb', line 479

def type(symtab) = raise NotImplementedError, "#{self.class.name} has no type"

#value(symtab) ⇒ Object

This method is abstract.

Return the compile-time-known value of the node

Raises:

  • (NotImplementedError)


502
# File 'lib/idl/ast.rb', line 502

def value(symtab) = raise NotImplementedError, "#{self.class.name} must implement value(symtab)"

#values(symtab) ⇒ Array<Integer>, ...

Return a complete list of possible compile-time-known values of the node, or raise a ValueError if the full list cannot be determined

For most AstNodes, this will just be a single-entry array

Parameters:

  • symtab (SymbolTable)

    The context for the evaulation

Returns:

  • (Array<Integer>)

    The complete list of compile-time-known values, when they are integral

  • (Array<Boolean>)

    The complete list of compile-time-known values, when they are booleans

  • (AstNode::ValueError)

    if the list of values is not knowable at compile time



516
# File 'lib/idl/ast.rb', line 516

def values(symtab) = [value(symtab)]