mapss.dif.language
Class LanguageAnalysis

java.lang.Object
  extended by mapss.dif.language.sablecc.analysis.AnalysisAdapter
      extended by mapss.dif.language.sablecc.analysis.DepthFirstAdapter
          extended by mapss.dif.language.LanguageAnalysis
All Implemented Interfaces:
Analysis, Switch
Direct Known Subclasses:
BCSDFLanguageAnalysis, BDFLanguageAnalysis, CSDFLanguageAnalysis, HSDFLanguageAnalysis, MDSDFLanguageAnalysis, PSDFLanguageAnalysis, PSDFSpecificationLanguageAnalysis, SDFLanguageAnalysis, SingleRateLanguageAnalysis

public class LanguageAnalysis
extends DepthFirstAdapter

This is the analysis class for implementing the DIF compiler for DIF version 0.2. For learning how to compile DIF files see Reader. SABLECC uses this class to define the actions during parse of a DIF file.

None of the public methods that have "in" and "out" prefixes in this class are for users. Although they are public this is just because SABLECC generated Java files should be able to use those methods.

Behavior of the DIF compiler for converting a DIF file to a graph is defined by the code in this class. This analysis only recognizes the graphs that has the "dif" keyword as the graph type and the runtime type of the graph returned is DIFGraph.

If a different type of graph is needed, a new Analysis extending this one can be written. In the new analysis all protected methods should be overridden in a proper way.

The Reader pre-scans all related dif files and input all hierarchies by externalHierarchies(java.util.Collection). See Reader and package documentation for more information on this package.

Please refer to Compiler.grammar for DIF V0.2 language grammar.

Version:
$Id: LanguageAnalysis.java 420 2007-06-04 18:07:42Z jerryhsu $
Author:
Chia-Jui Hsu based on the first version by Fuat Keceli
See Also:
DIFGraph, DIFHierarchy

Field Summary
protected  DIFGraph _graph
          The graph in the current hierarchy.
protected  java.util.HashMap _hierarchies
           
protected  DIFHierarchy _hierarchy
          The current hierarchy.
protected  DIFHierarchy _subHierarchy
          Current sub-hierarchy in the refinement block.
 
Constructor Summary
LanguageAnalysis()
           
 
Method Summary
protected  boolean _acceptableSubHierarchy(DIFHierarchy hierarchy)
          Returns true if a hierarchy can be a sub-hierarchy of the current one.
protected  void _checkKeyword(java.lang.String name)
          Check to see if the name conflicts with keyword.
protected  mocgraph.Edge _getEmptyEdge(mocgraph.Node source, mocgraph.Node sink)
          Should return an empty edge that can be used in the graph that is constructed.
protected  DIFGraph _getEmptyGraph()
          Should return an empty graph of the type that is going to be constructed with this analysis.
protected  mocgraph.Node _getEmptyNode()
          Should return an empty node that can be used in the graph that is constructed.
protected  java.lang.String _getKeyword()
          Should return the DIF keyword associated with this analysis type.
protected  java.lang.String _getName(PName name)
           
protected  void _processBuiltinAttribute(java.lang.String id, java.lang.Object object, java.lang.Object value, DIFHierarchy hierarchy)
          For each built-in attribute, the derived classes need to override the _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) method in order to handle the built-in functions.
