DIRECTORY IO USING[STREAM, noWhereStream], Rope USING [ROPE], ViewerClasses USING[Viewer, ViewerFlavor]; DBTools: CEDAR DEFINITIONS IMPORTS IO = BEGIN OPEN Rope; EstablishToolDB: PROC [file: Rope.ROPE]; Close: PROC []; ToolDB: READONLY Rope.ROPE; readOnly: READONLY BOOLEAN; RegisterTool: PROC [toolName, loadFile: ROPE]; GetLoadFile: PROC[toolName: ROPE] RETURNS[loadFile: ROPE]; SetToolDocumentation: PROC[toolName: ROPE, docFile, briefDoc: ROPE _ NIL]; GetToolDocumentation: PROC[toolName: ROPE] RETURNS[docFile, briefDoc: ROPE]; SetToolDescriptors: PROC[toolName: ROPE, descriptors: LIST OF ROPE _ NIL]; GetToolDescriptors: PROC[toolName: ROPE] RETURNS[descriptors: LIST OF ROPE]; FindMatchingTools: PROC [descriptors: LIST OF ROPE] RETURNS [tools: LIST OF ROPE]; LoadTool: PROC [toolName: ROPE, errorStream: IO.STREAM _ IO.noWhereStream]; ApplyTool: PROC [toolName, arguments: ROPE, errorStream: IO.STREAM _ IO.noWhereStream]; RegisterViewerFlavor: PROC[tool: ROPE, flavor: ViewerClasses.ViewerFlavor]; RegisterNamePattern: PROC[toolName, pattern: ROPE]; RegisterArgumentPattern: PROC[toolName, pattern: ROPE]; GetViewerInfo: PROC[tool: ROPE] RETURNS[flavor: ViewerClasses.ViewerFlavor, namePattern, argumentPattern: ROPE]; ViewerToTool: PROC[v: ViewerClasses.Viewer] RETURNS[toolName: ROPE, arguments: ROPE]; WriteCatalogue: PROC[ file: Rope.ROPE ]; ReadCatalogue: PROC[ file: Rope.ROPE, eraseFirst: BOOL _ FALSE]; END. ~File: DBTools.mesa Implemented By: DBToolsImpl Last edited by Donahue, June 19, 1985 9:46:43 am PDT This interface manages a database of information about the tools that are generally considered to be part of the Cedar release -- ie., those that are brought over into ///Commands as part of the initialization of a new Cedar machine. Close the connection with the database. Will change only the non-NIL properties of the tool named. The LoadFile must be a short name. (It will be prefixed with ///Commands when loaded.) The name of the tool is the registered command that is used to access it. Return the load file for the named tool Set the documentation properties for the tool -- both the brief documentation and the name of the file containing the complete truth Return the current documentation properties of a tool Set the list of brief descriptors for the tool Return the descriptors for the named tool Return the list of toolnames for which the descriptors match -- each descriptor in the list supplied appears in the list for the tool Execute the contents of the load file for the given tool. This may cause commands to become registered. (No attempt is made to ensure that the load file actually exists.) A record is made that the tool is loaded. A tool corresponds to a registered command; apply the command associated with the tool to the argument list provided. The errorStream is used by the Commander to print any error messages that may arise. Register a viewer flavor for a tool. This registration is used in the mapping of viewers to tools performed by ViewerToTool -- if the flavor of the viewer is of one of the registered flavors, then the toolname produced is the one associated with the registration For tools that simply uses containers, a name pattern is another way to allow mapping of viewers to tools. If tool is associated with the viewer flavor of the tool, then the name patterns currently registered in the database are used to attempt to match the name of the viewer supplied to ViewerToTool -- if one of the patterns completely matches the name of the viewer, then the tool associated with that pattern is used. Argument patterns are used to attempt to construct the argument used to create a viewer from the name of the viewer (eg., a TSetter viewer named "Clover" can be created by executing the command "TSetter Clover" -- in this case the pattern is something that matches the entire name). When executing a ViewerToTool, the pattern associated with the tool is used to attempt to extract the argument needed to create the viewer. (This information is used by Whiteboards, for instance, when it stores a tool viewer in a database.) As described above, use the registered flavor information, the registered name patterns and the registered argument patterns to attempt to determine the toolname and the necessary arguments for the specified viewer. Write a text file of all of the information in the DBTools database. The format of an entry for a tool is: ToolName {Property RopeLiteral}7 ( RopeLiteral* ) where Property is one of "DFFile", "LoadFile", "DocFile", "BriefDoc", "ViewerFlavor", "NamePattern", "ArgumentPattern" and a RopeLiteral is a RopeLiteral (produced by Convert.RopeFromRope). The RopeLiterals enclosed in parentheses are the Descriptors for the tool. Read a previously written catalogue into the database. If eraseFirst, then the database is erased before loading Êt˜Jšœ™Jšœ™šœ™Jšœ%™%J™—J™éJ˜šÏk ˜ Jšœœœ˜ Jšœœœ˜Jšœœ˜*—J˜Jšœ œœ˜-J˜Jšœ˜ J˜JšÏnœœ œ˜)J˜šžœœ˜JšÏi'™'—J˜Jšœœœ˜Jšœ˜Jšœ œœ˜J˜šž œœœ˜/JšŸÞ™Þ—J˜š ž œœ œœ œ˜:JšŸ'™'—J˜š žœœ œœœ˜JJšŸ„™„—J˜š žœœ œœœ˜LJšŸ5™5J™—šžœœ œœœœœ˜JJšŸ.™.J™—šžœœ œœœœœ˜LJšŸ)™)J™—šžœœœœœœ œœœ˜RJšŸ…™…—J˜š žœœ œœœœ˜KJšŸ×™×J™—š ž œœœœœœ˜WJšŸ{œ ŸF™Ì—J˜šžœœœ&˜KJšÏcˆŸ™‰—J˜šžœœœ˜3Jš ¨Ÿ™©—J˜šžœœœ˜7JšŸ™J˜—Jš ž œœœœCœ˜pJ˜š ž œœœ œ œ˜UJšŸ×™×—J˜šžœœ œ˜(JšŸk™k™JšœÏuœ™1—J™J™‰J™—š ž œœ œœœ˜@JšŸq™q—J˜Jšœ˜J˜J˜J˜J˜J˜J˜J˜—…—²¤