Package mapss.dif.language

mapss.dif.language is implemented based on DIF version 0.2 language grammar.

See:
          Description

Class Summary
DIFWriter DIFWriter class.
LanguageAnalysis This is the analysis class for implementing the DIF compiler for DIF version 0.2.
Reader DIF Reader class.
Writer Writer class.
 

Exception Summary
DIFLanguageException Thrown in case of DIF Language related exceptions.
 

Package mapss.dif.language Description

mapss.dif.language is implemented based on DIF version 0.2 language grammar. It is the package for conversions between DIF files and DIFGraph objects. It includes the Reader and Writer classes.

DIF Reader Specifications

The specifications of the language are defined in the "Chia-Jui Hsu and Shuvra S. Bhattacharyya, Dataflow Interchange Format Version 0.2, Technical Report Draft, Department of Electrical and Computer Engineering, University of Maryland at College Park, 2004".

Some of the implementation details of the DIF Reader are as follows:

How to Add a New Graph Type to the Reader

This package uses SABLECC to parse DIF files. SABLECC can parse a file using the action code written in LanguageAnalysis class or any class extended from that one.

If a graph type is to be added to the default types, first a new language analysis should be written for that graph type. This can be done by extending LanguageAnalysis and overriding the protected methods. Second the path to the new analysis should be added to "analysers.txt" which is in the same directory as this package. Reader class gets the list of default graph types from "analysers.txt" and converts a graph written in DIF to an appropriate type.

How to Add a New Graph Type to the Writer

The Writer class can write any derived graph/hierarchy type of DIFGraph/DIFHierarchy to DIF specification. It will call the appropriate class that inherits DIFWriter to compile the corresponding runtime graph/hierarchy type.

If a graph type is to be added to the default types, first a new xxxToDIFWriter class should be written for that graph type. This can be done by extending DIFWriter and overriding the protected methods. Second the path to the new analysis should be added to "writers.txt" which is in the same directory as this package. Writer class gets the list of default graph types from "writers.txt" and converts a graph to DIF specification.