protected  void _setComputationAttribute(java.lang.Object object, java.lang.Object value, DIFGraph graph)
          Common method for built-in attribute or actor attribute "computation".
 void externalHierarchies(java.util.Collection externalHierarchies)
          This method provides additional hierarchies to the analyzer to scan through for finding the subgraphs needed in the refinements.
 DIFHierarchy getHierarchy()
          Returns the hierarchy read with this analysis.
 java.lang.String getKeyword()
          Returns the DIF keyword of the graph type that is handled by this analysis ("dif" for this implementation).
 void inAActorBlock(AActorBlock parseNode)
          For each node representing an actor of design tool's library, an actor block is necessary to specify the attributes of that actor.
 void inAArrayValue(AArrayValue parseNode)
           
 void inABasedonExpression(ABasedonExpression parseNode)
           
 void inABlankParameterExpression(ABlankParameterExpression parseNode)
           
 void inABooleanValue(ABooleanValue parseNode)
           
 void inABuiltinAttributeBlock(ABuiltinAttributeBlock parseNode)
          For built-in attributes, the derived classes need to override the _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) method in order to handle the built-in functions.
 void inAClosedClosedRange(AClosedClosedRange parseNode)
           
 void inAClosedOpenRange(AClosedOpenRange parseNode)
           
 void inAComplexMatrixValue(AComplexMatrixValue parseNode)
           
 void inAComplexValue(AComplexValue parseNode)
           
 void inAConcatenatedStringValue(AConcatenatedStringValue parseNode)
           
 void inADiscreteRange(ADiscreteRange parseNode)
           
 void inADiscreteRangeNumberTail(ADiscreteRangeNumberTail parseNode)
           
 void inADoubleValue(ADoubleValue parseNode)
           
 void inAEdgeDefinition(AEdgeDefinition parseNode)
           
 void inAGraphBlock(AGraphBlock parseNode)
          Parse a graph definition: dataflow model and graph name.
 void inAIdlistAttributeExpression(AIdlistAttributeExpression parseNode)
           
 void inAInputInterfaceExpression(AInputInterfaceExpression parseNode)
           
 void inAIntegerValue(AIntegerValue parseNode)
           
 void inANodeIdentifierTail(ANodeIdentifierTail parseNode)
           
 void inANodePortDefinition(ANodePortDefinition parseNode)
           
 void inANodesTopologyList(ANodesTopologyList parseNode)
           
 void inANumericMatrixValue(ANumericMatrixValue parseNode)
           
 void inAOpenClosedRange(AOpenClosedRange parseNode)
           
 void inAOpenOpenRange(AOpenOpenRange parseNode)
           
 void inAOutputInterfaceExpression(AOutputInterfaceExpression parseNode)
           
 void inAParamsRefinementExpression(AParamsRefinementExpression parseNode)
          Set the value of the sub-parameter to the parameter in this graph.
 void inAPlainPortDefinition(APlainPortDefinition parseNode)
           
 void inAPortsRefinementExpression(APortsRefinementExpression parseNode)
           
 void inARangeParameterExpression(ARangeParameterExpression parseNode)
           
 void inAReferenceActorExpression(AReferenceActorExpression parseNode)
           
 void inAReferenceAttributeExpression(AReferenceAttributeExpression parseNode)
           
 void inARefinementDefinition(ARefinementDefinition parseNode)
          For each supernode-to-subgraph mapping, it is necessary to specify a refinement block.
 void inAReflistActorExpression(AReflistActorExpression parseNode)
           
 void inASubelementAssignAttributeExpression(ASubelementAssignAttributeExpression parseNode)
           
 void inAUserDefinedAttributeBlock(AUserDefinedAttributeBlock parseNode)
           
static boolean isKeyWord(java.lang.String word)
          Checks if a string is a keyword in DIF.
 void outAArrayValue(AArrayValue parseNode)
           
 void outARangeParameterExpression(ARangeParameterExpression parseNode)
           
 void outAValueActorExpression(AValueActorExpression parseNode)
           
 void outAValueAttributeExpression(AValueAttributeExpression parseNode)
           
 void outAValueParameterExpression(AValueParameterExpression parseNode)
           
 
