Project Settings

The Project Settings window is where details regarding the project, such as encoding rules, target language, and code features to generate are modified. The window contains the following tabs: Language, Output, Function Generation, Constraints and Debugging, Code Modifications, language-specific code modifications, and Build Options.

Language tab

The Language tab contains options for selecting a target language, encoding rules, ASN.1 Standards, translation, and input options.

The Language tab contains the following sections:

Application Language Type

This section provides users with the ability to define the target language for the project. A target language must be selected in order to compile a schema.

Depending on the target language selected, additional options are displayed within the Output tab.

For C or C++ target languages, the C/C++ Output Options section controls how generated code is distributed across source files.

For C#, the C# Code Organization section controls how generated code is distributed across source files and how files are organized into directories.

For Java, the Java Code Organization section controls how generated code should be organized into directories based on the ASN.1 module for which they were generated. Alternatively, generated files are placed directly into the output directory.

Encoding Rules

This section provides users with the ability to define one or more encoding rule sets to be selected for the generated code.

ASN.1 Standard

This section provides users with the ability to apply current or previously-defined ASN.1 standards to the generated code.

Additional Translations

This section provides users with the ability to define the options for generating transformed versions of the input schema, such as HTML or pretty-printed.

Input Options

This section provides users with the ability to define how strict the compiler is when parsing ASN.1 schema.

Output tab

The Output tab contains options for selecting encoding rules, as well as output and project directories.

The Output tab contains the following sections:

Output Directory and Project Directory

This section provides users with the ability to define in which directory the code output and/or project should be stored.

Language-specific Output Options

This section provides users with the ability to define additional output options specific to the language type chosen on the Language tab, as well as the ability to define additional directories.

Function Generation tab

The Function Generation tab provides settings for the functionality to include in generated code.

The Function Generation tab contains the following sections:

Generated Function Types

This section provides users with the ability to define granular control of which functions to generate. The printing functions allow for various printing schemes to be generated, such as print-to-string and print-to-standard-output, and how the printed data should be formatted.

Specify PDU Types

This section provides users with the ability to define which productions to select as PDUs.

Sample Program Generation

This section provides users with the ability to define the generation of simple encoding and decoding programs, which demonstrate using the generated code. Additionally, the sample writer program can optionally encode randomly-generated test data.

Language-specific Functions

Depending on the target language selected, additional options may be displayed within this section of the Function Generation tab.

For C and C++, additional functions for memory management and macros for dealing with named bits in BIT STRINGs can be generated. Initialization functions are generated by default, but may be turned off.

For Java, get and set methods can be generated for members of generated classes. It is also possible to generate methods that can fetch certain types of metadata (for example, if an element is optional). A similar option exists for C#.

Constraints and Debugging tab

The Constraints and Debugging tab holds settings related to constraint handling, event handling, and logging in generated code.

The Constraints and Debugging tab contains the following sections:

Constraints

This section provides users with the ability to add or remove various types of restriction checks from the generated code.

Debugging and Event Handling

This section provides users with the ability to add debug tracing and event hooks. In addition to enabling event callbacks, generation of type structures can also be disabled, in which case generated decode functionality simply calls user-created event handlers and does not perform its own decoding operation.

Code Modifications tab

The Code Modifications tab contains a number of options for generating simplified code.

The Code Modifications tab contains the following sections:

Space Optimizations

This section provides users with the ability to remove unwanted or unneeded functionality and shorten the names of generated types.

Other Options

This section provides users with the ability to define several miscellaneous settings, including the option to generate code for types that have been imported into the current schema.

Language-specific tab

Additional code modification options that are language-specific are shown in a separate tab next to the Code Modifications tab. The label and contents of this tab changes based on the language selected within the Output tab.

For C/C++, the tab is displayed as follows, and includes several settings for adjusting how ASN.1 types are mapped to native C/C++ types:

For C#, the tab is displayed as follows, and includes settings to allow for manipulating the namespace into which code is generated:

Note

The Java tab contains similar options.

Build Options tab

When a target language other than None is selected, an additional Build Options tab is displayed to provide language environment-specific settings for generating makefiles and build scripts.

For C or C++, the tab is as follows:

A makefile can be generated in either Windows or GNU format. For Windows, a Visual Studio project can also be generated. Under the Build Libraries section, which generates the build script to build a library rather than an executable, the desired variety of library can be selected.

The C/C++ Compile Optimization section allows for defining whether Space or Time optimization qualifiers should be added to the C compilation command-line in the makefile.

For C#, the tab is as follows:

For C#, a makefile or Visual Studio project can be created, optionally including a *.mk file listing the files generated. An option to specify a strongly named key file is also available.

For Java, the tab is as follows:

Like C#, Java can also provide a *.mk generated file list, as well as an Ant build script and a batch or shell script.

For Python, the tab is as follows:

For Python, ASN1C can create a batch file (Windows) or shell script (non-Windows) that generates the Python code as set up by the GUI settings.

For Go, the tab is as follows:

The Go code generator can create a makefile to generate and build Go code. The generator can also create a JSON file with random test data. Additionally, an option for the generator not to create a main.go file (for instance, if there already is one that has been modified) is available.