General idea

The general idea behind the .ebc.xml Compiler is the following:
Descriptions of EBC boards are stored in an xml file. This file is "compiled" into C# source code. The Compiler generates interfaces for all functional units that are used in the board descriptions. Furthermore it generates the wiring code for the boards. As a result the EBC boards are completely defined by the xml file and are fully generated.

How the compiler works

The compiler is a command line tool. You have to supply the name of a Visual Studio project file as a command line parameter. The project file is then searched for all files ending in ".ebc.xml". These files are used as a source for generating the C# code.

All C# code is generated into one file named generated.ebc.cs. As of now this file has to be added to the Visual Studio project manually the first time it is created. In the following runs of the compiler the file is overwritten. You may move the file to another location inside the project directory structure. Its location is searched in the project file.

Using the compiler as a pre-build step

In Visual Studio projects the compiler should be used as a pre-build step. This way it is guaranteed that the code is generated each time you build the project. You should add the compiler to the directory structure of your software project so that you can reference it relative to the Visual Studio project file. The following example shows how the pre-build step may look like:

"$(ProjectDir)..\..\..\lib\ebc.compiler" "$(ProjectPath)"

By using the Visual Studio macros $(ProjectDir) and $(ProjectPath) this pre-build step command is generic. Please note that you should write all file names in quotes to support white space in directory or file names.

Last edited Jan 18, 2011 at 6:08 AM by slieser, version 1


No comments yet.