public interface ITokenElementContext
Modifier and Type | Method and Description |
---|---|
default java.util.List<IToken> |
calculateLocalPreprocessedTokens(java.util.List<IToken> tokens)
Calculates the pre-processed tokens (no global include resolution).
|
java.util.List<ShallowEntity> |
getAbstractSyntaxTree(ECodeViewOption view)
Returns the abstract syntax tree of the analyzed token element as list of
shallow entities based on the given view.
|
ClangTranslationUnitWrapper |
getClangTranslationUnitWrapper()
Returns a
ClangTranslationUnitWrapper containing the initialized JNI
interface to Clang for the current file. |
ELanguage |
getLanguage()
Returns the language of the analyzed token element.
|
ShallowEntity |
getRootEntity(ECodeViewOption view)
Returns the synthetic root entity of the abstract syntax tree based on the
given view.
|
java.lang.String |
getTextContent(ECodeViewOption.ETextViewOption view)
Returns the text content in the given view.
|
java.util.List<IToken> |
getTokens(ECodeViewOption view)
Returns the tokens in the given view.
|
ITypeResolution |
getTypeResolution(ECodeViewOption view)
Returns a type resolution, which contains information about known variables
and their types.
|
java.lang.String |
getUniformPath()
Returns the uniform path of the analyzed token element.
|
ELanguage getLanguage()
java.lang.String getUniformPath()
java.util.List<IToken> getTokens(ECodeViewOption view) throws CheckException
ECheckParameter.ABSTRACT_SYNTAX_TREE
parameter.CheckException
java.lang.String getTextContent(ECodeViewOption.ETextViewOption view) throws CheckException
ECodeViewOption.ETextViewOption.FILTERED_CONTENT
, as usually
no findings shall be generated for filtered code.CheckException
ShallowEntity getRootEntity(ECodeViewOption view) throws CheckException
This method can be used, if the executing check requests the
ECheckParameter.ABSTRACT_SYNTAX_TREE
parameter.
CheckException
java.util.List<ShallowEntity> getAbstractSyntaxTree(ECodeViewOption view) throws CheckException
This method can be used, if the executing check requests the
ECheckParameter.ABSTRACT_SYNTAX_TREE
parameter.
CheckException
ITypeResolution getTypeResolution(ECodeViewOption view) throws CheckException
ECheckParameter.TYPE_RESOLUTION
parameter. Based on the given
ECodeViewOption
.CheckException
default java.util.List<IToken> calculateLocalPreprocessedTokens(java.util.List<IToken> tokens)
ClangTranslationUnitWrapper getClangTranslationUnitWrapper()
ClangTranslationUnitWrapper
containing the initialized JNI
interface to Clang for the current file. To access this, specify the
ECheckParameter.CLANG
option in the custom check.