Class: Idl::PcAssignmentAst

Inherits:
AstNode
  • Object
show all
Includes:
Executable
Defined in:
lib/idl/ast.rb

Instance Method Summary collapse

Constructor Details

#initialize(input, interval, rval) ⇒ PcAssignmentAst

Returns a new instance of PcAssignmentAst.



1634
1635
1636
# File 'lib/idl/ast.rb', line 1634

def initialize(input, interval, rval)
  super(input, interval, [rval])
end

Instance Method Details

#execute(symtab) ⇒ void

This method returns an undefined value.

“execute” the statement by updating the variables in the symbol table

Parameters:

  • symtab (SymbolTable)

    The symbol table for the context

Raises:

  • ValueError if some part of the statement cannot be executed at compile time



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

def execute(symtab) = value_error "$pc is never statically known"

#execute_unknown(symtab) ⇒ void

This method returns an undefined value.

“execute” the statement, forcing any variable assignments to an unknown state This is used down unknown conditional paths.

Parameters:

  • symtab (SymbolTable)

    The symbol table for the context

Raises:

  • ValueError if some part of the statement cannot be executed at compile time



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

def execute_unknown(symtab); end

#rhsAstNode

Returns Right-hand side expression.

Returns:

  • (AstNode)

    Right-hand side expression



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

def rhs = children[0]

#to_idlString

Return valid IDL representation of the node (and its subtree)

Returns:

  • (String)

    IDL code for the node



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

def to_idl = "$pc = #{rhs.to_idl}"

#type(symtab) ⇒ Type

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:



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

def type(symtab) = symtab.xreg_type

#type_check(symtab) ⇒ void

This method returns an undefined value.

type check this node and all children

Calls to #type and/or #value may depend on type_check being called first with the same symtab. If not, those functions may raise an AstNode::InternalError

Parameters:

Raises:



1645
1646
# File 'lib/idl/ast.rb', line 1645

def type_check(symtab)
end

#value(symtab) ⇒ Object

Return the compile-time-known value of the node



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

def value(symtab) = value_error "$pc is never statically known"