Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
core.tokenizer.Switcher Class Reference

Token Switcher. More...

Inherits object.

Public Member Functions

def __init__
 Store the tokens that have not received a destination. More...
 
def send
 Send a token to it's destination. More...
 
def store
 Store a token. More...
 
def sendStored
 Send all the stored tokens that were waiting for a switch to be set. More...
 
def set
 Set the destination of tokens for a given (switch instruction, context) pair. More...
 
def switch
 Send a token to the destination of a SwitchInstruction. More...
 

Public Attributes

 tokenizer
 
 storage
 
 destinations
 

Detailed Description

Token Switcher.

The token switcher is responsible for storing and sending tokens for a switch instruction.

Constructor & Destructor Documentation

def core.tokenizer.Switcher.__init__ (   self,
  tokenizer 
)

Store the tokens that have not received a destination.

Store the known destination of certain switch instructions.

Member Function Documentation

def core.tokenizer.Switcher.send (   self,
  key,
  token 
)

Send a token to it's destination.

Assumes the destination is present in the destination map.

Parameters
keyThe key of the switch.
tokenThe token to send.
def core.tokenizer.Switcher.store (   self,
  key,
  token 
)

Store a token.

Parameters
keyThe key of the switch.
tokenThe token to store.
def core.tokenizer.Switcher.sendStored (   self,
  key,
  dst 
)

Send all the stored tokens that were waiting for a switch to be set.

Parameters
keyThe key of the switch that was set. And the context for which this was set.
dstThe destination for the tokens.
def core.tokenizer.Switcher.set (   self,
  inst,
  cont,
  dst 
)

Set the destination of tokens for a given (switch instruction, context) pair.

This will also release all the tokens that are stored for this context.

Parameters
instThe instruction that sent the switch.
contThe context that received the setSwitch
dstThe destination of the tokens of the switch.
def core.tokenizer.Switcher.switch (   self,
  token,
  inst 
)

Send a token to the destination of a SwitchInstruction.

Store the token if the destination is currently unknown. Only the instruction address of the token tag is modified.

Parameters
tokenThe token to switch
instThe instruction that sent the token.

Member Data Documentation

core.tokenizer.Switcher.tokenizer
core.tokenizer.Switcher.storage
core.tokenizer.Switcher.destinations