Methods inherited from class mapss.dif.language.sablecc.analysis.DepthFirstAdapter
caseAActorBlock, caseAActorBody, caseAArrayValue, caseAAttrDataType, caseAAttributeBody, caseAAttrType, caseABasedonBlock, caseABasedonBody, caseABasedonExpression, caseABlankParameterExpression, caseABooleanValue, caseABuiltinAttributeBlock, caseAClosedClosedRange, caseAClosedOpenRange, caseAComplex, caseAComplexMatrixValue, caseAComplexRow, caseAComplexRowTail, caseAComplexTail, caseAComplexValue, caseAConcatenatedStringValue, caseADataType, caseADiscreteRange, caseADiscreteRangeNumberTail, caseADoubleNumber, caseADoubleValue, caseAEdgeDefinition, caseAEdgeDefinitionTail, caseAEdgesTopologyList, caseAFalseBooleanValue, caseAGraphBlock, caseAGraphList, caseAIdentifierName, caseAIdList, caseAIdlistAttributeExpression, caseAInputInterfaceExpression, caseAIntegerNumber, caseAIntegerValue, caseAInterfaceBlock, caseAInterfaceBody, caseANodeIdentifierTail, caseANodePortDefinition, caseANodesTopologyList, caseANumericMatrixValue, caseANumericRow, caseANumericRowTail, caseANumericTail, caseAOpenClosedRange, caseAOpenOpenRange, caseAOutputInterfaceExpression, caseAParameterBlock, caseAParameterBody, caseAParamsRefinementExpression, caseAParamType, caseAPlainPortDefinition, caseAPortDefinitionTail, caseAPortsRefinementExpression, caseARangeBlock, caseARangeParameterExpression, caseARangeTail, caseAReferenceActorExpression, caseAReferenceAttributeExpression, caseARefIdTail, caseARefinementBlock, caseARefinementBody, caseARefinementDefinition, caseAReflistActorExpression, caseAStringIdentifierName, caseAStringValue, caseASubelementAssignAttributeExpression, caseATopologyBlock, caseATopologyBody, caseATrueBooleanValue, caseAUserDefinedAttributeBlock, caseAValueActorExpression, caseAValueAttributeExpression, caseAValueParameterExpression, caseAValueTail, caseStart, defaultIn, defaultOut, inAActorBody, inAAttrDataType, inAAttributeBody, inAAttrType, inABasedonBlock, inABasedonBody, inAComplex, inAComplexRow, inAComplexRowTail, inAComplexTail, inADataType, inADoubleNumber, inAEdgeDefinitionTail, inAEdgesTopologyList, inAFalseBooleanValue, inAGraphList, inAIdentifierName, inAIdList, inAIntegerNumber, inAInterfaceBlock, inAInterfaceBody, inANumericRow, inANumericRowTail, inANumericTail, inAParameterBlock, inAParameterBody, inAParamType, inAPortDefinitionTail, inARangeBlock, inARangeTail, inARefIdTail, inARefinementBlock, inARefinementBody, inAStringIdentifierName, inAStringValue, inATopologyBlock, inATopologyBody, inATrueBooleanValue, inAValueActorExpression, inAValueAttributeExpression, inAValueParameterExpression, inAValueTail, inStart, outAActorBlock, outAActorBody, outAAttrDataType, outAAttributeBody, outAAttrType, outABasedonBlock, outABasedonBody, outABasedonExpression, outABlankParameterExpression, outABooleanValue, outABuiltinAttributeBlock, outAClosedClosedRange, outAClosedOpenRange, outAComplex, outAComplexMatrixValue, outAComplexRow, outAComplexRowTail, outAComplexTail, outAComplexValue, outAConcatenatedStringValue, outADataType, outADiscreteRange, outADiscreteRangeNumberTail, outADoubleNumber, outADoubleValue, outAEdgeDefinition, outAEdgeDefinitionTail, outAEdgesTopologyList, outAFalseBooleanValue, outAGraphBlock, outAGraphList, outAIdentifierName, outAIdList, outAIdlistAttributeExpression, outAInputInterfaceExpression, outAIntegerNumber, outAIntegerValue, outAInterfaceBlock, outAInterfaceBody, outANodeIdentifierTail, outANodePortDefinition, outANodesTopologyList, outANumericMatrixValue, outANumericRow, outANumericRowTail, outANumericTail, outAOpenClosedRange, outAOpenOpenRange, outAOutputInterfaceExpression, outAParameterBlock, outAParameterBody, outAParamsRefinementExpression, outAParamType, outAPlainPortDefinition, outAPortDefinitionTail, outAPortsRefinementExpression, outARangeBlock, outARangeTail, outAReferenceActorExpression, outAReferenceAttributeExpression, outARefIdTail, outARefinementBlock, outARefinementBody, outARefinementDefinition, outAReflistActorExpression, outAStringIdentifierName, outAStringValue, outASubelementAssignAttributeExpression, outATopologyBlock, outATopologyBody, outATrueBooleanValue, outAUserDefinedAttributeBlock, outAValueTail, outStart
 
Methods inherited from class mapss.dif.language.sablecc.analysis.AnalysisAdapter
caseEOF, caseTActor, caseTAttribute, caseTBasedon, caseTBlank, caseTColon, caseTComma, caseTComment, caseTDot, caseTDouble, caseTEdges, caseTEqual, caseTFalse, caseTGraph, caseTIdentifier, caseTInputs, caseTInteger, caseTInterface, caseTLBkt, caseTLPar, caseTLSqr, caseTNodes, caseTOutputs, caseTParameter, caseTPlus, caseTRBkt, caseTRefinement, caseTRPar, caseTRSqr, caseTSemicolon, caseTSQte, caseTString, caseTStringIdentifier, caseTStringTail, caseTTopology, caseTTrue, defaultCase, getIn, getOut, setIn, setOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_graph

