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 subclassAbstractLanguage
.- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Field Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IContributedModelBuilder
createModelBuilder(ITranslationUnit tu)
Used to override the default model building behavior for a translation unit.IASTTranslationUnit
getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, int options, IParserLogService log)
IASTTranslationUnit
getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log)
IASTTranslationUnit
getASTTranslationUnit(FileContent content, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log)
Constructs an AST for the source code provided byreader
.IASTCompletionNode
getCompletionNode(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset)
IASTCompletionNode
getCompletionNode(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset)
Returns the AST completion node for the given offset.String
getId()
Return the language id for this language.int
getLinkageID()
Return the id of the linkage this language contributes to.String
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)
.
-
-
-
Field Detail
-
OPTION_SKIP_FUNCTION_BODIES
static final int OPTION_SKIP_FUNCTION_BODIES
Option forgetASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
Instructs the parser to skip function and method bodies.- See Also:
- Constant Field Values
-
OPTION_ADD_COMMENTS
@Deprecated static final int OPTION_ADD_COMMENTS
Deprecated.Has no effect.- See Also:
- Constant Field Values
- Restriction:
- This field is not intended to be referenced by clients.
-
OPTION_NO_IMAGE_LOCATIONS
static final int OPTION_NO_IMAGE_LOCATIONS
Option 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:
- Constant Field Values
-
OPTION_IS_SOURCE_UNIT
@Deprecated static final int OPTION_IS_SOURCE_UNIT
Deprecated.Has no effect.- See Also:
- Constant Field Values
-
OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS
static final int OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS
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.- Since:
- 5.1
- See Also:
- Constant Field Values
-
OPTION_PARSE_INACTIVE_CODE
static final int OPTION_PARSE_INACTIVE_CODE
Option 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:
- Constant Field Values
-
-
Method Detail
-
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:
ILinkage
-
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
IContributedModelBuilder createModelBuilder(ITranslationUnit tu)
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 IASTName[] getSelectedNames(IASTTranslationUnit ast, int start, int length)
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.
-
-