mapss.dif.mdsdf
Class MDSDFLanguageAnalysis

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
              extended by mapss.dif.mdsdf.MDSDFLanguageAnalysis
All Implemented Interfaces:
Analysis, Switch

public class MDSDFLanguageAnalysis
extends LanguageAnalysis

This analysis extends LanguageAnalysis to read DIF specification of MDSDF graphs.

The graph type keyword used in the dif file should be "mdsdf" and runtime type of the returned graph will a MDSDFGraph.

For MDSDF graphs, the production and consumption rates are stored in int[] and the delay is stored in int[].

Version:
$Id: MDSDFLanguageAnalysis.java 1687 2007-05-08 01:38:09Z jerryhsu $
Author:
Chia-Jui Hsu
See Also:
LanguageAnalysis, MDSDFGraph, MDSDFEdgeWeight

Field Summary
 
Fields inherited from class mapss.dif.language.LanguageAnalysis
_graph, _hierarchies, _hierarchy, _subHierarchy
 
Constructor Summary
MDSDFLanguageAnalysis()
           
 
Method Summary
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  void _processBuiltinAttribute(java.lang.String id, java.lang.Object object, java.lang.Object value, DIFHierarchy hierarchy)
          Override LanguageAnalysis._processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) to process built-in attributes: production, consumption, delay, and computation.
static boolean isKeyWord(java.lang.String word)
           
 
Methods inherited from class mapss.dif.language.LanguageAnalysis
_acceptableSubHierarchy, _checkKeyword, _getName, _setComputationAttribute, externalHierarchies, getHierarchy, getKeyword, inAActorBlock, inAArrayValue, inABasedonExpression, inABlankParameterExpression, inABooleanValue, inABuiltinAttributeBlock, inAClosedClosedRange, inAClosedOpenRange, inAComplexMatrixValue, inAComplexValue, inAConcatenatedStringValue, inADiscreteRange, inADiscreteRangeNumberTail, inADoubleValue, inAEdgeDefinition, inAGraphBlock, inAIdlistAttributeExpression, inAInputInterfaceExpression, inAIntegerValue, inANodeIdentifierTail, inANodePortDefinition, inANodesTopologyList, inANumericMatrixValue, inAOpenClosedRange, inAOpenOpenRange, inAOutputInterfaceExpression, inAParamsRefinementExpression, inAPlainPortDefinition, inAPortsRefinementExpression, inARangeParameterExpression, inAReferenceActorExpression, inAReferenceAttributeExpression, inARefinementDefinition, inAReflistActorExpression, inASubelementAssignAttributeExpression, inAUserDefinedAttributeBlock, outAArrayValue, outARangeParameterExpression, outAValueActorExpression, outAValueAttributeExpression, outAValueParameterExpression
 
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
 

Constructor Detail

MDSDFLanguageAnalysis

public MDSDFLanguageAnalysis()
Method Detail

isKeyWord

public static boolean isKeyWord(java.lang.String word)

_getEmptyEdge

protected mocgraph.Edge _getEmptyEdge(mocgraph.Node source,
                                      mocgraph.Node sink)
Description copied from class: LanguageAnalysis
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.

Overrides:
_getEmptyEdge in class LanguageAnalysis
Parameters:
source - Source node for the edge.
sink - Sink node for the edge.
Returns:
An edge.

_getEmptyGraph

protected DIFGraph _getEmptyGraph()
Description copied from class: LanguageAnalysis
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.

Overrides:
_getEmptyGraph in class LanguageAnalysis
Returns:
An instance of DIFGraph.

_getEmptyNode

protected mocgraph.Node _getEmptyNode()
Description copied from class: LanguageAnalysis
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.

Overrides:
_getEmptyNode in class LanguageAnalysis
Returns:
A new node.

_getKeyword

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

Overrides:
_getKeyword in class LanguageAnalysis
Returns:
Analysis keyword which is "dif" for this implementation.

_processBuiltinAttribute

protected void _processBuiltinAttribute(java.lang.String id,
                                        java.lang.Object object,
                                        java.lang.Object value,
                                        DIFHierarchy hierarchy)
                                 throws DIFLanguageException
Override LanguageAnalysis._processBuiltinAttribute(java.lang.String, java.lang.Object, java.lang.Object, mapss.dif.DIFHierarchy) to process built-in attributes: production, consumption, delay, and computation.

If value is a DIFParameter, this method will find the actual value object. The object is an Edge in the mdsdfd graph of hierarchy or a Port in the hierarchy.

For MDSDF graphs, production and consumption rates are stored in int[] and delays are also stored in int[]. Attributes value Production and consumption of port is also stored in int[]. This method checks value and id and throw DIFLanguageException when they are invalid.

Overrides:
_processBuiltinAttribute in class LanguageAnalysis
Parameters:
object - An Edge in the mdsdf graph of hierarchy or a Port in the hierarchy.
id - Name of the attribute being processed.
value - The Token value of this built-in attribute or the DIFParameter refer to the actual value object.
hierarchy - The DIFHierarchy object containing the MDSDFGraph object.
Throws:
DIFLanguageException
See Also:
MDSDFEdgeWeight