Etch Compiler Users Guide

Name

etch - compiler for binding code into the Etch runtime environment.

Synopsis

etch  --help|-h
etch  --version|-v
etch [ --output-dir|-d <outputDir> ]
     [  --who|--what|-w <what>  ]
     [ --ignore-global|-g ] [ --ignore-local|-l ]
     [ --word-list|-W  <wordList> ]
     [ --include-Path|-I <includePath> ]
     [ --ignore-Include-Path|-i ]
     [ --dir-mixin|-m <mixinOutputDir> ]
     [ --no-mixin-artifacts|-n] [ --no-flatten|-f ] [ --quiet|-q ]
     --binding|-b <binding> <file>

Description

The Etch compiler processes input etch files and generates target server and/or client code for the selected binding that is integrated with the Etch runtime environment.

Source and target filename suffixes identify language bindings and the kind of processing performed:

.c C target

.cs C# target

.etch Etch source

.java Java target

.kwd Reserved words lists

.rb Ruby target

.xml XML target

.py Python Target

Options

This section describes the compiler options in details

Help Option

--help

-help

-h

?

Print a description of the command options and parameters and then exit.

Usage

etch -h

Output Directory Option

-d outputDir

--outputDir outputDir

Specifies the output directory where etch files will be generated

Usage

etch -d c:\temp Foo.etch

Binding Option

-b binding

--binding binding

Specifies the target language binding to generate. For example "etch -b java" will generate the java binding. Bindings currently supported are java, csharp and xml. In future the plan is to support c, ruby, python and javascript.

Usage

etch -b java Foo.etch

What option

-w what

--who what

--what what

Selects what to generate. What can include: server, client, or both; impl, helper, main, or all; and force.

It is also possible to specify more than one option. For example, a user can specify "etch -w both,helper,main" or "etch -w all". If more than one option is specified, please make sure to separate it by a comma.

Force forces potentially modified files such as impl, main to be overwritten if they already exist in the output directory.

Usage

etch -b java -w client Foo.etch

// Generates Client Code

etch -b java -w server Foo.etch

// Generates Server Code

etch -b java -w both Foo.etch

// Generates both client and server code

etch -b java -w both,impl,main Foo.etch

// Generates Impl and Main code for both server and client

etch -b java -w all Foo.etch

// Generates all code Foo.etch (all is a superset of all -w options)

etch -b java -w all,force Foo.etch

// Generates all code, as well as overwrite impl and main for both server and client

Ignore Global Reserved Word List Option

-g

--ignore-global

Ignore the global reserved words list for Etch.

Ignore Local Reserved Word List Option

-l

--ignore-local

Ignore the local reserved words list for the binding.

Load Reserved Word List Option

-W wordList

--word-list wordList

Specifies the file name of a reserved words list to load, either augmenting or replacing the global and local word lists.

Include Option

-I path

--include-path path

Append the specified path to the path of directories searched for include files as defined in the environment variable ETCH_INCLUDE_PATH.

Usage

etch -b java -I c:\temp Foo.etch

Please see Detailed Example section for an elaborate example

Ignore Include Path Option

-i

--ignore-include-path

Ignore the path of directories searched for include files as defined in the environment variable ETCH_INCLUDE_PATH.

Suppress Mixin Artifact Option

-n

--no-mixin-artifacts

Mixin artifacts are not generated when this option is specified. By default, mixin artifacts will be generated.

Mixin Directory Option

-m outputMixinDir

--dir-Mixin

Directory where mixins will be generated. If -m option is not specified, then mixin will be generated in directory specified by -d option. If etch file contains mixin and neither -m -d and -n are specified, then compiler will throw an error

Usage

etch -b java -m c:\temp\mixin -d c:\temp -w all Foo.etch
Please see Detailed Example section for an elaborate example

No Flatten Option (C# specific)

-f
--no-flatten

Don't flatten the package directories, but rather nest them like java requires. This option is only for C# binding

Regulate Compiler Logs Option

-q

--quiet

This option suppresses info messages in the compiler. It only report problems.

Etch Version

-v

--version

Shows the version and exits.

Detailed Examples

Include Example

To use include files in an etch file, use the .txt extention, not .etch for includes.
You can also include other include files in the etch include files.

module etch.bindings.java.compiler.test

@Direction(Both)
@Timeout(4000)
service TestInclude
{
	const int INT1 = 98765431;

	const boolean BOOL3 = false
	const boolean BOOL4 = true
	
	include "testincl.txt";
	
	const boolean BOOL1 = false
	const boolean BOOL2 = true
	
}

testincl.txt

 
const int INT2 = -2147483648;
include "testincl1.txt";

Mixin Example