update preproc 3

Documentation Version for Comments and Changes

You are invited to make any changes...add any comments.

Changes will `eventually` be merged into the offical documentation.

Leave any commnents here...

...

... back to index page OE documentation



file is processed twice. For example, the datesub.ex pre-processor read the entire file, searched for @DATE@, wrote the file and then Euphoria picked up from there reading the output file, parsing it and finally executing it. To minimize the time taken, Euphoria caches the output of the pre-processor so that the interim process is not normally needed after it has been run once.

Command Line Options

-p - Define a pre-processor

The primary command line option that you will use is the -p option which defines the pre-processor. It is a two or three section option. The first section is a comma delimited list of file extensions to associate with the pre-processor, the second is the actual pre-processor script/command and the optional third is parameters to send to the pre-processor in addition to the -i and -o parameters.

Let's go over some examples:

  • -p e:datesub.ex - This will be executed for every .e file and the command to call is datesub.ex.
  • -p "de,dex,dew:dot4.dll:-verbose -no-dbc" - Files with de, dex, dew extensions will be passed to the dot4.dll process. dot4.dll will get the optional parameters -verbose -no-dbc passed to it.

Multiple pre-processors can be defined at the same time. For instance,

C:\MyProjects\datesub> eui -p e,ex:datesub.ex -p de,dex:dot4.dll \ 
        -p le,lex:literate.ex hello.ex 

is a valid command line. It's possible that hello.ex may include a file named greeter.le and that file may include a file named person.de. Thus, all three pre-processors will be called upon even though the main file is only processed by datesub.ex

-pf - Force pre-processing

When writing a pre-processor you may run into the problem that your source file did not change, therefore, Euphoria is not calling your pre-processor. However, your pre-processor has changed and you want Euphoria to re-process your unchanged source file. This is where -pf comes into play. -pf causes Euphoria to force the pre-processing, regardless of the cached state of any file. When used, Euphoria will always call the pre-processor for all files with a matching pre-processor definition.

Use of a configuration file

Ok, so who wants to type these pre-processor definitions in all the time? I don't either. That's where the standard Euphoria configuration file comes into play. You can simply create a file named eu.cfg and place something like this into it.

-p le,lex:literate.ex 
-p ei,eui:datesub.ex 
... etc ... 

Then you can execute any of those files directly without the -p parameters on the command line. This eu.cfg file can be local to a project, local to a user or global on a system. Please read about the eu.cfg file for more information.

DLL/Shared Library Interface

A pre-processor may be a Euphoria file, ending with an extension of .ex, a compiled Euphoria program, .exe or even a compiled

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu