Package org.eclipse.cdt.core.parser
Interface IProblem
- All Known Subinterfaces:
IASTProblem
,IPersistableProblem
- All Known Implementing Classes:
AbstractPersistableProblem
public interface IProblem
Description of a C/C++ syntax problems and spelling errors as detected by the lexer, preprocessor,
parser or the spelling engine.
A problem provides access to:
- its location (originating source file name, source position, line number),
- its message description and a predicate to check its severity (warning or error).
- its ID : an number identifying the very nature of this problem. All possible IDs are listed as constants on this interface.
Note, that semantic problems are modeled via ISemanticProblem
.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final String
Deprecated.Not used.static final int
Mask to use in order to filter out the category portion of the problem ID.static final int
-1, returned when an offset or a line number is unknown.static final int
IProblem relates to an implementation or design limitationstatic final int
Missing semicolon.static final int
Circular inclusion encountered by Preprocessor.static final int
Preprocessor Conditional cannot not be evaluated due.static final int
Macro definition not found by Preprocessor.static final int
Maximum inclusion depth is exceededstatic final int
Inclusion not found by Preprocessor.static final int
Invalid or unknown preprocessor directive encountered by Preprocessor.static final int
Invalid format to Macro definition.static final int
Invalid macro redefinition encountered by Preprocessor.static final int
static final int
__VA_ARGS__ encountered in macro definition without the required '...' parameter Required attributes: nonestatic final int
Invalid Macro Pasting encountered by Preprocessor.static final int
Invalid macro usage encountered by Preprocessor.static final int
macro argument "..." encountered without the required ')' i.e.static final int
During concatenation of string literals, at least two were found with more than one type of UDL suffix.static final int
#error encountered by Preprocessor.static final int
#warning encountered by Preprocessor.static final int
IProblem relates to a valid error on the preprocessorstatic final int
Preprocessor conditionals seem unbalanced.static final int
Assignment '=' encountered in macro by Scanner.static final int
Bad binary encountered by Scanner.static final int
Bad character encountered by Scanner.static final int
Division by 0 encountered in macro by Scanner.static final int
Bad decimal encountered by Scanner.static final int
Bad floating point encountered by Scanner.static final int
Bad hexadecimal encountered by Scanner.static final int
Bad octal encountered by Scanner.static final int
Invalid suffix on constantstatic final int
Division by 0 encountered in macro by Scanner.static final int
Expression syntax error encountered in macro by Scanner.static final int
Invalid prefix on floatstatic final int
Expression syntax error encountered in macro by Scanner.static final int
Invalid escape sequence encountered by Scanner.static final int
Missing ')' encountered in macro by Scanner.static final int
IProblem relates to a valid error on the Scannerstatic final int
Unbounded literal string encountered by Scanner.static final int
Unexpected EOF encountered by Scanner.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
Deprecated.Not used.static final int
static final int
IProblem relates to a valid syntax error in the parserstatic final int
The parser's template argument nesting depth limit was exceeded. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkCategory
(int bitmask) Check the parameter bit-mask against an IProblem's ID to broadly segregate the types of problems.String[]
Returns a possibly empty argument array to compute the message.int
getID()
Returns the problem idReturns a human-readable message describing the problem.Returns a human-readable message string describing the problem, adding location information.char[]
Returns the file name in which the problem was foundint
Returns the end position of the problem (inclusive), orINT_VALUE_NOT_PROVIDED
if unknown.int
Returns the line number where the problem begins, orINT_VALUE_NOT_PROVIDED
if unknown.int
Returns the start position of the problem (inclusive), orINT_VALUE_NOT_PROVIDED
if unknown.boolean
isError()
Returns whether the problem is an error.boolean
Returns whether the problem is a warning.
-
Field Details
-
INT_VALUE_NOT_PROVIDED
static final int INT_VALUE_NOT_PROVIDED-1, returned when an offset or a line number is unknown.- See Also:
-
SCANNER_RELATED
static final int SCANNER_RELATEDIProblem relates to a valid error on the Scanner- See Also:
-
PREPROCESSOR_RELATED
static final int PREPROCESSOR_RELATEDIProblem relates to a valid error on the preprocessor- See Also:
-
SYNTAX_RELATED
static final int SYNTAX_RELATEDIProblem relates to a valid syntax error in the parser- See Also:
-
INTERNAL_RELATED
static final int INTERNAL_RELATEDIProblem relates to an implementation or design limitation- See Also:
-
IGNORE_CATEGORIES_MASK
static final int IGNORE_CATEGORIES_MASKMask to use in order to filter out the category portion of the problem ID.- See Also:
-
SCANNER_BAD_CHARACTER
static final int SCANNER_BAD_CHARACTERBad character encountered by Scanner. Required attributes: A_SCANNER_BADCHAR- See Also:
-
SCANNER_UNBOUNDED_STRING
static final int SCANNER_UNBOUNDED_STRINGUnbounded literal string encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_INVALID_ESCAPECHAR
static final int SCANNER_INVALID_ESCAPECHARInvalid escape sequence encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_FLOATING_POINT
static final int SCANNER_BAD_FLOATING_POINTBad floating point encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_HEX_FORMAT
static final int SCANNER_BAD_HEX_FORMATBad hexadecimal encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_UNEXPECTED_EOF
static final int SCANNER_UNEXPECTED_EOFUnexpected EOF encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_OCTAL_FORMAT
static final int SCANNER_BAD_OCTAL_FORMATBad octal encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_DECIMAL_FORMAT
static final int SCANNER_BAD_DECIMAL_FORMATBad decimal encountered by Scanner. Required attributes: none.- See Also:
-
SCANNER_ASSIGNMENT_NOT_ALLOWED
static final int SCANNER_ASSIGNMENT_NOT_ALLOWEDAssignment '=' encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_DIVIDE_BY_ZERO
static final int SCANNER_DIVIDE_BY_ZERODivision by 0 encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_MISSING_R_PAREN
static final int SCANNER_MISSING_R_PARENMissing ')' encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_EXPRESSION_SYNTAX_ERROR
static final int SCANNER_EXPRESSION_SYNTAX_ERRORExpression syntax error encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_ILLEGAL_IDENTIFIER
static final int SCANNER_ILLEGAL_IDENTIFIERExpression syntax error encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_CONDITIONAL_EXPRESSION
static final int SCANNER_BAD_CONDITIONAL_EXPRESSIONDivision by 0 encountered in macro by Scanner. Required attributes: none.- See Also:
-
SCANNER_BAD_BINARY_FORMAT
static final int SCANNER_BAD_BINARY_FORMATBad binary encountered by Scanner. Required attributes: none.- Since:
- 5.1
- See Also:
-
SCANNER_CONSTANT_WITH_BAD_SUFFIX
static final int SCANNER_CONSTANT_WITH_BAD_SUFFIXInvalid suffix on constant- Since:
- 5.11
- See Also:
-
SCANNER_FLOAT_WITH_BAD_PREFIX
static final int SCANNER_FLOAT_WITH_BAD_PREFIXInvalid prefix on float- Since:
- 5.11
- See Also:
-
PREPROCESSOR_POUND_ERROR
static final int PREPROCESSOR_POUND_ERROR#error encountered by Preprocessor. Required attributes: A_PREPROC_POUND_ERROR- See Also:
-
PREPROCESSOR_INCLUSION_NOT_FOUND
static final int PREPROCESSOR_INCLUSION_NOT_FOUNDInclusion not found by Preprocessor. Required attributes: A_PREPROC_INCLUDE_FILENAME -
PREPROCESSOR_DEFINITION_NOT_FOUND
static final int PREPROCESSOR_DEFINITION_NOT_FOUNDMacro definition not found by Preprocessor. Required attributes: A_PREPROC_MACRO_NAME- See Also:
-
PREPROCESSOR_UNBALANCE_CONDITION
static final int PREPROCESSOR_UNBALANCE_CONDITIONPreprocessor conditionals seem unbalanced. Required attributes: A_PREPROC_CONDITIONAL_MISMATCH -
PREPROCESSOR_INVALID_MACRO_DEFN
static final int PREPROCESSOR_INVALID_MACRO_DEFNInvalid format to Macro definition. Required attributes: A_PREPROC_MACRO_NAME- See Also:
-
PREPROCESSOR_INVALID_DIRECTIVE
static final int PREPROCESSOR_INVALID_DIRECTIVEInvalid or unknown preprocessor directive encountered by Preprocessor. Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE -
PREPROCESSOR_INVALID_MACRO_REDEFN
static final int PREPROCESSOR_INVALID_MACRO_REDEFNInvalid macro redefinition encountered by Preprocessor. Required attributes: A_PREPROC_MACRO_NAME- See Also:
-
PREPROCESSOR_CONDITIONAL_EVAL_ERROR
static final int PREPROCESSOR_CONDITIONAL_EVAL_ERRORPreprocessor Conditional cannot not be evaluated due. Required attributes: A_PREPROC_CONDITION- See Also:
-
PREPROCESSOR_MACRO_USAGE_ERROR
static final int PREPROCESSOR_MACRO_USAGE_ERRORInvalid macro usage encountered by Preprocessor. Required attributes: A_PREPROC_MACRO_NAME- See Also:
-
PREPROCESSOR_MACRO_PASTING_ERROR
static final int PREPROCESSOR_MACRO_PASTING_ERRORInvalid Macro Pasting encountered by Preprocessor. Required attributes: A_PREPROC_MACRO_NAME- See Also:
-
PREPROCESSOR_CIRCULAR_INCLUSION
static final int PREPROCESSOR_CIRCULAR_INCLUSIONCircular inclusion encountered by Preprocessor. Required attributes: A_PREPROC_INCLUDE_FILENAME -
PREPROCESSOR_MISSING_RPAREN_PARMLIST
static final int PREPROCESSOR_MISSING_RPAREN_PARMLISTmacro argument "..." encountered without the required ')' i.e. must be last argument if used Required attributes: none- See Also:
-
PREPROCESSOR_INVALID_VA_ARGS
static final int PREPROCESSOR_INVALID_VA_ARGS__VA_ARGS__ encountered in macro definition without the required '...' parameter Required attributes: none- See Also:
-
PREPROCESSOR_POUND_WARNING
static final int PREPROCESSOR_POUND_WARNING#warning encountered by Preprocessor. Required attributes: A_PREPROC_POUND_WARNING- See Also:
-
PREPROCESSOR_EXCEEDS_MAXIMUM_INCLUSION_DEPTH
static final int PREPROCESSOR_EXCEEDS_MAXIMUM_INCLUSION_DEPTHMaximum inclusion depth is exceeded- Since:
- 5.4
- See Also:
-
PREPROCESSOR_MULTIPLE_USER_DEFINED_SUFFIXES_IN_CONCATENATION
static final int PREPROCESSOR_MULTIPLE_USER_DEFINED_SUFFIXES_IN_CONCATENATIONDuring concatenation of string literals, at least two were found with more than one type of UDL suffix.- Since:
- 5.11
- See Also:
-
PREPROCESSOR_INVALID_USE_OUTSIDE_PREPROCESSOR_DIRECTIVE
static final int PREPROCESSOR_INVALID_USE_OUTSIDE_PREPROCESSOR_DIRECTIVE- Since:
- 7.1
- See Also:
-
SYNTAX_ERROR
static final int SYNTAX_ERROR- See Also:
-
MISSING_SEMICOLON
static final int MISSING_SEMICOLONMissing semicolon.- Since:
- 5.3
- See Also:
-
TEMPLATE_ARGUMENT_NESTING_DEPTH_LIMIT_EXCEEDED
static final int TEMPLATE_ARGUMENT_NESTING_DEPTH_LIMIT_EXCEEDEDThe parser's template argument nesting depth limit was exceeded.- Since:
- 6.4
- See Also:
-
SEMANTICS_RELATED
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_POUND_ERROR
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_POUND_WARNING
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_INCLUDE_FILENAME
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_MACRO_NAME
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_CONDITION
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_UNKNOWN_DIRECTIVE
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_PREPROC_CONDITIONAL_MISMATCH
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_SCANNER_BADCHAR
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_SYMBOL_NAME
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_NAMESPACE_NAME
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
A_TYPE_NAME
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
FILENAME_NOT_PROVIDED
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_UNIQUE_NAME_PREDEFINED
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_NAME_NOT_FOUND
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_NAME_NOT_PROVIDED
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_OVERLOAD
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_USING
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_AMBIGUOUS_LOOKUP
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_TYPE
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_CIRCULAR_INHERITANCE
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_TEMPLATE
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_BAD_VISIBILITY
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_UNABLE_TO_RESOLVE_FUNCTION
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_TEMPLATE_ARGUMENT
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_TEMPLATE_PARAMETER
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_REDECLARED_TEMPLATE_PARAMETER
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_INVALID_CONVERSION_TYPE
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_MALFORMED_EXPRESSION
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_ILLFORMED_FRIEND
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
SEMANTIC_RECURSIVE_TEMPLATE_INSTANTIATION
Deprecated.Not used.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
-
Method Details
-
getID
int getID()Returns the problem id -
getMessage
String getMessage()Returns a human-readable message describing the problem. -
getMessageWithLocation
String getMessageWithLocation()Returns a human-readable message string describing the problem, adding location information. -
getArguments
String[] getArguments()Returns a possibly empty argument array to compute the message. -
getOriginatingFileName
char[] getOriginatingFileName()Returns the file name in which the problem was found -
getSourceStart
int getSourceStart()Returns the start position of the problem (inclusive), orINT_VALUE_NOT_PROVIDED
if unknown. -
getSourceEnd
int getSourceEnd()Returns the end position of the problem (inclusive), orINT_VALUE_NOT_PROVIDED
if unknown. -
getSourceLineNumber
int getSourceLineNumber()Returns the line number where the problem begins, orINT_VALUE_NOT_PROVIDED
if unknown. -
isError
boolean isError()Returns whether the problem is an error. -
isWarning
boolean isWarning()Returns whether the problem is a warning. -
checkCategory
boolean checkCategory(int bitmask) Check the parameter bit-mask against an IProblem's ID to broadly segregate the types of problems.- Parameters:
bitmask
-- Returns:
- true if ( (id & bit-mask ) != 0 )
-