For SRecode to work across languages reliably, templates need to follow a predictable pattern. For every language of similar nature (OO, functional, doc based) if they all provide the same base templates, then an application can be written against the base templates, and it will work in each of the supported language.
Having consistent templates also makes it easy to use those templates
from a user perspective during basic interactive insertion via
NOTES ON THIS CHAPTER:
These conventions are being worked on. Check w/ CEDET-DEVEL mailing list if you want to support a language, or write an application and provide your opinions on this topic. Any help is appreciated.
Each language should support the
file:empty template. This
will generally use the default copyright insertion mechanism.
Functional languages should attempt to support the following:
For any Semantic tag class in your language, you will likely want to have a corresponding template.
In order for the SRecode function
srecode-semantic-insert-tag to work, you can create templates
similar to those mentioned above, except with
-tag appended to
the end. This lets a template like
function have user
conveniences when referencing
function-tag, while also
allowing the tag inserter to do its job with a simpler template.
Inside a class definition. These are to be inserted inside the textual bounds of a class declaration.
functionbut specific to alloc/delete of an object.
Inside a body of code, such as a function or method body.
—no conventions yet.
For these variables to be useful, standard names should be used. These values could be provided directly from a Semantic tag, or by an application.
For templates used by
srecode-semantic-insert-tag, there is
also the following useful dictionary values.