;;; xic.el --- Custom mode for Shishir ;; Copyright (C) 2003 Free Software Foundation, Inc. ;; Author: Bart Teeuwisse ;; Keywords: languages ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See thes ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; No indentation support yet. ;;; Code: (defvar xic-mode-map nil "Local keymap for xic mode buffers.") (defvar xic-keyword-list '("#define" "#ifdef" "#ifndef" "#else" "#endif" "#macro" "function" "endfunc" "static" "global" "e" "pi" "PI" "NULL" "INFINITY" "TRUE" "FALSE" "EOF" "return" "if" "elif" "else" "end" "repeat" "while" "dowhile" "break" "continue" "goto" "label")) (defvar xic-script-functions-list '("Edit" "OpenCell" "NewCellName" "ClearCell" "Push" "Pop" "CurCellName" "TopCellName" "FileName" "CurCellBB" "Save" "RenameCell" "Clear" "ClearAll" "IsCellInMem" "IsFileInMem" "NumCellsInMem" "ListCellsInMem" "ListTopCellsInMem" "ListModCellsInMem" "ListTopFilesInMem" "Window" "GetWindow" "GetWindowView" "GetWindowMode" "Expand" "Display" "FreezeDisplay" "Redraw" "Exit" "Halt" "PushGhost" "PushGhostBox" "PopGhost" "ShowGhost" "GRopen" "GRcheckError" "GRcreatePixmap" "GRdestroyPixmap" "GRcopyDrawable" "GRdraw" "GRgetDrawableSize" "GRresetDrawable" "GRclear" "GRpixel" "GRpixels" "GRline" "GRpolyLine" "GRlines" "GRbox" "GRboxes" "GRarc" "GRpolygon" "GRtext" "GRtextExtent" "GRdefineColor" "GRsetBackground" "GRsetWindowBackground" "GRsetColor" "GRdefineLinestyle" "GRsetLinestyle" "GRdefineFillpattern" "GRsetFillpattern" "GRupdate" "GRsetMode" "HClistDrivers" "HCsetDriver" "HCgetDriver" "HCsetResol" "HCgetResol" "HCgetResols" "HCsetBestFit" "HCgetBestFit" "HCsetLegend" "HCgetLegend" "HCsetLandscape" "HCgetLandscape" "HCsetMetric" "HCgetMetric" "HCsetSize" "HCgetSize" "HCshowAxes" "HCshowGrid" "HCsetGridInterval" "HCsetGridStyle" "HCsetGridOnTop" "HCdump" "HCerrorString" "HClistPrinters" "HCmedia" "OpenLibrary" "CloseLibrary" "Mode" "CurMode" "StuffText" "TextCmd" "GetLastPrompt" "ListFunctions" "Exec" "SetKey" "Techfile" "GetTechExt" "SetTechExt" "Set" "Unset" "SetExpand" "Get" "JoinLimits" "VersionString" "ArrayDims" "ArrayDimension" "GetDims" "DupArray" "SortArray" "ShiftBits" "AndBits" "OrBits" "XorBits" "NotBits" "InitGen" "CellsHandle" "GenCells" "GetError" "AddError" "GetLogNumber" "GetLogMessage" "AddLogMessage" "NumHandles" "HandleContent" "HandleTruncate" "HandleNext" "HandleDup" "HandleDupNitems" "H" "HandleArray" "HandleCat" "HandleReverse" "HandlePurgeList" "Close" "CloseArray" "FreeArray" "CoreSize" "SepString" "Defined" "TypeOf" "PathToEnd" "PathToFront" "InPath" "RemovePath" "RegCompile" "RegCompare" "RegError" "StringHandle" "ListHandle" "ListContent" "ListNext" "ListAddFront" "ListAddBack" "ListAlphaSort" "ListUnique" "ListFormatCols" "ListConcat" "ListIncluded" "Strcat" "Strcmp" "Strncmp" "Strcasecmp" "Strncasecmp" "Strdup" "Strtok" "Strchr" "Strrchr" "Strstr" "Strpath" "ToReal" "ToString" "ToFormat" "ToChar" "Strlen" "Sizeof" "FileInfo" "GetArchiveContext" "SaveArchiveContext" "RecallArchiveContext" "CxInfo" "CxFileName" "CxFileType" "CxTopCells" "CxLayers" "CxEstSkelSize" "CxCellBB" "CxSetArea" "CxClearArea" "CxEdit" "CxSetupSkeleton" "SetConvertScale" "FromArchive" "FromTxt" "SaveCellAsNative" "SetStripForExport" "SetSkipInvisLayers" "SetMapGDSoutToUpper" "ToXIC" "ToCGX" "ToCIF" "ToGDS" "ToGdsLibrary" "ToOASIS" "ToTxt" "ToSpice" "WriteGeomSplit" "SetConvertFlags" "SetConvertArea" "SetMergeInRead" "SetMapGDSinToLower" "SkelSetDataWin" "SkelClear" "SkelClearGeom" "SkelReadGeom" "SkelWriteGeom" "SkelWriteGeomSplit" "SkelWriteDigest" "SkelReadDigest" "StreamOpen" "StreamTopCell" "StreamInstance" "StreamWrite" "StreamCxWrite" "StreamFinish" "Cwd" "Pwd" "DateString" "MilliSec" "Glob" "Open" "Popen" "Sopen" "ReadLine" "ReadChar" "WriteLine" "WriteChar" "TempFile" "ListDirectory" "SetButtonStatus" "GetButtonStatus" "PressButton" "BtnDown" "BtnUp" "KeyDown" "KeyUp" "Point" "Shell" "System" "GetPID" "AskReal" "AskString" "AskConsoleReal" "AskConsoleString" "GetKey" "ShowPrompt" "SetIndent" "SetPrintLimits" "Print" "PrintLog" "PrintString" "PrintStringEsc" "Message" "ErrorMsg" "TextWindow" "Commit" "Undo" "Redo" "SetTransform" "StoreTransform" "RecallTransform" "GetCurAngle" "GetCurMX" "GetCurMY" "GetCurMagn" "UseTransform" "ShowGrid" "ShowAxes" "SetGrid" "GetGridInterval" "GetGridSnap" "SetGridStyle" "GetGridStyle" "SetGridOnTop" "GetGridOnTop" "ClipToGrid" "SetCurLayer" "SetCurLayerAlias" "SetCurLayerDescr" "NewCurLayer" "GetCurLayer" "GetCurLayerAlias" "GetCurLayerDescr" "AddLayer" "RemoveLayer" "RenameLayer" "LayerHandle" "GenLayers" "IsLayerConductor" "IsLayerRouting" "IsLayerGround" "IsLayerContact" "IsLayerVia" "IsLayerDarkField" "IsLayerVisible" "SetLayerVisible" "GetLayerMinDimension" "GetLayerWireWidth" "GetLayerThickness" "GetLayerRho" "GetLayerEps" "GetLayerLambda" "GetLayerResis" "GetLayerCap" "GetLayerCapPerim" "AddLayerGdsOutMap" "RemoveLayerGdsOutMap" "AddLayerGdsInMap" "ClearLayerGdsInMap" "SetLayerNoDRCdatatype" "ReadLayerAliases" "DumpLayerAliases" "ClearLayerAliases" "AddLayerAlias" "RemoveLayerAlias" "LayerAlias" "SetLayerSpecific" "SetSelectMode" "Select" "SelectLast" "Deselect" "SelectHandle" "SelectHandleTypes" "AreaHandle" "MakeObjectCopy" "BloatObjects" "EdgeObjects" "ManhattanizeObjects" "GroupObjects" "JoinObjects" "SplitObjects" "CheckObjectsConnected" "CheckForHoles" "ObjectHandleDup" "ObjectHandlePurge" "ObjectNext" "ObjectDelete" "ObjectSelect" "ObjectDeselect" "ObjectMove" "ObjectMoveToLayer" "ObjectCopy" "ObjectCopyToLayer" "FilterObjects" "FilterObjectsA" "GetObjectType" "GetObjectID" "GetObjectArea" "GetObjectPerim" "GetObjectBB" "SetObjectBB" "GetObjectLayer" "SetObjectLayer" "GetObjectFlags" "GetObjectState" "GetObjectGroup" "GetObjectCoords" "SetObjectCoords" "GetObjectMagn" "SetObjectMagn" "GetWireWidth" "SetWireWidth" "GetWireStyle" "SetWireStyle" "SetWireToPoly" "GetWirePoly" "GetLabelText" "SetLabelText" "GetLabelXform" "SetLabelXform" "GetInstanceArray" "SetInstanceArray" "GetInstanceXform" "GetInstanceXformA" "SetInstanceXform" "SetInstanceXformA" "GetInstanceName" "SetInstanceName" "FlatObjList" "FlatObjGen" "FlatObjGenLayers" "FlatGenNext" "FlatGenCount" "FlatOverlapList" "ClipAround" "ClipAroundCopy" "ClipAroundAll" "ClipAroundAllCopy" "ClipTo" "ClipToCopy" "ClipToAll" "ClipToAllCopy" "ClipObjects" "ClipIntersectCopy" "ChangeLayer" "Bloat" "Manhattanize" "Join" "Decompose" "Box" "Polygon" "Arc" "Sides" "Wire" "Label" "Logo" "Justify" "Place" "Replace" "PlaceParams" "Delete" "DeleteEmpties" "Erase" "EraseUnder" "Yank" "Put" "Xor" "Copy" "CopyToLayer" "Move" "MoveToLayer" "Rotate" "RotateToLayer" "Split" "Flatten" "CreateSymbol" "Layer" "PrptyHandle" "PrptyNumber" "PrptyString" "PrptyNext" "PrptyAdd" "PrptyRemove" "GetPrpHandle" "GetCellPrpHandle" "GetProperty" "GetPropertyString" "AddProperty" "AddCellProperty" "RemoveProperty" "RemoveCellProperty" "DRCstate" "DRCsetLimits" "DRCgetLimits" "DRCsetLevel" "DRCgetLevel" "DRCcheckArea" "DRCcheckObjects" "DRCregisterExpr" "DRCtestBox" "DRCtestPoly" "Distance" "MinDistPointToSeg" "MinDistPointToObj" "MinDistSegToObj" "MinDistObjToObj" "MaxDistPointToObj" "MaxDistObjToObj" "Intersect" "GetZlist" "BoxZ" "ZoidZ" "ObjectZ" "BloatZ" "EdgesZ" "ManhattanizeZ" "SetZref" "ParseLayerExpr" "EvalLayerExpr" "TestCoverage" "ZtoObjects" "ZtoTempLayer" "ClearTempLayer" "GeomAnd" "GeomAndNot" "GeomCat" "GeomNot" "GeomOr" "GeomXor" "DumpPhysNetlist" "DumpElecNetlist" "SourceSpice" "ExtractAndSet" "ModifyTerminal" "GetTerminalName" "GetTerminalType" "GetTerminalFlags" "GetTerminalLocation" "GetTerminalInstance" "IsTerminalFormal" "GetTerminalObject" "GetTerminalVgroup" "GetTerminalLayer" "Group" "GetNumberGroups" "GetGroupBB" "GetGroupNode" "GetGroupName" "GetGroupNetName" "GetGroupCapacitance" "ListGroupObjects" "ListGroupDevContacts" "ListGroupSubcContacts" "ListGroupTerminals" "ListGroupTerminalNames" "ListPhysDevs" "GetPdevName" "GetPdevIndex" "GetPdevDual" "GetPdevBB" "GetPdevMeasure" "ListPdevMeasures" "ListPdevContacts" "GetPdevContactName" "GetPdevContactBB" "GetPdevContactGroup" "GetPdevContactLayer" "GetPdevContactDev" "GetPdevContactDevName" "GetPdevContactDevIndex" "ListPhysSubckts" "GetPscName" "GetPscIndex" "GetPscDual" "GetPscBB" "ListPscContacts" "IsPscContactIgnorable" "GetPscContactName" "GetPscContactGroup" "GetPscContactSubcGroup" "GetPscContactSubc" "GetPscContactSubcName" "GetPscContactSubcIndex" "EnableNodeMap" "GetNumberNodes" "SetNodeName" "GetNodeName" "GetNodeNumber" "GetNodeGroup" "ListNodeTermimals" "ListNodeTermimalNames" "ListElecDevs" "SetEdevProperty" "GetEdevProperty" "GetEdevObj" "abs" "acos" "asin" "atan" "acosh" "asinh" "atanh" "cos" "cosh" "exp" "gauss" "ln" "log" "random" "seed" "sgn" "sin" "sinh" "sqrt" "tan" "tanh" "atan2")) (defun xic-set-font-lock-keywords () (setq xic-font-lock-keywords (list ;; Functions (list (concat "\\(\\s-\\|^\\)\\(" (mapconcat 'identity xic-script-functions-list "\\|") "\\)\\(\\s-\\|$\\|(\\|)\\)") 2 'font-lock-function-name-face) ;; Keywords. (list (concat "\\(\\s-\\|^\\)\\(" (mapconcat 'identity xic-keyword-list "\\|") "\\)\\(\\s-\\|$\\|(\\)") 2 'font-lock-keyword-face) ))) (xic-set-font-lock-keywords) (defvar xic-mode-syntax-table nil "Syntax table in use in xic-mode buffers.") (if xic-mode-syntax-table () (setq xic-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?\n ">" xic-mode-syntax-table) (modify-syntax-entry ?\f ">" xic-mode-syntax-table) (modify-syntax-entry ?# "<" xic-mode-syntax-table)) (defun xic-mode () "Xic mode" (interactive) (kill-all-local-variables) (setq mode-name "Xic") (setq major-mode 'xic-mode) (use-local-map xic-mode-map) (set-syntax-table xic-mode-syntax-table) (make-local-variable 'comment-start) (setq comment-start "# ") (make-local-variable 'comment-start-skip) (setq comment-start-skip "#+ *") (make-local-variable 'comment-column) (setq comment-column 40) (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'parse-sexp-ignore-comments) (setq parse-sexp-ignore-comments nil) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(xic-font-lock-keywords)) (run-hooks 'xic-mode-hook)) (provide 'xic) ;;; xic.el ends here