Package org.eclipse.cdt.core.model
Interface ILanguage
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
- All Known Implementing Classes:
AbstractCLikeLanguage
,AbstractLanguage
,AssemblyLanguage
,GCCLanguage
,GPPLanguage
public interface ILanguage
extends org.eclipse.core.runtime.IAdaptable
Models differences between languages. The interface is not supposed to be implemented directly.
Rather than that clients may subclass
AbstractLanguage
.- 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 int
Deprecated.Has no effect.static final int
Deprecated.Has no effect.static final int
Option forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Performance optimization, allows the parser not to create image-locations.static final int
Option forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Instructs the parser to create ast nodes for inactive code branches, if possible.static final int
Option forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Instructs the parser to skip function and method bodies.static final int
Option forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Allows the parser not to create ast nodes for expressions within aggregate initializers when they do not contain names. -
Method Summary
Modifier and TypeMethodDescriptionUsed to override the default model building behavior for a translation unit.getASTTranslationUnit
(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) getASTTranslationUnit
(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) getASTTranslationUnit
(FileContent content, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) Constructs an AST for the source code provided byreader
.getCompletionNode
(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) getCompletionNode
(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset) Returns the AST completion node for the given offset.getId()
Return the language id for this language.int
Return the id of the linkage this language contributes to.getName()
Returns the human readable name corresponding to this language, suitable for display.IASTName[]
getSelectedNames
(IASTTranslationUnit ast, int start, int length) Deprecated.replaced byIASTTranslationUnit.getNodeSelector(String)
.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Field Details
-
OPTION_SKIP_FUNCTION_BODIES
static final int OPTION_SKIP_FUNCTION_BODIESOption forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Instructs the parser to skip function and method bodies.- See Also:
-
OPTION_ADD_COMMENTS
Deprecated.Has no effect.- See Also:
- Restriction:
- This field is not intended to be referenced by clients.
-
OPTION_NO_IMAGE_LOCATIONS
static final int OPTION_NO_IMAGE_LOCATIONSOption forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Performance optimization, allows the parser not to create image-locations. When using this optionIASTName.getImageLocation()
will always returnnull
.- See Also:
-
OPTION_IS_SOURCE_UNIT
Deprecated.Has no effect.- See Also:
-
OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS
static final int OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERSOption forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Allows the parser not to create ast nodes for expressions within aggregate initializers when they do not contain names.- Since:
- 5.1
- See Also:
-
OPTION_PARSE_INACTIVE_CODE
static final int OPTION_PARSE_INACTIVE_CODEOption forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Instructs the parser to create ast nodes for inactive code branches, if possible. The parser makes its best effort to create ast for the inactive code branches but may decide to skip parts of the inactive code (e.g. function bodies, entire code branches, etc.).The inactive nodes can be accessed via
IASTDeclarationListOwner.getDeclarations(boolean)
or by using a visitor withASTVisitor.includeInactiveNodes
set totrue
.- Since:
- 5.1
- See Also:
-
-
Method Details
-
getId
String getId()Return the language id for this language. This is to differentiate languages from each other. -
getLinkageID
int getLinkageID()Return the id of the linkage this language contributes to. This is especially important for languages that write to the index.- Since:
- 5.0
- See Also:
-
getName
String getName()Returns the human readable name corresponding to this language, suitable for display.- Since:
- 4.0
-
getASTTranslationUnit
IASTTranslationUnit getASTTranslationUnit(FileContent content, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws org.eclipse.core.runtime.CoreException Constructs an AST for the source code provided byreader
.- Parameters:
content
- source code to be parsed.scanInfo
- provides include paths and defined symbols.fileCreator
- factory that provides file content for files includedindex
- (optional) index to use to lookup symbols external to the translation unit.options
- A combination ofOPTION_SKIP_FUNCTION_BODIES
,OPTION_NO_IMAGE_LOCATIONS
, or0
.log
- logger- Returns:
- an AST for the source code provided by reader.
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 5.2
-
getCompletionNode
IASTCompletionNode getCompletionNode(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset) throws org.eclipse.core.runtime.CoreException Returns the AST completion node for the given offset.- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 5.2
-
createModelBuilder
Used to override the default model building behavior for a translation unit.- Parameters:
tu
- theITranslationUnit
to be parsed (non-null
)- Returns:
- an
IModelBuilder
, which parses the given translation unit and returns theICElement
s of its model, ornull
to parse using the default CDT model builder
-
getSelectedNames
Deprecated.replaced byIASTTranslationUnit.getNodeSelector(String)
.- Restriction:
- This method is not intended to be referenced by clients.
-
getASTTranslationUnit
@Deprecated IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) throws org.eclipse.core.runtime.CoreException Deprecated.- Throws:
org.eclipse.core.runtime.CoreException
- Restriction:
- This method is not intended to be referenced by clients.
-
getASTTranslationUnit
@Deprecated IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log) throws org.eclipse.core.runtime.CoreException Deprecated.- Throws:
org.eclipse.core.runtime.CoreException
- Restriction:
- This method is not intended to be referenced by clients.
-
getCompletionNode
@Deprecated IASTCompletionNode getCompletionNode(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws org.eclipse.core.runtime.CoreException Deprecated.- Throws:
org.eclipse.core.runtime.CoreException
- Restriction:
- This method is not intended to be referenced by clients.
-