4. The lexi action file

  1. 4.1. Introduction
  2. 4.2. The header and trailer statements
  3. 4.3. Action definition statement

4.1. Introduction

The lexi action file (.lct) is the second input file for lexi. In it you can specify header and trailer for both of the ouput files. Before the release of 2.0, it will also contains the definitions of the inline actions. Syntax is not frozen yet but will be prior to the 2.0 tag.

4.2. The header and trailer statements

These are optional statements. They are used to specify headers and trailers for both output files. The header is mostly used to add #include directives in the output files, to typedef mappings to lexi's types, and other preamble before the generated code.

HEADERS = @{
	/* header for the C file */
@}, @{
	/* Header for the h file */
@};
TRAILERS = @{
	/* Trailer for the C file */
@}, @{
	/* Trailer for the h file */
@};

4.3. Action definition statement

The syntax is accepted but the semantics are not fully coded yet. An action definition defines the inline code that will be inserted upon encountering a token whose instruction list contains this action call. Here is an example of the intended syntax

ACTION actionname: (inputvar1 :T1, inputvar2 :T2) -> (outputvar1 :T3) = @{
	/* code block */
@},