cscm Module

The compiler model adapter module is named cscm. File cscm.py is located in $CSONAR/csurf/src/compmodels.

Functions

read_response_file() Read a response file and return its contents.
register_compiler_model() Add a model to the set of available compiler models.
cscm.read_response_file(filepath, can_have_comment=False, fallback_to_acp=False, command_line_format=True)

Read a response file and return its contents.

Parameters:
  • filepath (str) –
  • can_have_comment (bool) –
  • fallback_to_acp (bool) –
  • command_line_format (bool) –
Return type:

[ str ]

cscm.register_compiler_model(model)

Add a model to the set of available compiler models.

Parameters: model (CompilerModel) – An object of a concrete CompilerModel subclass. The subclass must define all required methods.

Classes

ArmFrontEnd ARM front end
CSharpFrontEnd A helper class with useful methods for any compiler model that uses the dotnet front end.
CSharp_CompilerModel A subclass of CompilerModel that provides implementations of get_prepend_flags() and get_append_flags() with some default arguments used in all C# compiler models.
C_CompilerModel A subclass of CompilerModel that provides implementations of get_prepend_flags() and get_append_flags() with some default arguments used in all C and C++ compiler models.
CmdArgument Encapsulates a command argument object generated by a compiler model.
CmdArgumentConf A configuration file.
CmdArgumentEnvVarPrefix The path to a file, where the path prefix is an environment variable.
CmdArgumentFile The contents of a file.
CmdArgumentGTHomeFile The path to a file, prefixed by the path to the CodeSonar installation.
CmdArgumentHubParams [CodeSonar only] Hub parameters.
CmdArgumentPrjFilesDirectory The path to the .prj_files directory for the CodeSonar project.
CmdArgumentString A string.
CmdArgumentTagUID Tag UID, which is 567_1234567.
CmdArgumentUID UID, provided with -uid flag.
CmdArgumentVector Stores an iterable of CmdArgument so that the same set of arguments can be shared across multiple FrontEndCommand objects.
CmdArgumentWarningFile The cmd_line.tmp.<uid> file.
CompilerModel Represents a compiler.
CompilerModelResult Represents the full list of compilation units that make up this portion of the build/analysis.
EDGFrontEnd Used by compiler model classes to add in command line arguments for executing cprocess.
FrontEndBase Base class for front end classes.
FrontEndCommand Represents a single front end command invocation.
JavaFrontEnd A helper class with useful methods for any compiler model that uses the java_fe front end.
Java_CompilerModel A subclass of CompilerModel that provides implementations of get_prepend_flags() and get_append_flags() with some default arguments used in all Java compiler models.
ParseConfiguration Instances of this class are read-only objects passed to the __call__() method of your compiler model object.
SWYXFrontEnd A helper class with useful methods for any compiler model that uses the machine code front ends.
X64FrontEnd x64 front end.
X86FrontEnd x86 front end.
X86_CompilerModel A subclass of CompilerModel that provides implementations of get_prepend_flags() and get_append_flags() with some default arguments used in all x86 compiler models.

Attributes

Languages

csl_swyx_arm ARM machine code.
csl_edgcp_c C
csl_edgcp_cpp C++.
csl_dotnetfe_csharp C#.
csl_jfe_java Java.
csl_swyx_ppc32 PPC32 machine code.
csl_synthetic The language associated with the synthesized compilation unit that contains #System_Initialization and all undefined functions.
csl_wildcard Matches lists of languages
csl_swyx_x64 x64 machine code.
csl_swyx_x86 x86 machine code.

Command Argument Types

CMD_CONF_FILE The type member in the CmdArgument object is a CmdArgumentConf.
CMD_ENV_PREFIX The type member in the CmdArgument object is a CmdArgumentEnvVarPrefix.
CMD_FILE The type member in the CmdArgument object is a CmdArgumentFile.
CMD_GTHOME_PREFIX The type member in the CmdArgument object is a CmdArgumentGTHomeFile.
CMD_HUB_PARAMS The type member in the CmdArgument object is a CmdArgumentHubParams.
CMD_NULL There is no type member set in the CmdArgument object
CMD_PRJ_DIR The type member in the CmdArgument object is a CmdArgumentPrjFilesDirectory.
CMD_STRING The type member in the CmdArgument object is a CmdArgumentString.
CMD_TAG_UID The type member in the CmdArgument object is a CmdArgumentTagUID.
CMD_UID The type member in the CmdArgument object is a CmdArgumentUID.
CMD_VECTOR The type member in the CmdArgument object is a CmdArgumentVector.
CMD_WARNING_FILE The type member in the CmdArgument object is a CmdArgumentWarningFile.

Front End Types

FET_CSHARP C# Front End
FET_EDGCP C/C++ Front End
FET_JAVA Java Front End
FET_SWYX Machine Code Front End

“Yes Or No”

For options that are either enabled or disabled.

YON_NO Option is disbled.
YON_UNSET Enabling/disabling is not specified.
YON_YES Option is enabled.