byucc.edif.javacc
Class EdifMergeParser

java.lang.Object
  extended bybyucc.edif.javacc.EdifParserCore
      extended bybyucc.edif.javacc.EdifParser
          extended bybyucc.edif.javacc.EdifMergeParser
All Implemented Interfaces:
EdifParserCoreConstants

public class EdifMergeParser
extends EdifParser

Provides all the funtionality needed to generate a parser and manipulate the parser, with extended merge and directory search capabilities. Extends the EdifParser.

Version:
$Id: EdifMergeParser.java,v 1.18 2004/05/19 17:40:59 tsa6 Exp $
Author:
Tyler Anderson

Nested Class Summary
static class EdifMergeParser.SubFiles
          Used for parsing the files out of an argument list.
 
Nested classes inherited from class byucc.edif.javacc.EdifParserCore
EdifParserCore.JJCalls
 
Field Summary
static java.lang.String[] EDIF_EXTENSIONS
          The types of acceptable extensions for EDIF files.
static int MIN_ARGS
          The value of the minimum # of args for this class.
static java.lang.String usageString
          The value of the string printed out when there is a problem with the argument string.
 
Fields inherited from class byucc.edif.javacc.EdifParserCore
jj_input_stream, jj_nt, lookingAhead, token, token_source
 
