NAME
mavros \- ASN.1 compiler
SYNOPSIS
mavros
input_filename
[ \-name module ][ \-d file_names ][ \-s module_names ][ \-i file_names ][ \-cod ] [ \-a ] [ \-c ] [ \-w ] [ \-ser ] [ \-inc ] [ \-mak ] [ \-m module ][ -all] [ \-u ] [ \-um ] [ \-ut ] [ \-bs block-size ][ \-p ] [ \-x debuglevel ][ \-XOM ] [ \-session ] [ \-nolinenum ] [ \-extent93 ] [ \-af_anydef ] [ \-windows ] [ \-BS2000 ] [ \-constants ] [ \-compat ] [ \-notextformat ] [ \-nocerstring ] DESCRIPTION
The code generator MAVROS is the second pass of the "mavros" compiler. It
translates the description of the
data types, operations and errors, whose syntax is given in annotated ASN.1
in the file named
input_filename
into a set of
C
procedures for encoding and decoding the described
data types.
MAVROS will produce:
-
A set of "C" source files that contain the coding and decoding routines,
-
A C "header" file that describes the data types and the prototypes of the
coding routines,
-
A "make" file, that can be used to compile the coding and decoding routines.
according to various parametrizations, specified by command line arguments.
OPTIONS
Mavros
has several options, which describe the source file, the type of routine that
should be generated and the way these routines should be grouped into files. A
set of miscellaneous arguments can be used for introducing debugging
information, and also for various code parametrizations.
MAVROS takes its informations from a source file in "MVR" format. The user
should also supply if necessary the list of auxiliary "header" and "source"
files, using the following arguments:
- "input_filename"
Is the name or path of the file containing the MAVROS source. A single
hyphen '-' indicates that the source should be read on the standard input.
This should always be the first argument to the program. When the preprocessor
mavcod
is used, one should specify here the name of the
"module.mvr"
file generated by this program.
- "-name module"
By default, MAVROS builds the various file names from the "module" name
specified in the input file. This option can be used to enter another name,
e.g.
"module."
The header file will be named
module.h
and the
make
file
module.make .The name of the source file will be fonction of the type of file generation
option.
- "-d file_list"
The content of the listed files will be copied at the beginning of
the file
module.h.
This option is normally used to enter the
"module_mvr.h"
file generated by the preprocessor
mavcod.
- "-s module_list"
Each module of the list will be referenced in the
make
file
module.make,
so that they get compiled at the same time as the coding
procedures, and get inserted in the module library. When the preprocessor
mavcod
is used, one should specify here the name of the
"module_init.c"
file generated by this program.
- "-i filenames"
Is an optional list of files that will have to be included in the MAVROS
result, e.g. in order to define special data types. Note that MAVROS will
automatically reference in the
module.h
file the header file "asn1.h" describing the run time library, as well as the
header files describing the imported ASN.1 modules. This option could be used
if one wants to specify a particular order of reference between the modules.
MAVROS can generate several types of coding and decoding procedures (see the
corresponding manual pages). A set of parameters can be used to specify which
type should be generated:
- "-cod"
generate coding and decoding routines according to the ASN.1 "basic encoding
rules".
- "-a"
generate coding and decoding routines for the
text
syntax.
- "-c"
generate copying, comparison and hash coding routines.
- "-w"
generate coding and decoding routines for the experimental
light weight
syntax. These routines should be used with care; they may be removed from the
next version of the compiler, or their interface may be redefined.
- "-ser"
generate coding and decoding routines according to the "special encoding
rules" defined by SNI.
- "-inc"
generate the header file.
- "-mak"
generate the make file.
- "-m module"
This combined option is equivalent to stating the
"-cod", "-a", "-c", "-inc"
and
"-mak"
options, as well as
"-name module".
- "-all"
This combined option is equivalent to stating the
"-cod", "-a", "-c", "-w", "-inc"
and
"-mak"
options.
By default, MAVROS creates one file per coding or decoding routine. This
behaviour can be parametrize by the following set of options:
- "-u"
generate all routines in a single file, called
module.c . - "-um"
generate one file per "coding mode", i.e. one file for all ASN.1 BER coding
routine, another for all BER decoding routines, for the text coding routines,
etc. The name of the file will be constructed by appending a single character
coding mode identifier to the module name, e.g.
module_g.c.
- "-ut"
generate one file per ASN.1 data type, which will contain all the coding and
decoding routines for that type. The name of the file will be constructed by
appending an hexadecimal number unique to the type in the module to the module
name, e.g.
module_c1.c.
When the default mode is used, the name of the file will be constructed by
appending the hexadecimal type number and the coding mode identifier to the
module name, e.g.
module_c1g.c.
These names will always stay within a 14 characters limit. The particular
names which have been generated will be listed in the "make" file of the
module. The list of files to be compiled will be named "CFILES", the list of
object file to be compiled will be named "OFILES". These list may well become
very long for large specifications, which may be unacceptable for some
systems. One particular option can be used in this case:
- "-bs block-size"
specifies that at most "block-size" file names can be mentioned at a time in a
command line. Instead of
listing all files in the "make" in a single "OFILES" variable, MAVROS will
place them "block-size" at a time in variables OFILES_1, OFILE_S2, etc.
Each of these bloc of files is compiled separately, and archived in the
library.
Several options can be used in order to debug a ".mvr" specification and the
corresponding source and header files:
- "-p"
Generate a pretty printed listing of the ".mvr" source, as well as the
corresponding error messages.
- "-x n"
Set the debug level, which master the output of comments on the "standard
error" file, as well as in the generated files.
- "-nolinenum"
Prevent MAVROS from generating
I "line"
commands similar to those of the C preprocessor in the generated source. When
this command is not used, the error messages generated by the C compiler refer
to the ".mvr" file; if it is used, they refer to the C file.
Various miscellaneous arguments can be used to accomodate special usages of
MAVROS:
- "-XOM"
Use the special extensions necessary to generate "XOM" compatible interfaces.
- "-session"
Use mavros to generate the OSI session protocol.
- "-extent93"
Assume that the programmer is aware of the 1993 "type extensibility" notation,
i.e. that types which can be extended are explicitly described. In this case,
MAVROS will generate an error detection for unexpected elements occuring in a
non extensible "sequence", instead of merely ignoring them.
- "-af_anydef"
Maintain compatibility with an obsolete version of the "ANY DEFINED BY"
construct.
- "-windows"
Generate code that can run under Microsoft's "Windows" environment.
- "-BS2000"
Generate code that is adequate for the SNI BS2000, an EBCDIC machine.
- "-constants"
Generate one global preprocessor definition for the named integer values and
named bit string value. This is problematic, as preprocessor definitions have
a global scope in C, while named values have only a local scope in ASN.1.
- "-compat"
Maintain compatibility with an obsolete version of the memory management.
- "-notextformat"
Do not include any text formating procedures in the text output routines.
- "-nocerstring"
Do not include the "canonical encoding rules" extensions for long strings.
"SEE ALSO"
mavcod (9x),
mavros-output (9x),
asn1_oid(9x),
asn1_time(9x),
asn1_malloc(9x)
C. Huitema,
"General Presentation of the MAVROS Compiler" ,INRIA, 1990
DIAGNOSTIC
The diagnostics produced by MAVROS are intended to be self explanatory.
BUGS
Please report bugs to the authors..