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.



1629
1630
1631
# File 'lib/idl/ast.rb', line 1629

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



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

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



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

def execute_unknown(symtab); end

#rhsAstNode

Returns Right-hand side expression.

Returns:

  • (AstNode)

    Right-hand side expression



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

def rhs = children[0]

#to_idlString

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

Returns:

  • (String)

    IDL code for the node



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

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:



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

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:



1640
1641
# File 'lib/idl/ast.rb', line 1640

def type_check(symtab)
end

#value(symtab) ⇒ Object

Return the compile-time-known value of the node



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

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