Fields inherited from interface byucc.edif.javacc.EdifParserCoreConstants
ABS, ACLOAD, AFTER, AND, ANGLE, ANNOTATE, APPLY, ARC, ARRAY, ARRAYMACRO, ARRAYRELATEDINFO, ARRAYSITE, ATLEAST, ATMOST, AUTHOR, BASEARRAY, BECOMES, BEHAVIOR, BETWEEN, BOOLEAN, BOOLEANDISPLAY, BOOLEANMAP, BORDERPATTERN, BORDERWIDTH, BOUNDINGBOX, CALCULATED, CAPACITANCE, CEILING, CELL, CELLREF, CELLTYPE, CENTERCENTER, CENTERLEFT, CENTERRIGHT, CHANGE, CHARGE, CIRCLE, COLOR, COMMENT, COMMENTGRAPHICS, COMPOUND, CONCAT, CONDUCTANCE, CONNECTLOCATION, CONSTANT, CONSTRAINT, CONTENTS, CORNERTYPE, CRITICALITY, CURRENT, CURRENTMAP, CURVE, CYCLE, DATAORIGIN, DCFANINLOAD, DCFANOUTLOAD, DCMAXFANIN, DCMAXFANOUT, DEFAULT, DELAY, DELTA, DERIVATION, DESIGN, DESIGNATOR, DIFFERENCE, DIGIT, DIRECTION, DISPLAY, DISTANCE, DIVIDE, DOCUMENT, DOMINATES, DOT, DURATION, E, EDIF, EDIFLEVEL, EDIFVERSION, ENCLOSUREDISTANCE, ENDTYPE, ENERGY, ENTRY, EOF, EQUAL, EVENT, EXACTLY, EXTEND, EXTERNAL, FABRICATE, FALSE, FIGURE, FIGUREAREA, FIGUREGROUP, FIGUREGROUPOBJECT, FIGUREGROUPOVERRIDE, FIGUREGROUPREF, FIGUREPERIMETER, FIGUREWIDTH, FILLPATTERN, FIX, FLOOR, FLUX, FOLLOW, FORBIDDENEVENT, FREQUENCY, GENERIC, GLOBALPORTREF, GRAPHIC, GREATERTHAN, GRIDMAP, IDENTIFIER, IGNORE, INCLUDEFIGUREGROUP, INCREASING, INDUCTANCE, INITIAL, INOUT, INPUT, INSTANCE, INSTANCEBACKANNOTATE, INSTANCEGROUP, INSTANCEMAP, INSTANCEREF, INTEGER, INTEGER_TOK, INTEGERDISPLAY, INTERFACE, INTERFIGUREGROUPSPACING, INTERSECTION, INTRAFIGUREGROUPSPACING, INVERSE, ISOLATED, JOINED, JUSTIFY, KEYWORDDISPLAY, KEYWORDLEVEL, KEYWORDMAP, LBR, LESSTHAN, LETTER, LIBRARY, LIBRARYREF, LISTOFNETS, LISTOFPORTS, LOADDELAY, LOGICASSIGN, LOGICINPUT, LOGICLIST, LOGICMAPINPUT, LOGICMAPOUTPUT, LOGICMODEL, LOGICONEOF, LOGICOUTPUT, LOGICPORT, LOGICREF, LOGICVALUE, LOGICWAVEFORM, LOWERCENTER, LOWERLEFT, LOWERRIGHT, MAINTAIN, MASKLAYOUT, MASS, MATCH, MAX, MEASURED, MEMBER, MIN, MINOMAX, MINOMAXDISPLAY, MNM, MOD, MULTIPLEVALUESET, MUSTJOIN, MX, MXR90, MY, MYR90, NAME, NEGATE, NET, NETBACKANNOTATE, NETBUNDLE, NETDELAY, NETGROUP, NETLIST, NETMAP, NETREF, NOCHANGE, NONPERMUTABLE, NOT, NOTALLOWED, NOTCHSPACING, NUMBER, NUMBERDEFINITION, NUMBERDISPLAY, OFFPAGECONNECTOR, OFFSETEVENT, OPENSHAPE, OR, ORIENTATION, ORIGIN, OUTPUT, OVERHANGDISTANCE, OVERLAPDISTANCE, OVERSIZE, OWNER, PAGE, PAGESIZE, PARAMETER, PARAMETERASSIGN, PARAMETERDISPLAY, PATH, PATHDELAY, PATHWIDTH, PCBLAYOUT, PERMUTABLE, PHYSICALDESIGNRULE, PLUG, POINT, POINTDISPLAY, POINTLIST, POINTSUBTRACT, POINTSUM, POLYGON, PORT, PORTBACKANNOTATE, PORTBUNDLE, PORTDELAY, PORTGROUP, PORTIMPLEMENTATION, PORTINSTANCE, PORTLIST, PORTLISTALIAS, PORTMAP, PORTREF, POWER, PRODUCT, PROGRAM, PROPERTY, PROPERTYDISPLAY, PROTECTIONFRAME, PT, R0, R180, R270, R90, RANGEVECTOR, RBR, RECTANGLE, RECTANGLESIZE, RENAME, REQUIRED, RESISTANCE, RESOLVES, RIPPER, ROUND, SCALE, SCALEX, SCALEY, SCHEMATIC, SECTION, SHAPE, SIMULATE, SIMULATIONINFO, SINGLEVALUESET, SITE, SOCKET, SOCKETSET, STATUS, STEADY, STRANGER, STRICTLYINCREASING, STRING, STRING_TOK, STRINGDISPLAY, STRONG, SUBTRACT, SUM, SYMBOL, SYMBOLIC, SYMMETRY, TABLE, TABLEDEFAULT, TECHNOLOGY, TEMPERATURE, TEXTHEIGHT, TIE, TIME, TIMEINTERVAL, TIMESTAMP, TIMING, tokenImage, TRANSFORM, TRANSITION, TRIGGER, TRUE, TRUNCATE, UNCONSTRAINED, UNDEFINED, UNION, UNIT, UNUSED, UPPERCENTER, UPPERLEFT, UPPERRIGHT, USERDATA, VARIABLE, VERSION, VIEW, VIEWLIST, VIEWMAP, VIEWREF, VIEWTYPE, VISIBLE, VOLTAGE, VOLTAGEMAP, WAVEVALUE, WEAK, WEAKJOINED, WHEN, WRITTEN, XCOORD, XOR, YCOORD
 
Constructor Summary
EdifMergeParser()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static EdifEnvironment merge(EdifEnvironment topFile, java.util.Collection dirs, java.util.Collection subFiles, EdifLibrary prims)
          This function will take the passed-in EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found subFile, and merge it with the topFile.
static EdifEnvironment merge(EdifEnvironment topFile, EdifLibrary prims)
          This function will take the passed-in EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found subFile, and merge it with the topFile.
static java.util.Collection parseDirectories(java.lang.String[] args)
          Parses all directories out of the argument list, and returns them as a Collection of Strings.
static EdifMergeParser.SubFiles parseFiles(java.lang.String[] args)
          Parses all sub files out of the argument list, and returns them as a Collection of Strings.
static EdifEnvironment translate(java.lang.String filename, java.util.Collection dirs, java.util.Collection files)
          This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.