protected DIFGraph _graph
The graph in the current hierarchy. Value of this field changes with each new graph block entered.


_hierarchy

protected DIFHierarchy _hierarchy
The current hierarchy. Value of this field changes with each new graph block entered.


_hierarchies

protected java.util.HashMap _hierarchies

_subHierarchy

protected DIFHierarchy _subHierarchy
Current sub-hierarchy in the refinement block.

Constructor Detail

LanguageAnalysis

public LanguageAnalysis()
Method Detail

externalHierarchies

public void externalHierarchies(java.util.Collection externalHierarchies)
This method provides additional hierarchies to the analyzer to scan through for finding the subgraphs needed in the refinements. Each entry in the collection should be a DIFHierarchy (otherwise that entry will be skipped). Sub-hierarchies will be obtained by mirroring the hierarchies in this collection.

Parameters:
externalHierarchies - A collection of Hierarchies.

getHierarchy

public DIFHierarchy getHierarchy()
Returns the hierarchy read with this analysis.

Returns:
A DIFHierarchy.

getKeyword

public java.lang.String getKeyword()
Returns the DIF keyword of the graph type that is handled by this analysis ("dif" for this implementation).

Returns:
A DIF graph type keyword.

isKeyWord

public static boolean isKeyWord(java.lang.String word)
Checks if a string is a keyword in DIF. Keywords should not be used as labels in graphs. The derived classes should override this method to add their own key words.

Parameters:
word - A string to be checked.
Returns:
True if the string is a keyword in DIF.

inAGraphBlock

public void inAGraphBlock(AGraphBlock parseNode)
Parse a graph definition: dataflow model and graph name. The Reader pre-scans all related dif files and input all hierarchies by externalHierarchies(java.util.Collection). Therefore, this method do not have to put _hierarchy into _hierarchies. According to the previous compiled DIFHierarchies, _hierarchies, we check that the current graph (hierarchy) use the predefined name or not. The name of DIFGraph and DIFHierarchy is set to the same as parseNode.getName().getText().

Overrides:
inAGraphBlock in class DepthFirstAdapter

inABasedonExpression

public void inABasedonExpression(ABasedonExpression parseNode)
Overrides:
inABasedonExpression in class DepthFirstAdapter

inANodesTopologyList

public void inANodesTopologyList(ANodesTopologyList parseNode)
Overrides:
inANodesTopologyList in class DepthFirstAdapter

inANodeIdentifierTail

public void inANodeIdentifierTail(ANodeIdentifierTail parseNode)
Overrides:
inANodeIdentifierTail in class DepthFirstAdapter

inAEdgeDefinition

public void inAEdgeDefinition(AEdgeDefinition parseNode)
Overrides:
inAEdgeDefinition in class DepthFirstAdapter

inAInputInterfaceExpression

public void inAInputInterfaceExpression(AInputInterfaceExpression parseNode)
Overrides:
inAInputInterfaceExpression in class DepthFirstAdapter

inAOutputInterfaceExpression

public void inAOutputInterfaceExpression(AOutputInterfaceExpression parseNode)
Overrides:
inAOutputInterfaceExpression in class DepthFirstAdapter

inAPlainPortDefinition

public void inAPlainPortDefinition(APlainPortDefinition parseNode)
Overrides:
inAPlainPortDefinition in class DepthFirstAdapter

inANodePortDefinition

public void inANodePortDefinition(ANodePortDefinition parseNode)
Overrides:
inANodePortDefinition in class DepthFirstAdapter

inABlankParameterExpression

public void inABlankParameterExpression(ABlankParameterExpression parseNode)
Overrides:
inABlankParameterExpression in class DepthFirstAdapter

outAValueParameterExpression

public void outAValueParameterExpression(AValueParameterExpression parseNode)
Overrides:
outAValueParameterExpression in class DepthFirstAdapter

inARangeParameterExpression

public void inARangeParameterExpression(ARangeParameterExpression parseNode)
Overrides:
inARangeParameterExpression in class DepthFirstAdapter

inAClosedClosedRange

public void inAClosedClosedRange(AClosedClosedRange parseNode)
Overrides:
inAClosedClosedRange in class DepthFirstAdapter

inAOpenClosedRange

public void inAOpenClosedRange(AOpenClosedRange parseNode)
Overrides:
inAOpenClosedRange in class DepthFirstAdapter

