home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1997-1998, Tall Tree Software Co.
- *
- * This code is provided AS-IS, with no warranty expressed or implied.
- * in no way shall Tall Tree Software Co. be held liable for damages
- * brought about by the use of this software.
- */
-
- #ifndef Source_File_Scanner_h
- #define Source_File_Scanner_h
-
- /*
-
- For detailed information about how to use the stuff in here, you
- should refer to the on-line help. The place to go within the help is
- the topic titled "Source File Scanner DLL's". You can find it by
- opening the on-line help to the "Contents" tab. Open the book
- titled "DocJet Plug-Ins" and select the topic labeled "Source File
- Scanner DLL's".
-
- A quickie version follows. You need to define a DLL that
- exports functions with these prototypes:
-
- extern "C" DLLEXPORT const Subtype *GetAllSubtypes()
- extern "C" DLLEXPORT void ScanSource( const char *sourceFile,
- ObjectReportFunction f )
-
- GetAllSubtypes will be called once by both the generator and
- editors, it should return a series of Subtype objects, terminated
- by one with 0 for its fullname. ScanSource will only be called
- by the generator
-
- You can also write a function that implements this interface:
-
- extern "C" DLLEXPORT void ScanComplete( ObjectReportFunction f )
-
- It will be called by the generator when all files of your DLL's file
- type have been scanned. (That is, when it knows that it will never
- call your ScanSource function again.)
-
- Your DLL's resource script should include two string-table
- entries, like so:
-
- STRINGTABLE DISCARDABLE
- BEGIN
- IDS_FILE_TYPE_EXTENSIONS "*.gls"
- IDS_FILE_TYPE_NAME "Glossary Source"
- END
-
- Where IDS_FILE_TYPE_EXTENSIONS is defined to 1004 and
- IDS_FILE_TYPE_NAME is defined to 1005.
-
- */
-
- #ifndef DLLEXPORT
- #define DLLEXPORT _declspec(dllexport)
- #define DLLIMPORT _declspec(dllimport)
- #endif
-
- enum RoughType {
- ABSTRACT_ID = 0, // Use this for rough-types that are
- // used as groups, and never have
- // instances.
- TYPEDEF_ID = 't',
- MACRO_ID = 'm',
- FUNCTION_ID= 'f',
- VARIABLE_ID = 'v', // Also variables & constants
- CLASS_ID = 'c', // Also namespaces and other things
- // that contain other objects
- PAPER_ID = 'p', // Only for "raw" objects
- ARGUMENT_ID = 'a', // Arguments to functions, macros, templates, etc.
- GLOSSARY_TERM_ID = 'w'
- };
-
- struct Subtype {
- const Subtype *generalization; // Or 0 if none
- const char *fullname;
- RoughType roughType;
- };
-
- extern "C" void SyntaxError( const char *file, int line, const char *fmt, ... );
-
- typedef void (*ObjectReportFunction)( const char *sourceFile,
- unsigned int commentStartLine,
- unsigned int declStartLine,
- const char *objectName,
- const Subtype &subtype,
- const char *superclass,
- const char *declaration,
- const char *comment,
- const char *body,
- /* Pairs of const char *, const char *,
- * followed by a 0 */
- ... );
-
- typedef char *(*CustomGeneratorFunction)
- ( char *(*doSubstitutions)( const char *in ),
- const char *assignedTag, const char *title,
- const char *body );
-
- #define FILE_TYPE_ICON_RESOURCE_ID 1003
- #define FILE_TYPE_EXTENSIONS_RESOURCE_ID 1004
- #define FILE_TYPE_NAME_RESOURCE_ID 1005
-
-
- /*
- * The "ATTR_" macros are attributes (used in the "extras" parameter).
- * Obviously, you can pass any name you want. What we are trying to do
- * here is establish some conventions, at least for the generally used
- * attributes. "AV_" macros are possible values for the attributes.
- */
-
- #define ATTR_IMPLEMENTS "implements"
- #define ATTR_EVENT_SOURCES "event_sources"
- #define ATTR_DEFAULT_INTERFACE "default_interface"
- #define ATTR_SUPERCLASSES "superclasses"
- #define ATTR_SUBCLASSES "subclasses"
- #define ATTR_ORDER_IN_CODE "orderInCode"
- #define ATTR_OTHER_CONTEXTS "otherContexts"
- #define ATTR_ACCESS "security"
- #define AV_PUBLIC "public"
- #define AV_PRIVATE "private"
- #define AV_PROTECTED "protected"
- #define ATTR_TYPE "type"
- #define ATTR_ARGDIR "argdir"
- #define AV_ARGDIR_BYVAL "input"
- #define AV_ARGDIR_BYREF "output"
- #define AV_ARGDIR_RETVAL "retval"
- #define ATTR_DEFAULT_VALUE "default"
- #define AV_DEFVAL_OPTIONAL "null"
- #define ATTR_VIRTUAL "virtual"
- #define ATTR_NAMESPACE_ALIAS "alias_of"
- #define ATTR_FINAL "final"
- #define AV_TRUE "true"
- #define AV_FALSE "false"
- #define ATTR_ABSTRACT "abstract"
- #define ATTR_IMPORTS "imports"
- #define ATTR_TRANSIENT "transient"
- #define ATTR_VOLATILE "volatile"
- #define ATTR_SYNCHRONIZED "synchronized"
- #define ATTR_THROWS "throws"
- #define ATTR_STATIC "static"
- #define ATTR_DEFAULT_GROUP "defaultGroup"
- #define ATTR_LIBRARY "library"
-
-
- #endif