CppDiagnostic¶
Describes how a preprocessor class behaves under abnormal conditions.
-
exception
cpip.core.CppDiagnostic.
ExceptionCppDiagnostic
¶ Exception class for representing CppDiagnostic.
-
exception
cpip.core.CppDiagnostic.
ExceptionCppDiagnosticPartialTokenStream
¶ Exception class for representing partial remaining tokens.
-
exception
cpip.core.CppDiagnostic.
ExceptionCppDiagnosticUndefined
¶ Exception class for representing undefined behaviour.
-
class
cpip.core.CppDiagnostic.
PreprocessDiagnosticKeepGoing
¶ Sub-class that does not raise exceptions.
-
partialTokenStream
(msg, theLoc=None)¶ Reports when an partial token stream exists (e.g. an unclosed comment).
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
undefined
(msg, theLoc=None)¶ Reports when an undefined event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
-
class
cpip.core.CppDiagnostic.
PreprocessDiagnosticRaiseOnError
¶ Sub-class that raises an exception on a
#error
directive.-
error
(msg, theLoc=None)¶ Reports when an error event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
-
class
cpip.core.CppDiagnostic.
PreprocessDiagnosticStd
¶ Describes how a preprocessor class behaves under abnormal conditions.
-
__init__
()¶ Constructor.
-
__weakref__
¶ list of weak references to the object (if defined)
-
_prepareMsg
(event, msg, theLoc)¶ Prepares a message.
Parameters: - event (
NoneType
) – The event e.g. ‘error’, if None it is not accumulated. - msg (
str
) – The main message, a string. - theLoc (
cpip.core.FileLocation.FileLineCol([str, int, <class 'int'>]), cpip.core.FileLocation.FileLineCol([str, int, int])
) – The file locator e.g.FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
Returns: str
– <insert documentation for return values>- event (
-
debug
(msg, theLoc=None)¶ Reports a debug message.
Parameters: - msg (
str
) – The main message, a string. - theLoc (
cpip.core.FileLocation.FileLineCol([str, int, <class 'int'>]), cpip.core.FileLocation.FileLineCol([str, int, int])
) – The file locator e.g.FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
Returns: NoneType
- msg (
-
error
(msg, theLoc=None)¶ Reports when an error event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
eventList
¶ A list of events in the order that they appear. An event is a pair of strings:
(type, message)
-
handleUnclosedComment
(msg, theLoc=None)¶ Reports when an unclosed comment is seen at EOF.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
implementationDefined
(msg, theLoc=None)¶ Reports when an implementation defined event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
isDebug
¶ Whether a call to debug() will result in any log output.
-
partialTokenStream
(msg, theLoc=None)¶ Reports when an partial token stream exists (e.g. an unclosed comment).
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
undefined
(msg, theLoc=None)¶ Reports when an undefined event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
unspecified
(msg, theLoc=None)¶ Reports when unspecified behaviour is happening. For example order of evaluation of
'#'
and'##'
.- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-
warning
(msg, theLoc=None)¶ Reports when an warning event happens.
- msg
- The main message, a string.
- theLoc
- The file locator e.g.
FileLocation.FileLineCol
. If present it must have:(fileId, lineNum colNum)
attributes.
-