inAClosedOpenRange

public void inAClosedOpenRange(AClosedOpenRange parseNode)
Overrides:
inAClosedOpenRange in class DepthFirstAdapter

inAOpenOpenRange

public void inAOpenOpenRange(AOpenOpenRange parseNode)
Overrides:
inAOpenOpenRange in class DepthFirstAdapter

inADiscreteRange

public void inADiscreteRange(ADiscreteRange parseNode)
Overrides:
inADiscreteRange in class DepthFirstAdapter

inADiscreteRangeNumberTail

public void inADiscreteRangeNumberTail(ADiscreteRangeNumberTail parseNode)
Overrides:
inADiscreteRangeNumberTail in class DepthFirstAdapter

outARangeParameterExpression

public void outARangeParameterExpression(ARangeParameterExpression parseNode)
Overrides:
outARangeParameterExpression in class DepthFirstAdapter

inARefinementDefinition

public void inARefinementDefinition(ARefinementDefinition parseNode)
For each supernode-to-subgraph mapping, it is necessary to specify a refinement block. The subhierarchy (subgraph) instance will be directed refered by superhierarchy (supergraph) instead of mirroring.

Overrides:
inARefinementDefinition in class DepthFirstAdapter

inAPortsRefinementExpression

public void inAPortsRefinementExpression(APortsRefinementExpression parseNode)
Overrides:
inAPortsRefinementExpression in class DepthFirstAdapter

inAParamsRefinementExpression

public void inAParamsRefinementExpression(AParamsRefinementExpression parseNode)
Set the value of the sub-parameter to the parameter in this graph. The blank sub-parameter can be set in the refinement block in the super graph. The original value of the sub-parameter will be reset by this parameter-refinement mechanism.

Overrides:
inAParamsRefinementExpression in class DepthFirstAdapter

inABuiltinAttributeBlock

public void inABuiltinAttributeBlock(ABuiltinAttributeBlock parseNode)
For built-in attributes, the derived classes need to override the _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) method in order to handle the built-in functions.

Overrides:
inABuiltinAttributeBlock in class DepthFirstAdapter

inAUserDefinedAttributeBlock

public void inAUserDefinedAttributeBlock(AUserDefinedAttributeBlock parseNode)
Overrides:
inAUserDefinedAttributeBlock in class DepthFirstAdapter

outAValueAttributeExpression

public void outAValueAttributeExpression(AValueAttributeExpression parseNode)
Overrides:
outAValueAttributeExpression in class DepthFirstAdapter

inAReferenceAttributeExpression

public void inAReferenceAttributeExpression(AReferenceAttributeExpression parseNode)
Overrides:
inAReferenceAttributeExpression in class DepthFirstAdapter

inASubelementAssignAttributeExpression

public void inASubelementAssignAttributeExpression(ASubelementAssignAttributeExpression parseNode)
Overrides:
inASubelementAssignAttributeExpression in class DepthFirstAdapter

inAIdlistAttributeExpression

public void inAIdlistAttributeExpression(AIdlistAttributeExpression parseNode)
Overrides:
inAIdlistAttributeExpression in class DepthFirstAdapter

inAActorBlock

public void inAActorBlock(AActorBlock parseNode)
For each node representing an actor of design tool's library, an actor block is necessary to specify the attributes of that actor.

An attribute of an actor can specify the parameter value of that actor. In this case, the attribute id is the parameter id and the attribute value is the parameter value.

An attribute can also specify the connection of the node (actor). In this case, the attribute id is the port id or argument id and the attribute value is the connected object's id.

All actor attributes and their value are stored as node attributes in DIF.

Overrides:
inAActorBlock in class DepthFirstAdapter

outAValueActorExpression

public void outAValueActorExpression(AValueActorExpression parseNode)
Overrides:
outAValueActorExpression in class DepthFirstAdapter

inAReferenceActorExpression

public void inAReferenceActorExpression(AReferenceActorExpression parseNode)
Overrides:
inAReferenceActorExpression in class DepthFirstAdapter

inAReflistActorExpression

public void inAReflistActorExpression(AReflistActorExpression parseNode)
Overrides:
inAReflistActorExpression in class DepthFirstAdapter

inAIntegerValue

public void inAIntegerValue(AIntegerValue parseNode)
Overrides:
inAIntegerValue in class DepthFirstAdapter