static EdifEnvironment translate(java.lang.String filename, java.util.Collection dirs, java.util.Collection files, EdifLibrary prims)
          This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.
static EdifEnvironment translate(java.lang.String filename, EdifLibrary prims)
          This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.
 
Methods inherited from class byucc.edif.javacc.EdifParser
translate, translate, translate
 
Methods inherited from class byucc.edif.javacc.EdifParserCore
abs, acLoad, after, and, annotate, apply, arc, array, arrayMacro, arrayRelatedInfo, arraySite, atLeast, atMost, author, baseArray, becomes, between, booleanDisplay, booleanMap, booleanValue, borderPattern, borderWidth, boundingBox, ceiling, cell, cellNameDef, cellNameRef, cellRef, cellType, change, circle, color, comment, commentGraphics, compound, concat, connectLocation, constant, constraint, contents, cornerType, criticality, currentMap, curve, cycle, dataOrigin, dcFaninLoad, dcFanoutLoad, dcMaxFanin, dcMaxFanout, delay, delta, derivation, design, designator, designNameDef, difference, direction, disable_tracing, display, divide, dominates, dot, duration, e, edif, edifFileName, edifLevel, edifVersion, enable_tracing, enclosureDistance, endType, entry, equal, event, exactly, external, fabricate, figure, figureArea, figureGroup, figureGroupNameDef, figureGroupNameRef, figureGroupObject, figureGroupOverride, figureGroupRef, figureOp, figurePerimeter, figureWidth, fillPattern, fix, floor, follow, forbiddenEvent, form, generateParseException, getEdifEnvironment, getName, getNextToken, getToken, globalPortRef, greaterThan, gridMap, ident, ignore, includeFigureGroup, increasing, initial, instance, instanceBackAnnotate, instanceGroup, instanceMap, instanceNameDef, instanceNameRef, instanceRef, integer, integerDisplay, integerValue, interFigureGroupSpacing, intersection, intraFigureGroupSpacing, inverse, isolated, joined, justify, keywordDisplay, keywordLevel, keywordMap, keywordNameRef, layerNameDef, lessThan, library, libraryNameDef, libraryNameRef, libraryRef, listOfNets, listOfPorts, loadDelay, logicAssign, logicInput, logicList, logicMapInput, logicMapOutput, logicNameDef, logicNameRef, logicOneOf, logicOutput, logicPort, logicRef, logicValue, logicWaveform, maintain, match, max, member, min, miNoMax, miNoMaxDisplay, miNoMaxValue, mnm, mod, multipleValueSet, mustJoin, myBoolean, myFalse, myInterface, myTrue, name, nameDef, nameRef, negate, net, netBackAnnotate, netBundle, netDelay, netGroup, netMap, netNameDef, netNameRef, netRef, noChange, nonPermutable, not, notAllowed, notchSpacing, number, numberDefinition, numberDisplay, numberValue, offPageConnector, offsetEvent, openShape, or, orientation, origin, overhangDistance, overlapDistance, oversize, owner, page, pageSize, parameter, parameterAssign, parameterDisplay, path, pathDelay, pathWidth, permutable, physicalDesignRule, plug, point, pointDisplay, pointList, pointSubtract, pointSum, pointValue, polygon, port, portBackAnnotate, portBundle, portDelay, portGroup, portImplementation, portInstance, portList, portListAlias, portMap, portNameDef, portNameRef, portRef, product, program, property, propertyDisplay, propertyNameDef, propertyNameRef, protectionFrame, pt, range, rangeVector, rectangle, rectangleSize, ReInit, ReInit, ReInit, rename, resolves, ruleNameDef, scale, scaledInteger, scaleX, scaleY, section, shape, simulate, simulateNameDef, simulationInfo, singleValueSet, site, socket, socketSet, status, steady, strictlyIncreasing, string, stringDisplay, stringValue, strong, subtract, sum, symbol, symmetry, table, tableDefault, technology, textHeight, timeInterval, timeStamp, timing, transform, transition, trigger, typedValue, unconstrained, undefined, union, unit, unused, userData, valueNameDef, valueNameRef, variable, version, view, viewList, viewMap, viewNameDef, viewNameRef, viewRef, viewType, visible, voltageMap, waveValue, weak, weakJoined, when, written, xCoord, xor, yCoord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_ARGS

