Extending the pre-processor

For the programmer

To allow users of your pre-processor extentions to easily add and remove your extentions from their pre-processor, it is strongly recommended that you put your extentions in the following format:

  1. Put everything you need in a standard Euphoria include file. You may include other files, but you should try to either use files in the include directory or put the code directly into your file.
  2. You mustput a comment somewhere in your file (prefably towards the top) in the following format: the standard -- comment, a single space followed by "addto=" (without the quoues) followed immediately (no spaces) by the name of the file to add your extention to. Nothing else should be in the comment.

Here is a simple example of an extention to the tokenizer:

-- addto=tokens.e
addBlockComment("/*","*/") -- Add C-like block comments
addLineComment("//") -- Add C-like line comments

For the user

To add an extention to your pre-processor, use eppext:

eppext ext.e

where ext.e is the filename of the extention to add. You also use eppext to remove it:

eppext ext.e -r

ext.e is the filename of the extention to remove. -r is for remove.

Prev: files.e

Next: The Tokenizer

Table of Contents