The parsers folder should contain a pkgIndex.tcl with the package name and the list of .tcl files used to extract the metadata from the content. It should also contain a Tcl Script, which parses the content to extract the metadata.
A typical parser does the following:
• | Checks if the parsing is possible by verifying the file extension. Or, if the file is a ASCII solver deck, parses the related solver cards. |
• | Parses the file and extracts the metadata. |
• | Adds the extracted metadata to the content. |
A typical parser is shown below.
Name |
Description |
Package name (1) |
Should be the same in pkgIndex.tcl. |
Procedure name (2) |
Used to check if the file can be parsed. This procedure should be ::namespace::imp_canParse. The core application expects a return from the procedure with this name. A return value of 0 means the file cannot be parsed. The file will be treated as a generic file and listed the same in the Organize browser. A return value of 1 means that the file can be parsed. |
Procedure name (3) |
Used to parse the metadata and pass the extracted metadata to core. The name of this procedure should be ::namespace::imp_parse. A return value of 0 should be set to indicate the successful parsing. |
See Also: