CIFParserDoc.tioga
Christian Le Cocq, September 18, 1987 10:32:36 am PDT
CIFPARSER
CEDAR 7.0 — FOR INTERNAL XEROX USE ONLY
CIFParser
Christian Le Cocq
© Copyright 1987 Xerox Corporation. All rights reserved.
Abstract: The CIF parser provides a parser of the Caltech Intermediate Form description language, a format widely used to carry the geometrical description of the integrated circuits.
Created by: Christian Le Cocq
Maintained by: Christian Le Cocq <LeCocq.pa>
Keywords: CIF, parser.
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
The CIFParser Interface
the parser
The parser reads the CIF file, parses each command and its arguments, and calls the client registred proc for the relevant command. The parser raises CIFParser.Error for each syntax error, and the client proc is supposed to raise CIFParser.ClientError, if it detects an incoherence. ClientError is mapped by the parser into Error with the string "client error: " concatened to the message.
A Pretty Printer program is provided as an application example and a test of the package.
the transformation utilities
A small CIF transformation package (just enough to convert to ChipNDale...) is provided to handle the interpretation of the list of transformations of the Call symbol command.
CIF Definition
formal syntax
cifFile  = {{blank} [command] semi} endCmd {blank}.
command  = primCmd | defDeleteCmd |
   defStartCmd semi {{blank} [primCmd] semi} defFinishCmd.
primCmd  = polygonCmd | boxCmd | roundFlashCmd | wireCmd
   | layerCmd | callCmd | userExtensionCmd | commentCmd.
polygonCmd = "P" path.
boxCmd  = "B" integer sep integer sep point [sep point].
roundFlashCmd = "R" integer sep point.
wireCmd  = "W" integer sep path.
layerCmd  = "L" {blank} shortname.
defStartCmd = "D" {blank} "S" integer [sep integer sep integer].
defFinishCmd = "D" {blank} "F".
defDeleteCmd = "D" {blank} "D" integer.
callCmd  = "C" integer transformation.
userExtensionCmd= digit userText.
commentCmd = "(" commentText ")".
endCommand = "E".
transformation = {{blank} (
   "T" point | "M" {blank} "X" | "M" {blank} "Y" | "R" point)}.
path   = point {sep point}.
point  = sInteger sep sInteger.
sInteger  = {sep} ["-"] integerD.
integer  = {sep} integerD.
integerD  = digit {digit}.
shortname  = c[c][c][c].
c   = digit | upperChar
userText  = {userChar}.
commentText = {commentChar} | commentText "(" commentText ")" commentText.
semi   = {blank} ";" {blank}.
sep   = upperChar | blank.
digit   = "0" | .. | "9".
upperChar = "A" | .. | "Z".
blank  = any ASCII char except digit, upperChar, "-", "(", ")", or ";".
userChar  = any ASCII char except ";".
commentChar = any ASCII char except "(", or ")".