inADoubleValue

public void inADoubleValue(ADoubleValue parseNode)
Overrides:
inADoubleValue in class DepthFirstAdapter

inAComplexValue

public void inAComplexValue(AComplexValue parseNode)
Overrides:
inAComplexValue in class DepthFirstAdapter

inANumericMatrixValue

public void inANumericMatrixValue(ANumericMatrixValue parseNode)
Overrides:
inANumericMatrixValue in class DepthFirstAdapter

inAComplexMatrixValue

public void inAComplexMatrixValue(AComplexMatrixValue parseNode)
Overrides:
inAComplexMatrixValue in class DepthFirstAdapter

inAConcatenatedStringValue

public void inAConcatenatedStringValue(AConcatenatedStringValue parseNode)
Overrides:
inAConcatenatedStringValue in class DepthFirstAdapter

inABooleanValue

public void inABooleanValue(ABooleanValue parseNode)
Overrides:
inABooleanValue in class DepthFirstAdapter

inAArrayValue

public void inAArrayValue(AArrayValue parseNode)
Overrides:
inAArrayValue in class DepthFirstAdapter

outAArrayValue

public void outAArrayValue(AArrayValue parseNode)
Overrides:
outAArrayValue in class DepthFirstAdapter

_acceptableSubHierarchy

protected boolean _acceptableSubHierarchy(DIFHierarchy hierarchy)
Returns true if a hierarchy can be a sub-hierarchy of the current one. Type compatibility of underlying graphs should be checked. This implementation returns true if the type of this graph is DIF or the underlying graph classes are the same.

Parameters:
hierarchy - Sub hierarchy to add.
Returns:
True if underlying graphs are compatible.

_checkKeyword

protected void _checkKeyword(java.lang.String name)
Check to see if the name conflicts with keyword. If yes, this method will throw exception.


_getEmptyEdge

protected mocgraph.Edge _getEmptyEdge(mocgraph.Node source,
                                      mocgraph.Node sink)
Should return an empty edge that can be used in the graph that is constructed. Source and the sink nodes of the edge should be as given in the parameters. In this implementation an edge with an empty DIFEdgeWeight is returned.

Parameters:
source - Source node for the edge.
sink - Sink node for the edge.
Returns:
An edge.

_getEmptyGraph

protected DIFGraph _getEmptyGraph()
Should return an empty graph of the type that is going to be constructed with this analysis. For this implementation returns a graph with runtime type of DIFGraph.

Returns:
An instance of DIFGraph.

_getEmptyNode

protected mocgraph.Node _getEmptyNode()
Should return an empty node that can be used in the graph that is constructed. In this implementation a node with an empty DIFNodeWeight is returned.

Returns:
A new node.

_getKeyword

protected java.lang.String _getKeyword()
Should return the DIF keyword associated with this analysis type. For this implementation it returns "dif".

Returns:
Analysis keyword which is "dif" for this implementation.

_getName

protected java.lang.String _getName(PName name)

_processBuiltinAttribute

protected void _processBuiltinAttribute(java.lang.String id,
                                        java.lang.Object object,
                                        java.lang.Object value,
                                        DIFHierarchy hierarchy)
                                 throws DIFLanguageException
For each built-in attribute, the derived classes need to override the _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) method in order to handle the built-in functions. There are two situations to use use method. In the first case, this method processes the given built-in attribute of the object. The object is an Edge/Node/Port in the graph or hierarchy. Note that in this case, this built-in attribute belongs to object and _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) set the attribute of that object. The most common situation to use built-in attribute is production, consumption, delay, and computation.

In the second case, _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) can also be used to assign or refer elements in graph or hierarchy. In details, object is the target object and value is the source object. object and value can be either Edge/Node /Port/DIFParameter according to the overrided _processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy).

This method should first validate all input arguments and then performs its task.

Parameters:
id - Name of the attribute being processed.
object - An Edge/Node/Port in the graph/hierarchy.
value - Containing the value of the attribute or the refered value(instance) of the object.
hierarchy - The graph to which the dif file is being read.
Throws:
DIFLanguageException

_setComputationAttribute

protected void _setComputationAttribute(java.lang.Object object,
                                        java.lang.Object value,
                                        DIFGraph graph)
                                 throws DIFLanguageException
Common method for built-in attribute or actor attribute "computation".

Parameters:
object - The node.
value - The String contains the computation.
graph -
Throws:
DIFLanguageException