This module allows to analyze a USE OCL
.use source file:
- the file is load with
- then a
info modelcommand is issue,
- the canonical representation produced is finally parsed.
Either find some errors or create a model (see
.usesource file. This source file can be valid or not. In this later case a reference to the contained model will be available.
Analyze the given source file and returns a UseOCLModelFile. If valid, this object contains a model, otherwise it contains the list of errors as well as the USE OCL command exit code.
Parameters: useModelSourceFile (str) – The path of the ‘.use’ source file to analyze
(bool) Indicates if the model file is valid, that is can be successfully parsed and compiled with use.
(list[Error]) list of errors if any or empty list.
(int) exit code of use command.
(Model) Model representing the file in a conceptual way or None if self.isValid is false
Save the model in the canonical form (returned by “info model”) in a given file.
Parameters: fileName (str|NoneType) – The output file name or None. If no file name is provided then the name of the source is taken but the extension will be ‘.can.use’ instead of ‘.use’ Returns: the name of the file generated. Return type: str
printStatus(a, b, c)¶
Print the status of the file:
- the list of errors if the file is invalid,
- a short summary of entities (classes, attributes, etc.) otherwise