Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

CIF/CAR file syntax

CIF files and CAR files are Lua files that contains a list of directives and declarations. Declarations are structured in CIF/CAR primitives. CIF and CAR files use free-form syntax, and extra white space is ignored. A CIF or CAR file has two basic constructs: identifiers and values.

Elements can appear in any order within a primitive.

Identifiers

Identifiers are names that have the same syntax as C identifiers. The definition of an identifier in BNF form:

identifier ::= [a-zA-Z][a-zA-Z0-9_]*

Values

A value is a basic CIF/CAR data type. CIF and CAR support numbers (in decimal and hex formats) and quoted strings as basic values. Unlike a C string, a CIF or CAR string can contain any characters including null values. The definition of values in EBNF form:

value ::= (number | string) 
number = (decimal_number | hex_number)
decimal_number = [+|-]?[0-9]+ 
hex_number = [+|-]?0x[0-9a-f]+
string = "[^"]*"

In a string, all unprintable characters must be escaped by a backslash.

Directives

The syntax for directives is similar to a C function. Each directive starts with its name and a list of arguments enclosed by parentheses. CIF and CAR currently support only the include directive.

The include directive takes a file name argument and parses the file. The CIFC compiler understands simple C preprocessor define statements and makes their names available to CIF/CAR primitives. For example:

include "AEERemote.bid"

The include directive recursively processes included files when necessary.