cscm.CmdArgument

class cscm.CmdArgument

Bases: object

Encapsulates a command argument object generated by a compiler model.

Command argument objects have one of the following classes.

A frontend process could be any executable. For example, the frontend process for C and C++ analyses is cprocess and the frontend process for Java analyses is java. The order in which the front end process accepts arguments is arbitrary, and the frontend executable may not be started on the same machine that runs the native compiler and compiler model. When the frontend process is called in parser_main, it will fill in the blanks left in the encapsulated command argument object.

For example, for:

CmdArgumentEnvVarPrefix("JAVA_HOME", "bin/java" ) 

the JAVA_HOME environment variable is evaluated on the machine that runs the frontend and used to construct the path to java.

Methods

__init__() Initialize a CmdArgument containing a command argument object.
get_cmd_type() Get the type of the command argument object stored in self.
value() Get the value stored in self.
__init__(s)

Initialize a CmdArgument containing a command argument object.

Parameters: arg (str | CmdArgumentConf | CmdArgumentEnvVarPrefix | CmdArgumentFile | CmdArgumentGTHomeFile | CmdArgumentHubParams | CmdArgumentPrjFilesDirectory | CmdArgumentString | CmdArgumentTagUID | CmdArgumentVector | CmdArgumentUID | CmdArgumentWarningFile) – The value to initialize from. If arg is a str the new CmdArgument object will contain a new CmdArgumentString which in turn contains arg. In all other cases,the new CmdArgument object will contain arg.
get_cmd_type()

Get the type of the command argument object stored in self.

Return type: command argument type value
value()

Get the value stored in a CmdArgument object.

Return type: str | (str,str) | NoneType | CmdArgumentConf | CmdArgumentVector | CmdArgumentWarningFile
Returns: Return values depends on the type of information stored as shown in the following table. Note that in several cases the class of the stored command argument type object provides all necessary information. In these cases None is returned: use get_cmd_type() to identify the command argument type.
self.get_cmd_type() value() return type value() return value
CMD_CONF_FILE CmdArgumentConf The stored CmdArgumentConf object.
CMD_ENV_PREFIX (str,str) A pair (pref,suff), where pref is the name of the environment variable used as the path prefix and suff is the remainder of the path.
CMD_FILE str The stored file contents.
CMD_GTHOME_PREFIX str The path suffix: the part of the path that follows the path to the CodeSonar installation.
CMD_HUB_PARAMS NoneType None
CMD_NULL NoneType None
CMD_PRJ_DIR NoneType None
CMD_STRING str The stored string.
CMD_TAG_UID NoneType None
CMD_UID NoneType None
CMD_VECTOR CmdArgumentVector The stored CmdArgumentVector object.
CMD_WARNING_FILE CmdArgumentWarningFile The stored CmdArgumentWarningFile object.