roger@mips.UUCP (Roger March) (12/14/87)
This is an YACC(really BISON)-able parser for EDIF 2.0.0, level 0. It will be interesting mostly to CAD critters so is probably appropriate for posting on 'comp.sources.misc'. If you would do so it would be greatly appreciated. Thanks. -- -your friendly neighborhood Rogue Monster roger@mips.com UUCP: {decvax,ucbvax,ihnp4,hplabs,sun,ames,prls}!decwrl!mips!roger USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086, (408) 991-0220 #--------------------------Cut Here-------------------------- #! /bin/sh # This is a shell archive. Remove anything before the "#! /bin/sh" line, # then unpack it by saving it in a file and typing "sh file." # # Wrapped by Roger March,,,,obiwan,open (roger) at obiwan on Thu Dec 10 17:29:39 1987 # # unpacks with default permissions # # Contents : README makefile main.c edif.y.1 # if `test ! -s README` then echo "x - README" cat > README << '@\Rogue\Monster\' This is an EDIF 2.0.0 parser, well more like a recognizer. If you build the test case and run it with a valid EDIF file on the standard input the program will just terminate normally. Sounds real useful, huh. The nifty part is that the core of the parser is YACC-able, almost. The problem is that the EDIF grammer is so large that standard YACC just can't swallow it. So you need to either super charge your YACC or use a YACC clone like BISON. I used BISON, which is GNU-ware and so is freely available besides being a terrific program. I think BISON is available from the Free Software Foundation or on systems near you; even I am happy to pass it on to whoever wants it. Enough BISON praise. The reason I made the parser YACC-able is because past experience indicates this one of the easiest forms to add actions too, as well as put in updates or fixes. EDIF is hardly context free though, and so I had to fold all sorts of ugliness into the lexical analyzer to keep the YACC part clean. This version is raw, it doesn't build symbol tables, do semantic checking or create a database. The parser itself won't even run though a wrapper has been included for testing. I wanted to get out one version before I started adding such junk to it. Again experience indicates that it is no fun lobotimizing parsers so that you can do the low level stuff your way. Besides somebody might even find a bug in the code ... naw, that's a silly justification. The 'makefile' I've included is not the one I use (and probably will get me in lots of trouble). I invoke gobs of debugging and profiling switches which are specific to our compilers, the 'makefile' is intended to be generic and may require some diddling. I developed the code on a BSD 4.3 system and haven't added the changes for SYS V, though they should be minor. The parser was too large to post in one piece, so it got split and the 'makefile' should know how to patch it together. There is one definition of possible interest. Compiling with a '-DDEBUG' will cause the 8 most recently consumed tokens to be displayed in the event of a parse error. Profiling indicates a pretty costly item though. Three test cases are included: hptest - by Fabio Angelillis of Hewlett-Packard batest.1 batest.2 - by Bill Ames of Silicon Compilers Many thanks to them and the files are provide as is, no warrenty implied and brush after every meal ... I find the parser code to be easily immediately obvious and so no documentation is included in the release. Humm ... don't buy that. Actually documentation is in the works but it would delay this posting too long if I waited for it to be completed. If you find the parser totally incomprehensible, E-mail me a request and I'll send you whatever I have written by the time I get your mail. Lastly, as far as I'm concerned this parser is now in the public domain and you can do anything you want with it. My next task is to make it build a database and when that's through I'll probably post it again ... you have been warned! Enjoy, and I'd be happy to get bug reports or stories of how many ways you found to delete the source ... -- -your friendly neighborhood Rogue Monster roger@mips.com UUCP: {decvax,ucbvax,ihnp4,hplabs,sun,ames,prls}!decwrl!mips!roger USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086, (408) 991-0220 @\Rogue\Monster\ else echo "shar: Will not over write README" fi if `test ! -s makefile` then echo "x - makefile" cat > makefile << '@\Rogue\Monster\' # # Makefile for EDIF parser. # #CFLAGS = -DDEBUG CFLAGS = -O SOURCES = edif.y edif : edif.o main.o cc $(CFLAGS) edif.o main.o -o edif main.o : main.c edif.o : edif.c edif.c : edif.y bison edif.y mv edif.tab.c edif.c edif.y : edif.y.1 edif.y.2 cat edif.y.1 edif.y.2 > edif.y @\Rogue\Monster\ else echo "shar: Will not over write makefile" fi if `test ! -s main.c` then echo "x - main.c" cat > main.c << '@\Rogue\Monster\' #include <stdio.h> char *InFile = "-"; main(argc,argv) int argc; char *argv[]; { ParseEDIF(stdin,stderr); } @\Rogue\Monster\ else echo "shar: Will not over write main.c" fi if `test ! -s edif.y.1` then echo "x - edif.y.1" cat > edif.y.1 << '@\Rogue\Monster\' %{ /* * $Header: edif.y,v 1.18 87/12/07 19:59:49 roger Locked $ */ /************************************************************************ * * * edif.y * * * * EDIF 2.0.0 parser, Level 0 * * * * You are free to copy, distribute, use it, abuse it, make it * * write bad tracks all over the disk ... or anything else. * * * * Your friendly neighborhood Rogue Monster - roger@mips.com * * * ************************************************************************/ #include <stdio.h> #include <ctype.h> /* * Local definitions. */ #define IDENT_LENGTH 255 #define Malloc(s) malloc(s) #define Free(p) free(p) #define ABS(v) ((v) < 0 ? -(v) : (v)) #define Getc(s) getc(s) #define Ungetc(c) ungetc(c,Input); /* * External functions. */ extern char *malloc(),*strcpy(); extern int atoi(); extern free(); %} %union { char *s; } %token <s> IDENT %token <s> INT %token <s> KEYWORD %token <s> STR %token ANGLE %token BEHAVIOR %token CALCULATED %token CAPACITANCE %token CENTERCENTER %token CENTERLEFT %token CENTERRIGHT %token CHARGE %token CONDUCTANCE %token CURRENT %token DISTANCE %token DOCUMENT %token ENERGY %token EXTEND %token FLUX %token FREQUENCY %token GENERIC %token GRAPHIC %token INDUCTANCE %token INOUT %token INPUT %token LOGICMODEL %token LOWERCENTER %token LOWERLEFT %token LOWERRIGHT %token MASKLAYOUT %token MASS %token MEASURED %token MX %token MXR90 %token MY %token MYR90 %token NETLIST %token OUTPUT %token PCBLAYOUT %token POWER %token R0 %token R180 %token R270 %token R90 %token REQUIRED %token RESISTANCE %token RIPPER %token ROUND %token SCHEMATIC %token STRANGER %token SYMBOLIC %token TEMPERATURE %token TIE %token TIME %token TRUNCATE %token UPPERCENTER %token UPPERLEFT %token UPPERRIGHT %token VOLTAGE %token ACLOAD %token AFTER %token ANNOTATE %token APPLY %token ARC %token ARRAY %token ARRAYMACRO %token ARRAYRELATEDINFO %token ARRAYSITE %token ATLEAST %token ATMOST %token AUTHOR %token BASEARRAY %token BECOMES %token BETWEEN %token BOOLEAN %token BOOLEANDISPLAY %token BOOLEANMAP %token BORDERPATTERN %token BORDERWIDTH %token BOUNDINGBOX %token CELL %token CELLREF %token CELLTYPE %token CHANGE %token CIRCLE %token COLOR %token COMMENT %token COMMENTGRAPHICS %token COMPOUND %token CONNECTLOCATION %token CONTENTS %token CORNERTYPE %token CRITICALITY %token CURRENTMAP %token CURVE %token CYCLE %token DATAORIGIN %token DCFANINLOAD %token DCFANOUTLOAD %token DCMAXFANIN %token DCMAXFANOUT %token DELAY %token DELTA %token DERIVATION %token DESIGN %token DESIGNATOR %token DIFFERENCE %token DIRECTION %token DISPLAY %token DOMINATES %token DOT %token DURATION %token E %token EDIF %token EDIFLEVEL %token EDIFVERSION %token ENCLOSUREDISTANCE %token ENDTYPE %token ENTRY %token EVENT %token EXACTLY %token EXTERNAL %token FABRICATE %token FALSE %token FIGURE %token FIGUREAREA %token FIGUREGROUP %token FIGUREGROUPOBJECT %token FIGUREGROUPOVERRIDE %token FIGUREGROUPREF %token FIGUREPERIMETER %token FIGUREWIDTH %token FILLPATTERN %token FOLLOW %token FORBIDDENEVENT %token GLOBALPORTREF %token GREATERTHAN %token GRIDMAP %token IGNORE %token INCLUDEFIGUREGROUP %token INITIAL %token INSTANCE %token INSTANCEBACKANNOTATE %token INSTANCEGROUP %token INSTANCEMAP %token INSTANCEREF %token INTEGER %token INTEGERDISPLAY %token INTERFACE %token INTERFIGUREGROUPSPACING %token INTERSECTION %token INTRAFIGUREGROUPSPACING %token INVERSE %token ISOLATED %token JOINED %token JUSTIFY %token KEYWORDDISPLAY %token KEYWORDLEVEL %token KEYWORDMAP %token LESSTHAN %token LIBRARY %token LIBRARYREF %token LISTOFNETS %token LISTOFPORTS %token LOADDELAY %token LOGICASSIGN %token LOGICINPUT %token LOGICLIST %token LOGICMAPINPUT %token LOGICMAPOUTPUT %token LOGICONEOF %token LOGICOUTPUT %token LOGICPORT %token LOGICREF %token LOGICVALUE %token LOGICWAVEFORM %token MAINTAIN %token MATCH %token MEMBER %token MINOMAX %token MINOMAXDISPLAY %token MNM %token MULTIPLEVALUESET %token MUSTJOIN %token NAME %token NET %token NETBACKANNOTATE %token NETBUNDLE %token NETDELAY %token NETGROUP %token NETMAP %token NETREF %token NOCHANGE %token NONPERMUTABLE %token NOTALLOWED %token NOTCHSPACING %token NUMBER %token NUMBERDEFINITION %token NUMBERDISPLAY %token OFFPAGECONNECTOR %token OFFSETEVENT %token OPENSHAPE %token ORIENTATION %token ORIGIN %token OVERHANGDISTANCE %token OVERLAPDISTANCE %token OVERSIZE %token OWNER %token PAGE %token PAGESIZE %token PARAMETER %token PARAMETERASSIGN %token PARAMETERDISPLAY %token PATH %token PATHDELAY %token PATHWIDTH %token PERMUTABLE %token PHYSICALDESIGNRULE %token PLUG %token POINT %token POINTDISPLAY %token POINTLIST %token POLYGON %token PORT %token PORTBACKANNOTATE %token PORTBUNDLE %token PORTDELAY %token PORTGROUP %token PORTIMPLEMENTATION %token PORTINSTANCE %token PORTLIST %token PORTLISTALIAS %token PORTMAP %token PORTREF %token PROGRAM %token PROPERTY %token PROPERTYDISPLAY %token PROTECTIONFRAME %token PT %token RANGEVECTOR %token RECTANGLE %token RECTANGLESIZE %token RENAME %token RESOLVES %token SCALE %token SCALEX %token SCALEY %token SECTION %token SHAPE %token SIMULATE %token SIMULATIONINFO %token SINGLEVALUESET %token SITE %token SOCKET %token SOCKETSET %token STATUS %token STEADY %token STRING %token STRINGDISPLAY %token STRONG %token SYMBOL %token SYMMETRY %token TABLE %token TABLEDEFAULT %token TECHNOLOGY %token TEXTHEIGHT %token TIMEINTERVAL %token TIMESTAMP %token TIMING %token TRANSFORM %token TRANSITION %token TRIGGER %token TRUE %token UNCONSTRAINED %token UNDEFINED %token UNION %token UNIT %token UNUSED %token USERDATA %token VERSION %token VIEW %token VIEWLIST %token VIEWMAP %token VIEWREF %token VIEWTYPE %token VISIBLE %token VOLTAGEMAP %token WAVEVALUE %token WEAK %token WEAKJOINED %token WHEN %token WRITTEN %start Edif %% PopC : ')' { PopC(); } ; Edif : EDIF EdifFileName EdifVersion EdifLevel KeywordMap _Edif PopC ; _Edif : | _Edif Status | _Edif External | _Edif Library | _Edif Design | _Edif Comment | _Edif UserData ; EdifFileName : NameDef ; EdifLevel : EDIFLEVEL Int PopC ; EdifVersion : EDIFVERSION Int Int Int PopC ; AcLoad : ACLOAD _AcLoad PopC ; _AcLoad : MiNoMaValue | MiNoMaDisp ; After : AFTER _After PopC ; _After : MiNoMaValue | _After Follow | _After Maintain | _After LogicAssn | _After Comment | _After UserData ; Annotate : ANNOTATE _Annotate PopC ; _Annotate : Str | StrDisplay ; Apply : APPLY _Apply PopC ; _Apply : Cycle | _Apply LogicIn | _Apply LogicOut | _Apply Comment | _Apply UserData ; Arc : ARC PointValue PointValue PointValue PopC ; Array : ARRAY NameDef Int _Array PopC ; _Array : | Int ; ArrayMacro : ARRAYMACRO Plug PopC ; ArrayRelInfo : ARRAYRELATEDINFO _ArrayRelInfo PopC ; _ArrayRelInfo : BaseArray | ArraySite | ArrayMacro | _ArrayRelInfo Comment | _ArrayRelInfo UserData ; ArraySite : ARRAYSITE Socket PopC ; AtLeast : ATLEAST ScaledInt PopC ; AtMost : ATMOST ScaledInt PopC ; Author : AUTHOR Str PopC ; BaseArray : BASEARRAY PopC ; Becomes : BECOMES _Becomes PopC ; _Becomes : LogicNameRef | LogicList | LogicOneOf ; Between : BETWEEN __Between _Between PopC ; __Between : AtLeast | GreaterThan ; _Between : AtMost | LessThan ; Boolean : BOOLEAN _Boolean PopC ; _Boolean : | _Boolean BooleanValue | _Boolean BooleanDisp | _Boolean Boolean ; BooleanDisp : BOOLEANDISPLAY _BooleanDisp PopC ; _BooleanDisp : BooleanValue | _BooleanDisp Display ; BooleanMap : BOOLEANMAP BooleanValue PopC ; BooleanValue : True | False ; BorderPat : BORDERPATTERN Int Int Boolean PopC ; BorderWidth : BORDERWIDTH Int PopC ; BoundBox : BOUNDINGBOX Rectangle PopC ; Cell : CELL CellNameDef _Cell PopC ; _Cell : CellType | _Cell Status | _Cell ViewMap | _Cell View | _Cell Comment | _Cell UserData | _Cell Property ; CellNameDef : NameDef ; CellRef : CELLREF CellNameRef _CellRef PopC ; _CellRef : | LibraryRef ; CellNameRef : NameRef ; CellType : CELLTYPE _CellType PopC ; _CellType : TIE | RIPPER | GENERIC ; Change : CHANGE __Change _Change PopC ; __Change : PortNameRef | PortRef | PortList ; _Change : | Becomes | Transition ; Circle : CIRCLE PointValue PointValue _Circle PopC ; _Circle : | _Circle Property ; Color : COLOR ScaledInt ScaledInt ScaledInt PopC ; Comment : COMMENT _Comment PopC ; _Comment : | _Comment Str ; CommGraph : COMMENTGRAPHICS _CommGraph PopC ; _CommGraph : | _CommGraph Annotate | _CommGraph Figure | _CommGraph Instance | _CommGraph BoundBox | _CommGraph Property | _CommGraph Comment | _CommGraph UserData ; Compound : COMPOUND LogicNameRef PopC ; Contents : CONTENTS _Contents PopC ; _Contents : | _Contents Instance | _Contents OffPageConn | _Contents Figure | _Contents Section | _Contents Net | _Contents NetBundle | _Contents Page | _Contents CommGraph | _Contents PortImpl | _Contents Timing | _Contents Simulate | _Contents When | _Contents Follow | _Contents LogicPort | _Contents BoundBox | _Contents Comment | _Contents UserData ; ConnectLoc : CONNECTLOCATION _ConnectLoc PopC ; _ConnectLoc : | Figure ; CornerType : CORNERTYPE _CornerType PopC ; _CornerType : EXTEND | ROUND | TRUNCATE ; Criticality : CRITICALITY _Criticality PopC ; _Criticality : Int | IntDisplay ; CurrentMap : CURRENTMAP MiNoMaValue PopC ; Curve : CURVE _Curve PopC ; _Curve : | _Curve Arc | _Curve PointValue ; Cycle : CYCLE Int _Cycle PopC ; _Cycle : | Duration ; DataOrigin : DATAORIGIN Str _DataOrigin PopC ; _DataOrigin : | Version ; DcFanInLoad : DCFANINLOAD _DcFanInLoad PopC ; _DcFanInLoad : ScaledInt | NumbDisplay ; DcFanOutLoad : DCFANOUTLOAD _DcFanOutLoad PopC ; _DcFanOutLoad : ScaledInt | NumbDisplay ; DcMaxFanIn : DCMAXFANIN _DcMaxFanIn PopC ; _DcMaxFanIn : ScaledInt | NumbDisplay ; DcMaxFanOut : DCMAXFANOUT _DcMaxFanOut PopC ; _DcMaxFanOut : ScaledInt | NumbDisplay ; Delay : DELAY _Delay PopC ; _Delay : MiNoMaValue | MiNoMaDisp ; Delta : DELTA _Delta PopC ; _Delta : | _Delta PointValue ; Derivation : DERIVATION _Derivation PopC ; _Derivation : CALCULATED | MEASURED | REQUIRED ; Design : DESIGN DesignNameDef _Design PopC ; _Design : CellRef | _Design Status | _Design Comment | _Design Property | _Design UserData ; Designator : DESIGNATOR _Designator PopC ; _Designator : Str | StrDisplay ; DesignNameDef : NameDef ; DesignRule : PHYSICALDESIGNRULE _DesignRule PopC ; _DesignRule : | _DesignRule FigureWidth | _DesignRule FigureArea | _DesignRule RectSize | _DesignRule FigurePerim | _DesignRule OverlapDist | _DesignRule OverhngDist | _DesignRule EncloseDist | _DesignRule InterFigGrp | _DesignRule IntraFigGrp | _DesignRule NotchSpace | _DesignRule NotAllowed | _DesignRule FigGrp | _DesignRule Comment | _DesignRule UserData ; Difference : DIFFERENCE _Difference PopC ; _Difference : FigGrpRef | FigureOp | _Difference FigGrpRef | _Difference FigureOp ; Direction : DIRECTION _Direction PopC ; _Direction : INOUT | INPUT | OUTPUT ; Display : DISPLAY _Display _DisplayJust _DisplayOrien _DisplayOrg PopC ; _Display : FigGrpNameRef | FigGrpOver ; _DisplayJust : | Justify ; _DisplayOrien : | Orientation ; _DisplayOrg : | Origin ; Dominates : DOMINATES _Dominates PopC ; _Dominates : | _Dominates LogicNameRef ; Dot : DOT _Dot PopC ; _Dot : PointValue | _Dot Property ; Duration : DURATION ScaledInt PopC ; EncloseDist : ENCLOSUREDISTANCE RuleNameDef FigGrpObj FigGrpObj _EncloseDist PopC ; _EncloseDist : Range | SingleValSet | _EncloseDist Comment | _EncloseDist UserData ; EndType : ENDTYPE _EndType PopC ; _EndType : EXTEND | ROUND | TRUNCATE ; Entry : ENTRY ___Entry __Entry _Entry PopC ; ___Entry : Match | Change | Steady ; __Entry : LogicRef | PortRef | NoChange | Table ; _Entry : | Delay | LoadDelay ; Event : EVENT _Event PopC ; _Event : PortRef | PortList | PortGroup | NetRef | NetGroup | _Event Transition | _Event Becomes ; Exactly : EXACTLY ScaledInt PopC ; External : EXTERNAL LibNameDef EdifLevel _External PopC ; _External : Technology | _External Status | _External Cell | _External Comment | _External UserData ; Fabricate : FABRICATE LayerNameDef FigGrpNameRef PopC ; False : FALSE PopC ; FigGrp : FIGUREGROUP _FigGrp PopC ; _FigGrp : FigGrpNameDef | _FigGrp CornerType | _FigGrp EndType | _FigGrp PathWidth | _FigGrp BorderWidth | _FigGrp Color | _FigGrp FillPattern | _FigGrp BorderPat | _FigGrp TextHeight | _FigGrp Visible | _FigGrp Comment | _FigGrp Property | _FigGrp UserData | _FigGrp IncFigGrp ; FigGrpNameDef : NameDef ; FigGrpNameRef : NameRef ; FigGrpObj : FIGUREGROUPOBJECT _FigGrpObj PopC ; _FigGrpObj : FigGrpNameRef | FigGrpRef | FigureOp ; FigGrpOver : FIGUREGROUPOVERRIDE _FigGrpOver PopC ; _FigGrpOver : FigGrpNameRef | _FigGrpOver CornerType | _FigGrpOver EndType | _FigGrpOver PathWidth | _FigGrpOver BorderWidth | _FigGrpOver Color | _FigGrpOver FillPattern | _FigGrpOver BorderPat | _FigGrpOver TextHeight | _FigGrpOver Visible | _FigGrpOver Comment | _FigGrpOver Property | _FigGrpOver UserData ; FigGrpRef : FIGUREGROUPREF FigGrpNameRef _FigGrpRef PopC ; _FigGrpRef : | LibraryRef ; Figure : FIGURE _Figure PopC ; _Figure : FigGrpNameDef | FigGrpOver | _Figure Circle | _Figure Dot | _Figure OpenShape | _Figure Path | _Figure Polygon | _Figure Rectangle | _Figure Shape | _Figure Comment | _Figure UserData ; FigureArea : FIGUREAREA RuleNameDef FigGrpObj _FigureArea PopC ; _FigureArea : Range | SingleValSet | _FigureArea Comment | _FigureArea UserData ; FigureOp : Intersection | Union | Difference | Inverse | Oversize ; FigurePerim : FIGUREPERIMETER RuleNameDef FigGrpObj _FigurePerim PopC ; _FigurePerim : Range | SingleValSet | _FigurePerim Comment | _FigurePerim UserData ; FigureWidth : FIGUREWIDTH RuleNameDef FigGrpObj _FigureWidth PopC ; _FigureWidth : Range | SingleValSet | _FigureWidth Comment | _FigureWidth UserData ; FillPattern : FILLPATTERN Int Int Boolean PopC ; Follow : FOLLOW __Follow _Follow PopC ; __Follow : PortNameRef | PortRef ; _Follow : PortRef | Table | _Follow Delay | _Follow LoadDelay ; Forbidden : FORBIDDENEVENT _Forbidden PopC ; _Forbidden : TimeIntval | _Forbidden Event ; Form : Keyword _Form ')' ; _Form : | _Form Int | _Form Str | _Form Ident | _Form Form ; GlobPortRef : GLOBALPORTREF PortNameRef PopC ; GreaterThan : GREATERTHAN ScaledInt PopC ; GridMap : GRIDMAP ScaledInt ScaledInt PopC ; Ignore : IGNORE PopC ; IncFigGrp : INCLUDEFIGUREGROUP _IncFigGrp PopC ; _IncFigGrp : FigGrpRef | FigureOp ; Initial : INITIAL PopC ; Instance : INSTANCE InstNameDef _Instance PopC ; _Instance : ViewRef | ViewList | _Instance Transform | _Instance ParamAssign | _Instance PortInst | _Instance Timing | _Instance Designator | _Instance Property | _Instance Comment | _Instance UserData ; InstanceRef : INSTANCEREF InstNameRef _InstanceRef PopC ; _InstanceRef : | InstanceRef | ViewRef ; InstBackAn : INSTANCEBACKANNOTATE _InstBackAn PopC ; _InstBackAn : InstanceRef | _InstBackAn Designator | _InstBackAn Timing | _InstBackAn Property | _InstBackAn Comment ; InstGroup : INSTANCEGROUP _InstGroup PopC ; _InstGroup : | _InstGroup InstanceRef ; InstMap : INSTANCEMAP _InstMap PopC ; _InstMap : | _InstMap InstanceRef | _InstMap InstGroup | _InstMap Comment | _InstMap UserData ; InstNameDef : NameDef | Array ; InstNameRef : NameRef | Member ; IntDisplay : INTEGERDISPLAY _IntDisplay PopC ; _IntDisplay : Int | _IntDisplay Display ; Integer : INTEGER _Integer PopC ; _Integer : | _Integer Int | _Integer IntDisplay | _Integer Integer ; Interface : INTERFACE _Interface PopC ; _Interface : | _Interface Port | _Interface PortBundle | _Interface Symbol | _Interface ProtectFrame | _Interface ArrayRelInfo | _Interface Parameter | _Interface Joined | _Interface MustJoin | _Interface WeakJoined | _Interface Permutable | _Interface Timing | _Interface Simulate | _Interface Designator | _Interface Property | _Interface Comment | _Interface UserData ; InterFigGrp : INTERFIGUREGROUPSPACING RuleNameDef FigGrpObj FigGrpObj _InterFigGrp PopC ; _InterFigGrp : Range | SingleValSet | _InterFigGrp Comment | _InterFigGrp UserData ; Intersection : INTERSECTION _Intersection PopC ; _Intersection : FigGrpRef | FigureOp | _Intersection FigGrpRef | _Intersection FigureOp ; IntraFigGrp : INTRAFIGUREGROUPSPACING RuleNameDef FigGrpObj _IntraFigGrp PopC ; _IntraFigGrp : Range | SingleValSet | _IntraFigGrp Comment | _IntraFigGrp UserData ; Inverse : INVERSE _Inverse PopC ; _Inverse : FigGrpRef | FigureOp ; Isolated : ISOLATED PopC ; Joined : JOINED _Joined PopC ; _Joined : | _Joined PortRef | _Joined PortList | _Joined GlobPortRef ; Justify : JUSTIFY _Justify PopC ; _Justify : CENTERCENTER | CENTERLEFT | CENTERRIGHT | LOWERCENTER | LOWERLEFT | LOWERRIGHT | UPPERCENTER | UPPERLEFT | UPPERRIGHT ; KeywordDisp : KEYWORDDISPLAY _KeywordDisp PopC ; _KeywordDisp : KeywordName | _KeywordDisp Display ; KeywordLevel : KEYWORDLEVEL Int PopC ; KeywordMap : KEYWORDMAP _KeywordMap PopC ; _KeywordMap : KeywordLevel | _KeywordMap Comment ; KeywordName : Ident ; LayerNameDef : NameDef ; LessThan : LESSTHAN ScaledInt PopC ; LibNameDef : NameDef ; LibNameRef : NameRef ; Library : LIBRARY LibNameDef EdifLevel _Library PopC ; _Library : Technology | _Library Status | _Library Cell | _Library Comment | _Library UserData ; LibraryRef : LIBRARYREF LibNameRef PopC ; ListOfNets : LISTOFNETS _ListOfNets PopC ; _ListOfNets : | _ListOfNets Net ; ListOfPorts : LISTOFPORTS _ListOfPorts PopC ; _ListOfPorts : | _ListOfPorts Port | _ListOfPorts PortBundle ; LoadDelay : LOADDELAY _LoadDelay _LoadDelay PopC ; _LoadDelay : MiNoMaValue | MiNoMaDisp ; LogicAssn : LOGICASSIGN ___LogicAssn __LogicAssn _LogicAssn PopC ; ___LogicAssn : PortNameRef | PortRef ; __LogicAssn : PortRef | LogicRef | Table ; _LogicAssn : | Delay | LoadDelay ; LogicIn : LOGICINPUT _LogicIn PopC ; _LogicIn : PortList | PortRef | PortNameRef | _LogicIn LogicWave ; LogicList : LOGICLIST _LogicList PopC ; _LogicList : | _LogicList LogicNameRef | _LogicList LogicOneOf | _LogicList Ignore ; LogicMapIn : LOGICMAPINPUT _LogicMapIn PopC ; _LogicMapIn : | _LogicMapIn LogicNameRef ; LogicMapOut : LOGICMAPOUTPUT _LogicMapOut PopC ; _LogicMapOut : | _LogicMapOut LogicNameRef ; LogicNameDef : NameDef ; LogicNameRef : NameRef ; LogicOneOf : LOGICONEOF _LogicOneOf PopC ; _LogicOneOf : | _LogicOneOf LogicNameRef | _LogicOneOf LogicList ; LogicOut : LOGICOUTPUT _LogicOut PopC ; _LogicOut : PortList | PortRef | PortNameRef | _LogicOut LogicWave ; LogicPort : LOGICPORT _LogicPort PopC ; _LogicPort : PortNameDef | _LogicPort Property | _LogicPort Comment | _LogicPort UserData ; LogicRef : LOGICREF LogicNameRef _LogicRef PopC ; _LogicRef : | LibraryRef ; LogicValue : LOGICVALUE _LogicValue PopC ; _LogicValue : LogicNameDef | _LogicValue VoltageMap | _LogicValue CurrentMap | _LogicValue BooleanMap | _LogicValue Compound | _LogicValue Weak | _LogicValue Strong | _LogicValue Dominates | _LogicValue LogicMapOut | _LogicValue LogicMapIn | _LogicValue Isolated | _LogicValue Resolves | _LogicValue Property | _LogicValue Comment | _LogicValue UserData ; LogicWave : LOGICWAVEFORM _LogicWave PopC ; _LogicWave : | _LogicWave LogicNameRef | _LogicWave LogicList | _LogicWave LogicOneOf | _LogicWave Ignore ; Maintain : MAINTAIN __Maintain _Maintain PopC ; __Maintain : PortNameRef | PortRef ; _Maintain : | Delay | LoadDelay ; Match : MATCH __Match _Match PopC ; __Match : PortNameRef | PortRef | PortList ; _Match : LogicNameRef | LogicList | LogicOneOf ; Member : MEMBER NameRef _Member PopC ; _Member : Int | _Member Int ; MiNoMa : MINOMAX _MiNoMa PopC ; _MiNoMa : | _MiNoMa MiNoMaValue | _MiNoMa MiNoMaDisp | _MiNoMa MiNoMa ; MiNoMaDisp : MINOMAXDISPLAY _MiNoMaDisp PopC ; _MiNoMaDisp : MiNoMaValue | _MiNoMaDisp Display ; MiNoMaValue : Mnm | ScaledInt ; Mnm : MNM _Mnm _Mnm _Mnm PopC ; _Mnm : ScaledInt | Undefined | Unconstrained ; MultValSet : MULTIPLEVALUESET _MultValSet PopC ; _MultValSet : | _MultValSet RangeVector ; MustJoin : MUSTJOIN _MustJoin PopC ; _MustJoin : | _MustJoin PortRef | _MustJoin PortList | _MustJoin WeakJoined | _MustJoin Joined ; Name : NAME _Name PopC ; _Name : Ident | _Name Display ; NameDef : Ident | Name | Rename ; NameRef : Ident | Name ; Net : NET NetNameDef _Net PopC ; _Net : Joined | _Net Criticality | _Net NetDelay | _Net Figure | _Net Net | _Net Instance | _Net CommGraph | _Net Property | _Net Comment | _Net UserData ; NetBackAn : NETBACKANNOTATE _NetBackAn PopC ; _NetBackAn : NetRef | _NetBackAn NetDelay | _NetBackAn Criticality | _NetBackAn Property | _NetBackAn Comment ; NetBundle : NETBUNDLE NetNameDef _NetBundle PopC ; _NetBundle : ListOfNets | _NetBundle Figure | _NetBundle CommGraph | _NetBundle Property | _NetBundle Comment | _NetBundle UserData ; NetDelay : NETDELAY Derivation _NetDelay PopC ; _NetDelay : Delay | _NetDelay Transition | _NetDelay Becomes ; NetGroup : NETGROUP _NetGroup PopC ; _NetGroup : | _NetGroup NetNameRef | _NetGroup NetRef ; NetMap : NETMAP _NetMap PopC ; _NetMap : | _NetMap NetRef | _NetMap NetGroup | _NetMap Comment | _NetMap UserData ; NetNameDef : NameDef | Array ; NetNameRef : NameRef | Member ; NetRef : NETREF NetNameRef _NetRef PopC ; _NetRef : | NetRef | InstanceRef | ViewRef ; NoChange : NOCHANGE PopC ; NonPermut : NONPERMUTABLE _NonPermut PopC ; _NonPermut : | _NonPermut PortRef | _NonPermut Permutable ; NotAllowed : NOTALLOWED RuleNameDef _NotAllowed PopC ; _NotAllowed : FigGrpObj | _NotAllowed Comment | _NotAllowed UserData ; NotchSpace : NOTCHSPACING RuleNameDef FigGrpObj _NotchSpace PopC ; _NotchSpace : Range | SingleValSet | _NotchSpace Comment | _NotchSpace UserData ; Number : NUMBER _Number PopC ; _Number : | _Number ScaledInt | _Number NumbDisplay | _Number Number ; NumbDisplay : NUMBERDISPLAY _NumbDisplay PopC ; _NumbDisplay : ScaledInt | _NumbDisplay Display ; NumberDefn : NUMBERDEFINITION _NumberDefn PopC ; _NumberDefn : | _NumberDefn Scale | _NumberDefn GridMap | _NumberDefn Comment ; OffPageConn : OFFPAGECONNECTOR _OffPageConn PopC ; _OffPageConn : PortNameDef | _OffPageConn Unused | _OffPageConn Property | _OffPageConn Comment | _OffPageConn UserData ; OffsetEvent : OFFSETEVENT Event ScaledInt PopC ; OpenShape : OPENSHAPE _OpenShape PopC ; _OpenShape : Curve | _OpenShape Property ; Orientation : ORIENTATION _Orientation PopC ; _Orientation : R0 | R90 | R180 | R270 | MX | MY | MYR90 | MXR90 ; Origin : ORIGIN PointValue PopC ; OverhngDist : OVERHANGDISTANCE RuleNameDef FigGrpObj FigGrpObj _OverhngDist PopC ; _OverhngDist : Range | SingleValSet | _OverhngDist Comment | _OverhngDist UserData ; OverlapDist : OVERLAPDISTANCE RuleNameDef FigGrpObj FigGrpObj _OverlapDist PopC ; _OverlapDist : Range | SingleValSet | _OverlapDist Comment | _OverlapDist UserData ; Oversize : OVERSIZE Int _Oversize CornerType PopC ; _Oversize : FigGrpRef | FigureOp ; Owner : OWNER Str PopC ; Page : PAGE _Page PopC ; _Page : InstNameDef | _Page Instance | _Page Net | _Page NetBundle | _Page CommGraph | _Page PortImpl | _Page PageSize | _Page BoundBox | _Page Comment | _Page UserData ; PageSize : PAGESIZE Rectangle PopC ; ParamDisp : PARAMETERDISPLAY _ParamDisp PopC ; _ParamDisp : ValueNameRef | _ParamDisp Display ; Parameter : PARAMETER ValueNameDef TypedValue _Parameter PopC ; _Parameter : | Unit ; ParamAssign : PARAMETERASSIGN ValueNameRef TypedValue PopC ; Path : PATH _Path PopC ; _Path : PointList | _Path Property ; PathDelay : PATHDELAY _PathDelay PopC ; _PathDelay : Delay | _PathDelay Event ; PathWidth : PATHWIDTH Int PopC ; Permutable : PERMUTABLE _Permutable PopC ; _Permutable : | _Permutable PortRef | _Permutable Permutable | _Permutable NonPermut ; Plug : PLUG _Plug PopC ; _Plug : | _Plug SocketSet ; Point : POINT _Point PopC ; _Point : | _Point PointValue | _Point PointDisp | _Point Point ; PointDisp : POINTDISPLAY _PointDisp PopC ; _PointDisp : PointValue | _PointDisp Display ; PointList : POINTLIST _PointList PopC ; _PointList : | _PointList PointValue ; PointValue : PT Int Int PopC ; Polygon : POLYGON _Polygon PopC ; _Polygon : PointList | _Polygon Property ; Port : PORT _Port PopC ; _Port : PortNameDef | _Port Direction | _Port Unused | _Port PortDelay | _Port Designator | _Port DcFanInLoad | _Port DcFanOutLoad | _Port DcMaxFanIn | _Port DcMaxFanOut | _Port AcLoad | _Port Property | _Port Comment | _Port UserData ; PortBackAn : PORTBACKANNOTATE _PortBackAn PopC ; _PortBackAn : PortRef | _PortBackAn Designator | _PortBackAn PortDelay | _PortBackAn DcFanInLoad | _PortBackAn DcFanOutLoad | _PortBackAn DcMaxFanIn | _PortBackAn DcMaxFanOut | _PortBackAn AcLoad | _PortBackAn Property | _PortBackAn Comment ; PortBundle : PORTBUNDLE PortNameDef _PortBundle PopC ; _PortBundle : ListOfPorts | _PortBundle Property | _PortBundle Comment | _PortBundle UserData ; PortDelay : PORTDELAY Derivation _PortDelay PopC ; _PortDelay : Delay | LoadDelay | _PortDelay Transition | _PortDelay Becomes ; PortGroup : PORTGROUP _PortGroup PopC ; _PortGroup : | _PortGroup PortNameRef | _PortGroup PortRef ; PortImpl : PORTIMPLEMENTATION _PortImpl PopC ; _PortImpl : PortRef | PortNameRef | _PortImpl ConnectLoc | _PortImpl Figure | _PortImpl Instance | _PortImpl CommGraph | _PortImpl PropDisplay | _PortImpl KeywordDisp | _PortImpl Property | _PortImpl UserData | _PortImpl Comment ; PortInst : PORTINSTANCE _PortInst PopC ; _PortInst : PortRef | PortNameRef | _PortInst Unused | _PortInst PortDelay | _PortInst Designator | _PortInst DcFanInLoad | _PortInst DcFanOutLoad | _PortInst DcMaxFanIn | _PortInst DcMaxFanOut | _PortInst AcLoad | _PortInst Property | _PortInst Comment | _PortInst UserData ; PortList : PORTLIST _PortList PopC ; _PortList : | _PortList PortRef | _PortList PortNameRef ; PortListAls : PORTLISTALIAS PortNameDef PortList PopC ; PortMap : PORTMAP _PortMap PopC ; _PortMap : | _PortMap PortRef | _PortMap PortGroup | _PortMap Comment | _PortMap UserData ; PortNameDef : NameDef | Array ; PortNameRef : NameRef | Member ; PortRef : PORTREF PortNameRef _PortRef PopC ; _PortRef : | PortRef | InstanceRef | ViewRef ; Program : PROGRAM Str _Program PopC ; _Program : | Version ; PropDisplay : PROPERTYDISPLAY _PropDisplay PopC ; _PropDisplay : PropNameRef | _PropDisplay Display ; Property : PROPERTY PropNameDef _Property PopC ; _Property : TypedValue | _Property Owner | _Property Unit | _Property Property | _Property Comment ; PropNameDef : NameDef ; PropNameRef : NameRef ; ProtectFrame : PROTECTIONFRAME _ProtectFrame PopC ; _ProtectFrame : | _ProtectFrame PortImpl | _ProtectFrame Figure | _ProtectFrame Instance | _ProtectFrame CommGraph | _ProtectFrame BoundBox | _ProtectFrame PropDisplay | _ProtectFrame KeywordDisp | _ProtectFrame ParamDisp | _ProtectFrame Property | _ProtectFrame Comment | _ProtectFrame UserData ; Range : LessThan | GreaterThan | AtMost | AtLeast | Exactly | Between ; RangeVector : RANGEVECTOR _RangeVector PopC ; _RangeVector : | _RangeVector Range | _RangeVector SingleValSet ; Rectangle : RECTANGLE PointValue _Rectangle PopC ; _Rectangle : PointValue | _Rectangle Property ; RectSize : RECTANGLESIZE RuleNameDef FigGrpObj _RectSize PopC ; _RectSize : RangeVector | MultValSet | _RectSize Comment | _RectSize UserData ; Rename : RENAME __Rename _Rename PopC ; __Rename : Ident | Name ; _Rename : Str | StrDisplay ; Resolves : RESOLVES _Resolves PopC ; _Resolves : | _Resolves LogicNameRef ; RuleNameDef : NameDef ; Scale : SCALE ScaledInt ScaledInt Unit PopC ; ScaledInt : Int | E Int Int PopC ; ScaleX : SCALEX Int Int PopC ; ScaleY : SCALEY Int Int PopC ; Section : SECTION _Section PopC ; _Section : Str | _Section Section | _Section Str | _Section Instance ; Shape : SHAPE _Shape PopC ; _Shape : Curve | _Shape Property ; SimNameDef : NameDef ; Simulate : SIMULATE _Simulate PopC ; _Simulate : SimNameDef | _Simulate PortListAls | _Simulate WaveValue | _Simulate Apply | _Simulate Comment | _Simulate UserData ; SimulInfo : SIMULATIONINFO _SimulInfo PopC ; _SimulInfo : | _SimulInfo LogicValue | _SimulInfo Comment | _SimulInfo UserData ; SingleValSet : SINGLEVALUESET _SingleValSet PopC ; _SingleValSet : | Range ; Site : SITE ViewRef _Site PopC ; _Site : | Transform ; Socket : SOCKET _Socket PopC ; _Socket : | Symmetry ; SocketSet : SOCKETSET _SocketSet PopC ; _SocketSet : Symmetry | _SocketSet Site ; Status : STATUS _Status PopC ; _Status : | _Status Written | _Status Comment | _Status UserData ; Steady : STEADY __Steady _Steady PopC ; __Steady : PortNameRef | PortRef | PortList ; _Steady : Duration | _Steady Transition | _Steady Becomes ; StrDisplay : STRINGDISPLAY _StrDisplay PopC ; String : STRING _String PopC ; _String : | _String Str | _String StrDisplay | _String String ; _StrDisplay : Str | _StrDisplay Display ; Strong : STRONG LogicNameRef PopC ; Symbol : SYMBOL _Symbol PopC ; _Symbol : | _Symbol PortImpl | _Symbol Figure | _Symbol Instance | _Symbol CommGraph | _Symbol Annotate | _Symbol PageSize | _Symbol BoundBox | _Symbol PropDisplay | _Symbol KeywordDisp | _Symbol ParamDisp | _Symbol Property | _Symbol Comment | _Symbol UserData ; Symmetry : SYMMETRY _Symmetry PopC ; _Symmetry : | _Symmetry Transform ; Table : TABLE _Table PopC ; _Table : | _Table Entry | _Table TableDeflt ; TableDeflt : TABLEDEFAULT __TableDeflt _TableDeflt PopC ; __TableDeflt : LogicRef | PortRef | NoChange | Table ; _TableDeflt : | Delay | LoadDelay ; Technology : TECHNOLOGY _Technology PopC ; _Technology : NumberDefn | _Technology FigGrp | _Technology Fabricate | _Technology SimulInfo | _Technology DesignRule | _Technology Comment | _Technology UserData ; TextHeight : TEXTHEIGHT Int PopC ; TimeIntval : TIMEINTERVAL __TimeIntval _TimeIntval PopC ; __TimeIntval : Event | OffsetEvent ; _TimeIntval : Event | OffsetEvent | Duration ; TimeStamp : TIMESTAMP Int Int Int Int Int Int PopC ; Timing : TIMING _Timing PopC ; _Timing : Derivation | _Timing PathDelay | _Timing Forbidden | _Timing Comment | _Timing UserData ; Transform : TRANSFORM _TransX _TransY _TransDelta _TransOrien _TransOrg PopC ; _TransX : | ScaleX ; _TransY : | ScaleY ; _TransDelta : | Delta ; _TransOrien : | Orientation ; _TransOrg : | Origin ; Transition : TRANSITION _Transition _Transition PopC ; _Transition : LogicNameRef | LogicList | LogicOneOf ; Trigger : TRIGGER _Trigger PopC ; _Trigger : | _Trigger Change | _Trigger Steady | _Trigger Initial ; True : TRUE PopC ; TypedValue : Boolean | Integer | MiNoMa | Number | Point | String ; Unconstrained : UNCONSTRAINED PopC ; Undefined : UNDEFINED PopC ; Union : UNION _Union PopC ; _Union : FigGrpRef | FigureOp | _Union FigGrpRef | _Union FigureOp ; Unit : UNIT _Unit PopC ; _Unit : DISTANCE | CAPACITANCE | CURRENT | RESISTANCE | TEMPERATURE | TIME | VOLTAGE | MASS | FREQUENCY | INDUCTANCE | ENERGY | POWER | CHARGE | CONDUCTANCE | FLUX | ANGLE ; Unused : UNUSED PopC ; UserData : USERDATA _UserData PopC ; _UserData : Ident | _UserData Int | _UserData Str | _UserData Ident | _UserData Form ; ValueNameDef : NameDef | Array ; ValueNameRef : NameRef | Member ; Version : VERSION Str PopC ; View : VIEW ViewNameDef ViewType _View PopC ; _View : Interface | _View Status | _View Contents | _View Comment | _View Property | _View UserData ; ViewList : VIEWLIST _ViewList PopC ; _ViewList : | _ViewList ViewRef | _ViewList ViewList ; ViewMap : VIEWMAP _ViewMap PopC ; _ViewMap : | _ViewMap PortMap | _ViewMap PortBackAn | _ViewMap InstMap | _ViewMap InstBackAn | _ViewMap NetMap | _ViewMap NetBackAn | _ViewMap Comment | _ViewMap UserData ; ViewNameDef : NameDef ; ViewNameRef : NameRef ; ViewRef : VIEWREF ViewNameRef _ViewRef PopC ; _ViewRef : | CellRef ; ViewType : VIEWTYPE _ViewType PopC ; _ViewType : MASKLAYOUT | PCBLAYOUT | NETLIST | SCHEMATIC | SYMBOLIC | BEHAVIOR | LOGICMODEL | DOCUMENT | GRAPHIC | STRANGER ; Visible : VISIBLE BooleanValue PopC ; VoltageMap : VOLTAGEMAP MiNoMaValue PopC ; WaveValue : WAVEVALUE LogicNameDef ScaledInt LogicWave PopC ; Weak : WEAK LogicNameRef PopC ; WeakJoined : WEAKJOINED _WeakJoined PopC ; _WeakJoined : | _WeakJoined PortRef | _WeakJoined PortList | _WeakJoined Joined ; When : WHEN _When PopC ; _When : Trigger | _When After | _When Follow | _When Maintain | _When LogicAssn | _When Comment | _When UserData ; Written : WRITTEN _Written PopC ; _Written : TimeStamp | _Written Author | _Written Program | _Written DataOrigin | _Written Property | _Written Comment | _Written UserData ; Ident : IDENT { Free($1); } ; Str : STR { Free($1); } ; Int : INT { Free($1); } ; Keyword : KEYWORD { Free($1); } ; %% /* * xmalloc: * * Garbage function for 'alloca()'. */ char *xmalloc(siz) int siz; { return (Malloc(siz)); } /* * Token & context carriers: * * These are the linkage pointers for threading this context garbage * for converting identifiers into parser tokens. */ typedef struct TokenCar { struct TokenCar *Next; /* pointer to next carrier */ struct Token *Token; /* associated token */ } TokenCar; typedef struct UsedCar { struct UsedCar *Next; /* pointer to next carrier */ short Code; /* used '%token' value */ } UsedCar; typedef struct ContextCar { struct ContextCar *Next; /* pointer to next carrier */ struct Context *Context; /* associated context */ union { int Single; /* single usage flag (context tree) */ struct UsedCar *Used; /* single used list (context stack) */ } u; } ContextCar; /* * Parser state variables. */ static FILE *Input = NULL; /* input stream */ static FILE *Error = NULL; /* error stream */ extern char *InFile; /* file name on the input stream */ static long LineNumber; /* current input line number */ static ContextCar *CSP = NULL; /* top of context stack */ static char yytext[IDENT_LENGTH + 1]; /* token buffer */ static char CharBuf[IDENT_LENGTH + 1]; /* garbage buffer */ /* * Token definitions: * * This associates the '%token' codings with strings which are to * be free standing tokens. Doesn't have to be in sorted order but the * strings must be in lower case. */ typedef struct Token { char *Name; /* token name */ int Code; /* '%token' value */ struct Token *Next; /* hash table linkage */ } Token; static Token TokenDef[] = { {"angle", ANGLE}, {"behavior", BEHAVIOR}, {"calculated", CALCULATED}, {"capacitance", CAPACITANCE}, {"centercenter", CENTERCENTER}, {"centerleft", CENTERLEFT}, {"centerright", CENTERRIGHT}, {"charge", CHARGE}, {"conductance", CONDUCTANCE}, {"current", CURRENT}, {"distance", DISTANCE}, {"document", DOCUMENT}, {"energy", ENERGY}, {"extend", EXTEND}, {"flux", FLUX}, {"frequency", FREQUENCY}, {"generic", GENERIC}, {"graphic", GRAPHIC}, {"inductance", INDUCTANCE}, {"inout", INOUT}, {"input", INPUT}, {"logicmodel", LOGICMODEL}, {"lowercenter", LOWERCENTER}, {"lowerleft", LOWERLEFT}, {"lowerright", LOWERRIGHT}, {"masklayout", MASKLAYOUT}, @\Rogue\Monster\ else echo "shar: Will not over write edif.y.1" fi echo "Finished archive 1 of 3" # to concatenate archives, remove anything after this line exit 0