org.eclipse.cdt.core.model

## Interface ILanguage

All Known Implementing Classes:
  org.eclipse.cdt.core.dom.parser.AbstractCLikeLanguage, AbstractLanguage, AssemblyLanguage, GCCLanguage, GPPLanguage

    public interface ILanguage

Models differences between languages. The interface is not supposed to be implemented directly. Rather than that clients may subclass `AbstractLanguage`.

### Field Summary

Fields
`static int` `OPTION_ADD_COMMENTS` Deprecated.
`static int` `OPTION_IS_SOURCE_UNIT` Deprecated.
`static int` `OPTION_NO_IMAGE_LOCATIONS` Option for `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)` Performance optimization, allows the parser not to create image-locations.
`static int` `OPTION_PARSE_INACTIVE_CODE` Option for `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)` Instructs the parser to create ast nodes for inactive code branches, if possible.
`static int` `OPTION_SKIP_FUNCTION_BODIES` Option for `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)` Instructs the parser to skip function and method bodies.
`static int` `OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS` Option for `getASTTranslationUnit(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

All Methods Instance Methods Abstract Methods Deprecated Methods
`IContributedModelBuilder` `createModelBuilder(ITranslationUnit tu)` Used to override the default model building behavior for a translation unit.

`IASTTranslationUnit`

`getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, org.eclipse.cdt.core.parser.IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, org.eclipse.cdt.core.index.IIndex index, int options, org.eclipse.cdt.core.parser.IParserLogService log)`
Deprecated.
replaced by `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)`

`IASTTranslationUnit`

`getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader, org.eclipse.cdt.core.parser.IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, org.eclipse.cdt.core.index.IIndex index, org.eclipse.cdt.core.parser.IParserLogService log)`
Deprecated.
replaced by `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)`

`IASTTranslationUnit` `getASTTranslationUnit(org.eclipse.cdt.core.parser.FileContent content, org.eclipse.cdt.core.parser.IScannerInfo scanInfo, org.eclipse.cdt.core.parser.IncludeFileContentProvider fileCreator, org.eclipse.cdt.core.index.IIndex index, int options, org.eclipse.cdt.core.parser.IParserLogService log)` Constructs an AST for the source code provided by `reader`.

`IASTCompletionNode`

`getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader, org.eclipse.cdt.core.parser.IScannerInfo scanInfo, org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator, org.eclipse.cdt.core.index.IIndex index, org.eclipse.cdt.core.parser.IParserLogService log, int offset)`
Deprecated.
replaced by `getCompletionNode(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, IParserLogService, int)`.

`IASTCompletionNode` `getCompletionNode(org.eclipse.cdt.core.parser.FileContent reader, org.eclipse.cdt.core.parser.IScannerInfo scanInfo, org.eclipse.cdt.core.parser.IncludeFileContentProvider fileCreator, org.eclipse.cdt.core.index.IIndex index, org.eclipse.cdt.core.parser.IParserLogService log, int offset)` Returns the AST completion node for the given offset.
`java.lang.String` `getId()` Return the language id for this language.
`int` `getLinkageID()` Return the id of the linkage this language contributes to.
`java.lang.String` `getName()` Returns the human readable name corresponding to this language, suitable for display.
`IASTName[]` `getSelectedNames(IASTTranslationUnit ast, int start, int length)` Deprecated. replaced by `IASTTranslationUnit.getNodeSelector(String)`.

### Field Detail

#### OPTION_SKIP_FUNCTION_BODIES

    static final int OPTION_SKIP_FUNCTION_BODIES

Option for `getASTTranslationUnit(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.

See Also:
  Constant Field Values

#### OPTION_NO_IMAGE_LOCATIONS

    static final int OPTION_NO_IMAGE_LOCATIONS

Option for `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)` Performance optimization, allows the parser not to create image-locations. When using this option `IASTName.getImageLocation()` will always return `null`.

See Also:
  Constant Field Values

#### OPTION_IS_SOURCE_UNIT

    @Deprecated
    static final int OPTION_IS_SOURCE_UNIT

Deprecated.

See Also:
  Constant Field Values

#### OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS

    static final int OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS

Option for `getASTTranslationUnit(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 for `getASTTranslationUnit(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 with `ASTVisitor.includeInactiveNodes` set to `true`.

Since:
  5.1
See Also:
  Constant Field Values

### Method Detail

#### getId

    java.lang.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

    java.lang.String getName()

Returns the human readable name corresponding to this language, suitable for display.

Since:
  4.0

#### getASTTranslationUnit

    IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.FileContent content,
                                              org.eclipse.cdt.core.parser.IScannerInfo scanInfo,
                                              org.eclipse.cdt.core.parser.IncludeFileContentProvider fileCreator,
                                              org.eclipse.cdt.core.index.IIndex index,
                                              int options,
                                              org.eclipse.cdt.core.parser.IParserLogService log)
                                       throws CoreException

Constructs an AST for the source code provided by `reader`.

Parameters:
  `content` - source code to be parsed.
  `scanInfo` - provides include paths and defined symbols.
  `fileCreator` - factory that provides file content for files included
  `index` - (optional) index to use to lookup symbols external to the translation unit.
  `options` - A combination of `OPTION_SKIP_FUNCTION_BODIES`, `OPTION_NO_IMAGE_LOCATIONS`, or `0`.
  `log` - logger
Returns:
  an AST for the source code provided by reader.
Throws:
  `CoreException`
Since:
  5.2

#### getCompletionNode

    IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.FileContent reader,
                                         org.eclipse.cdt.core.parser.IScannerInfo scanInfo,
                                         org.eclipse.cdt.core.parser.IncludeFileContentProvider fileCreator,
                                         org.eclipse.cdt.core.index.IIndex index,
                                         org.eclipse.cdt.core.parser.IParserLogService log,
                                         int offset)
                                  throws CoreException

