The ManiArg core engine shall be designed such that it can be easily transcoded into a wide range of diverse programming languages. It operates utilizing a minimum of language features to maximize the portability of the core engine's code.
Dynamic memory allocation is avoided. First, this serves the goal of applicability in embedded systems and other environments where dynamic memory allocation is not allowed. Second, it supports the minimization of the memory footprint. Since the amount of data processed on the command line is considered negligible, memory footprint and portability was always given preceedence over execution speed in the design of the engine.
A prototype implementation of a backbone engine has been developed in C, which serves as the reference implementation. This engine undergoes rigorous testing procedures, including comprehensive unit tests and static code analysis.
An additional set of unit tests externally interacts with the C engine, achieving 100% code coverage. These tests function as a model for testing implementations in other programming languages.
The design considers the following components:
application at run time
The user's application relies on an API provided by the code generator for its particular application. The application passes the command line argument vector to the parser and interacts with it to access values from the command line.
generated code to serve a particular application
Generated code initializes the core engine by passing a sequence of match instructions to its 'constructor'. Additionally, it may pass chunks of pre-allocated memory. Further, it can produce a list of flag constraints which allow to judge the consistency of the argument vector.
Generated code is produced to provide access functions to values extracted from the command line. These access functions get information about flags and strings from the core engine. If necessary they interact with converter functions to provide the type required by the user.
Once code has been generated, an application can pass the command line vector to the initialization function of the command line parser. The initialization function initializes the core engine and prepares its parsing. In object orientation.