at.dms.kjc.sir.lowering
Class LoweringConstants

java.lang.Object
  extended by at.dms.kjc.sir.lowering.LoweringConstants

public class LoweringConstants
extends Object

Contains various constants for the lowering process.


Field Summary
static String CHILD_NAME
          The prefix of the name for the variable holding child substreams in structures.
static String CONTEXT_TYPE_NAME
          The name of the type serving as the stream context.
static String CONTEXT_VAR_NAME
          The name of the variable holding the stream context in structures.
static String FILE_READER_WORK_NAME
          The name of the method in the runtime system that runs a filereader.
static String FILE_WRITER_WORK_NAME
          The name of the method in the runtime system that runs a filewriter.
static String IDENTITY_WORK_NAME
          The name of the method in the runtime system that runs identity.
static String INPUT_TAPE_NAME
          The name of the parameter corresponding to the input tape.
static String JOINER_WORK_NAME
          The name of the method in the runtime system that runs a joiner.
static String OUTPUT_TAPE_NAME
          The name of the parameter corresponding to the output tape.
static String SPLITTER_WORK_NAME
          The name of the method in the runtime system that runs a splitter.
static String STATE_PARAM_NAME
          The name of the parameter that functions get to access their fields.
static String TAPE_TYPE_NAME
          The name of the type of the tape parameters to work functions.
 
Constructor Summary
LoweringConstants()
           
 
Method Summary
static String getAnonWorkName()
          Returns a new, unique name for a work function that might have no analogue in the stream structure (is "anonymous")
static JFieldAccessExpression getChildStruct(SIROperator child)
          Returns a field access to , as for use within an init function referencing a child.
static JFieldDeclaration getContextField()
          Returns the field declaration declaring a stream context.
static JExpression getDataField()
          Returns a field access to the current stream structure.
static String getInitName(SIRStream str)
          Returns the name of the flattened init function for .
static JFieldDeclaration getInTapeField()
          Returns a field declaration for the input tape of structures.
static JVariableDefinition getInterfaceTableVariable(JExpression initializer)
          Given the for a field that corresponds to an interface table, returns a variable definition for that field.
static String getMethodName(String streamName, String methodName)
          Given that the name of a stream structure is , and the name of a method in that structure is , returns the name for that methd in the flattened class.
static JFieldDeclaration getOutTapeField()
          Returns a field declaration for the output tape of structures.
static JExpression getParentStructureAccess(SIRIterator iter)
          Creates a field access that gets to the structure of from the toplevel stream.
static JExpression getStreamContext()
          Returns a reference to current stream context inside a work function.
static JExpression getStreamContext(JExpression parentStructure)
          Returns access to stream context given parent structure
static String getUniqueVarName()
          Returns a unique name for a variable to be added to a method of the program.
static String getWorkName(SIRFilter str)
          Returns the name of the flattened work function for .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_READER_WORK_NAME

public static final String FILE_READER_WORK_NAME
The name of the method in the runtime system that runs a filereader.

See Also:
Constant Field Values

FILE_WRITER_WORK_NAME

public static final String FILE_WRITER_WORK_NAME
The name of the method in the runtime system that runs a filewriter.

See Also:
Constant Field Values

IDENTITY_WORK_NAME

public static final String IDENTITY_WORK_NAME
The name of the method in the runtime system that runs identity.

See Also:
Constant Field Values

SPLITTER_WORK_NAME

public static final String SPLITTER_WORK_NAME
The name of the method in the runtime system that runs a splitter.

See Also:
Constant Field Values

JOINER_WORK_NAME

public static final String JOINER_WORK_NAME
The name of the method in the runtime system that runs a joiner.

See Also:
Constant Field Values

CONTEXT_TYPE_NAME

public static final String CONTEXT_TYPE_NAME
The name of the type serving as the stream context.

See Also:
Constant Field Values

CONTEXT_VAR_NAME

public static final String CONTEXT_VAR_NAME
The name of the variable holding the stream context in structures.

See Also:
Constant Field Values

CHILD_NAME

public static final String CHILD_NAME
The prefix of the name for the variable holding child substreams in structures.

See Also:
Constant Field Values

STATE_PARAM_NAME

public static final String STATE_PARAM_NAME
The name of the parameter that functions get to access their fields.

See Also:
Constant Field Values

TAPE_TYPE_NAME

public static final String TAPE_TYPE_NAME
The name of the type of the tape parameters to work functions.

See Also:
Constant Field Values

INPUT_TAPE_NAME

public static final String INPUT_TAPE_NAME
The name of the parameter corresponding to the input tape.

See Also:
Constant Field Values

OUTPUT_TAPE_NAME

public static final String OUTPUT_TAPE_NAME
The name of the parameter corresponding to the output tape.

See Also:
Constant Field Values
Constructor Detail

LoweringConstants

public LoweringConstants()
Method Detail

getUniqueVarName

public static String getUniqueVarName()
Returns a unique name for a variable to be added to a method of the program.


getInterfaceTableVariable

public static JVariableDefinition getInterfaceTableVariable(JExpression initializer)
Given the for a field that corresponds to an interface table, returns a variable definition for that field.


getParentStructureAccess

public static JExpression getParentStructureAccess(SIRIterator iter)
Creates a field access that gets to the structure of from the toplevel stream.


getChildStruct

public static JFieldAccessExpression getChildStruct(SIROperator child)
Returns a field access to , as for use within an init function referencing a child.


getDataField

public static JExpression getDataField()
Returns a field access to the current stream structure.


getContextField

public static JFieldDeclaration getContextField()
Returns the field declaration declaring a stream context.


getInTapeField

public static JFieldDeclaration getInTapeField()
Returns a field declaration for the input tape of structures.


getOutTapeField

public static JFieldDeclaration getOutTapeField()
Returns a field declaration for the output tape of structures.


getMethodName

public static String getMethodName(String streamName,
                                   String methodName)
Given that the name of a stream structure is , and the name of a method in that structure is , returns the name for that methd in the flattened class.


getWorkName

public static String getWorkName(SIRFilter str)
Returns the name of the flattened work function for .


getAnonWorkName

public static String getAnonWorkName()
Returns a new, unique name for a work function that might have no analogue in the stream structure (is "anonymous")


getInitName

public static String getInitName(SIRStream str)
Returns the name of the flattened init function for .


getStreamContext

public static JExpression getStreamContext()
Returns a reference to current stream context inside a work function.


getStreamContext

public static JExpression getStreamContext(JExpression parentStructure)
Returns access to stream context given parent structure