Returns the AST completion node for the given offset.

Throws:
  `CoreException`
Since:
  5.2

#### createModelBuilder

    IContributedModelBuilder createModelBuilder(ITranslationUnit tu)

Used to override the default model building behavior for a translation unit.

Parameters:
  `tu` - the `ITranslationUnit` to be parsed (non-`null`)
Returns:
  an `IModelBuilder`, which parses the given translation unit and returns the `ICElement`s of its model, or `null` to parse using the default CDT model builder

#### getSelectedNames

    @Deprecated
    IASTName[] getSelectedNames(IASTTranslationUnit ast,
                                            int start,
                                            int length)

Deprecated. replaced by `IASTTranslationUnit.getNodeSelector(String)`.

#### getASTTranslationUnit

    @Deprecated
    IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
                                                          org.eclipse.cdt.core.parser.IScannerInfo scanInfo,
                                                          org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator,
                                                          org.eclipse.cdt.core.index.IIndex index,
                                                          org.eclipse.cdt.core.parser.IParserLogService log)
                                                   throws CoreException

Deprecated. replaced by `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)`

Throws:
  `CoreException`

#### getASTTranslationUnit

    @Deprecated
    IASTTranslationUnit getASTTranslationUnit(org.eclipse.cdt.core.parser.CodeReader reader,
                                                          org.eclipse.cdt.core.parser.IScannerInfo scanInfo,
                                                          org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator,
                                                          org.eclipse.cdt.core.index.IIndex index,
                                                          int options,
                                                          org.eclipse.cdt.core.parser.IParserLogService log)
                                                   throws CoreException

Deprecated. replaced by `getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)`

Throws:
  `CoreException`

#### getCompletionNode

    @Deprecated
    IASTCompletionNode getCompletionNode(org.eclipse.cdt.core.parser.CodeReader reader,
                                                     org.eclipse.cdt.core.parser.IScannerInfo scanInfo,
                                                     org.eclipse.cdt.core.dom.ICodeReaderFactory fileCreator,
                                                     org.eclipse.cdt.core.index.IIndex index,
                                                     org.eclipse.cdt.core.parser.IParserLogService log,
                                                     int offset)
                                              throws CoreException

Deprecated. replaced by `getCompletionNode(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, IParserLogService, int)`.

Throws:
  `CoreException`