public static final int MIN_ARGS
The value of the minimum # of args for this class.

See Also:
Constant Field Values

usageString

public static final java.lang.String usageString
The value of the string printed out when there is a problem with the argument string.

See Also:
Constant Field Values

EDIF_EXTENSIONS

public static final java.lang.String[] EDIF_EXTENSIONS
The types of acceptable extensions for EDIF files.

Constructor Detail

EdifMergeParser

public EdifMergeParser()
Method Detail

merge

public static EdifEnvironment merge(EdifEnvironment topFile,
                                    EdifLibrary prims)
                             throws ParseException,
                                    java.io.FileNotFoundException
This function will take the passed-in EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found subFile, and merge it with the topFile.

Parameters:
topFile - Any found sub files will be merged into this EdifEnvironment.
prims - An EdifLibrary of primitives
Returns:
The resulting EdifEnvironment
Throws:
ParseException
java.io.FileNotFoundException
See Also:
merge(EdifEnvironment,Collection,Collection, EdifLibrary)

merge

public static EdifEnvironment merge(EdifEnvironment topFile,
                                    java.util.Collection dirs,
                                    java.util.Collection subFiles,
                                    EdifLibrary prims)
                             throws ParseException,
                                    java.io.FileNotFoundException
This function will take the passed-in EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found subFile, and merge it with the topFile.

Parameters:
topFile - Any found sub files will be merged into this EdifEnvironment
dirs - This is a String collection of directories that the function will search through for any black box files
subFiles - A Collectin of String Objects representing the names of sub files to parse in
prims - An EdifLibrary of primitives
Returns:
The resulting EdifEnvironment
Throws:
ParseException
java.io.FileNotFoundException
See Also:
merge(EdifEnvironment,EdifLibrary)

translate

public static EdifEnvironment translate(java.lang.String filename,
                                        EdifLibrary prims)
                                 throws ParseException,
                                        java.io.FileNotFoundException
This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.

Parameters:
filename - The filename of the EDIF file to translate
prims - The library of prims to compare to the EDIF data structure so that any primitives can be marked as primitives
Returns:
The resulting EdifEnvironment
Throws:
ParseException
java.io.FileNotFoundException
See Also:
merge(EdifEnvironment,EdifLibrary)

translate

public static EdifEnvironment translate(java.lang.String filename,
                                        java.util.Collection dirs,
                                        java.util.Collection files,
                                        EdifLibrary prims)
                                 throws ParseException,
                                        java.io.FileNotFoundException
This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.

Parameters:
filename - Any found sub files will be merged into this EdifEnvironment
dirs - This is a String collection of directories that the function will search through for any black box files
files - Collection of files to merge into the main environment
prims - The library of prims to compare to the EDIF data structure so that any primitives can be marked as primitives
Returns:
The resulting EdifEnvironment
Throws:
ParseException
java.io.FileNotFoundException
See Also:
merge(EdifEnvironment,EdifLibrary)

translate

public static EdifEnvironment translate(java.lang.String filename,
                                        java.util.Collection dirs,
                                        java.util.Collection files)
                                 throws ParseException,
                                        java.io.FileNotFoundException
This function will take the passed-in filename, parse it into an EdifEnvironment, collect all its black boxes, search for corresponding sub files in all given directories, translate any found sub file, and merge it with topFile.

Parameters:
filename - Any found sub files will be merged into this EdifEnvironment
dirs - This is a String collection of directories that the function will search through for any black box files
files - Collection of files to merge into the main environment
Returns:
The resulting EdifEnvironment
Throws:
ParseException
java.io.FileNotFoundException
See Also:
merge(EdifEnvironment,EdifLibrary)

parseDirectories

public static java.util.Collection parseDirectories(java.lang.String[] args)
Parses all directories out of the argument list, and returns them as a Collection of Strings.

Parameters:
args - The argument list
Returns:
list of directories as a Collection of String Objects

parseFiles

public static EdifMergeParser.SubFiles parseFiles(java.lang.String[] args)
Parses all sub files out of the argument list, and returns them as a Collection of Strings.

Parameters:
args - The argument list
Returns:
list of subFiles as a Collection of String Objects

main

public static void main(java.lang.String[] args)