Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

ptolemy.copernicus.c
Class Context

java.lang.Object
 extended byptolemy.copernicus.c.Context

public class Context
extends java.lang.Object

A class that maintains context information for C code generation.

Since:
Ptolemy II 2.0
Version:
$Id: Context.java,v 1.31 2006年03月28日 23:58:28 cxh Exp $
Author:
Shuvra S. Bhattacharyya
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (ssb)

Constructor Summary
Context()
Construct an empty context.
Method Summary
void addArrayInstance(java.lang.String instanceName)
Add an array instance to the set of array instances in the context.
void addArrayInstances(java.util.Collection instances)
Add an entire collection of array instances.
void addIncludeFile(java.lang.String fileName)
Add an include file to the set of include files in the context.
void clear()
Reset the context to be empty.
void clearDisableImports()
Enable importing of referenced include files.
java.util.HashSet getArrayInstances()
Return an the set of array Instance names in the context.
boolean getDisableImports()
Return true if and only if importing of referenced include files is presently disabled.
java.lang.String getIdentifier(java.lang.String constant)
Return the C identifier that corresponds to a string constant in this context.
java.util.Iterator getIncludeFiles()
Return an Iterator over the set of include files in the context.
static boolean getSingleClassMode()
Return true if and only if single class mode translation is presently enabled.
java.util.Iterator getStringConstants()
Return an Iterator over the set of string constants in the context.
java.lang.String newStringConstant(java.lang.String value)
Add a new string constant to the pool of string constants if the string does not already exist in the pool.
void setDisableImports()
Disable importing of referenced include files.
static void setSingleClassMode()
Turn on (enable) single class mode translation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Context

public Context()
Construct an empty context.

Method Detail

addArrayInstance

public void addArrayInstance(java.lang.String instanceName)
Add an array instance to the set of array instances in the context.

Parameters:
instanceName - The name of the array instance.

addArrayInstances

public void addArrayInstances(java.util.Collection instances)
Add an entire collection of array instances.

Parameters:
instances - The collection of array instances.

addIncludeFile

public void addIncludeFile(java.lang.String fileName)
Add an include file to the set of include files in the context. File name delimiters (double quotes or angle brackets), and the .h suffix, must be included in the argument.

Parameters:
fileName - The name of the include file.

clear

public void clear()
Reset the context to be empty. All information in the current context is discared.


clearDisableImports

public void clearDisableImports()
Enable importing of referenced include files.


getArrayInstances

public java.util.HashSet getArrayInstances()
Return an the set of array Instance names in the context. Each element is a String representing the name of the array instance.

Returns:
The set of array Instances

getDisableImports

public boolean getDisableImports()
Return true if and only if importing of referenced include files is presently disabled.

Returns:
True if and only if importing is disabled.
See Also:
setDisableImports()

getIdentifier

public java.lang.String getIdentifier(java.lang.String constant)
Return the C identifier that corresponds to a string constant in this context.

Parameters:
constant - The string constant.
Returns:
The C identifier.

getIncludeFiles

public java.util.Iterator getIncludeFiles()
Return an Iterator over the set of include files in the context. Each element in the Iterator is a String representing an include file name. Each such file name includes appropriate file name delimiters (double quotes or angle brackets), and the .h suffix.

Returns:
The Iterator.

getSingleClassMode

public static boolean getSingleClassMode()
Return true if and only if single class mode translation is presently enabled. In single class mode, inherited methods and fields are ignored, which can greatly reduce the number of references to other classes. Single class mode is used primarily for diagnostic purposes, and for rapid testing of new code.

Returns:
True if and only if single class mode translation is enabled.
See Also:
setSingleClassMode()

getStringConstants

public java.util.Iterator getStringConstants()
Return an Iterator over the set of string constants in the context.

Returns:
An Iterator over the set of string constants.

newStringConstant

public java.lang.String newStringConstant(java.lang.String value)
Add a new string constant to the pool of string constants if the string does not already exist in the pool. Return the C identifier for the string constant.

Parameters:
value - The string constant.
Returns:
The C identifier.

setDisableImports

public void setDisableImports()
Disable importing of referenced include files.

See Also:
getDisableImports()

setSingleClassMode

public static void setSingleClassMode()
Turn on (enable) single class mode translation.

See Also:
getSingleClassMode()

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /