public abstract class AbstractCLikeLanguage extends AbstractLanguage implements ICLanguageKeywords
getScannerExtensionConfiguration(IScannerInfo info)
,
getParserLanguage()
and
createParser(IScanner scanner, ParserMode parserMode,
IParserLogService logService, IIndex index)
.AbstractScannerExtensionConfiguration
OPTION_ADD_COMMENTS, OPTION_IS_SOURCE_UNIT, OPTION_NO_IMAGE_LOCATIONS, OPTION_PARSE_INACTIVE_CODE, OPTION_SKIP_FUNCTION_BODIES, OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS
Constructor and Description |
---|
AbstractCLikeLanguage() |
Modifier and Type | Method and Description |
---|---|
IContributedModelBuilder |
createModelBuilder(ITranslationUnit tu)
Used to override the default model building behavior for a translation unit.
|
protected ISourceCodeParser |
createParser(IScanner scanner,
IParserLogService log,
IIndex index,
boolean forCompletion,
int options)
Creates the parser.
|
protected ISourceCodeParser |
createParser(IScanner scanner,
IParserLogService log,
IIndex index,
boolean forCompletion,
int options,
IParserSettings settings)
Create the parser with additional settings.
|
protected abstract ISourceCodeParser |
createParser(IScanner scanner,
ParserMode parserMode,
IParserLogService logService,
IIndex index) |
protected ISourceCodeParser |
createParser(IScanner scanner,
ParserMode parserMode,
IParserLogService logService,
IIndex index,
int options,
IParserSettings settings) |
protected IScanner |
createScanner(CodeReader reader,
IScannerInfo scanInfo,
ICodeReaderFactory fileCreator,
IParserLogService log)
Deprecated.
|
protected IScanner |
createScanner(FileContent content,
IScannerInfo scanInfo,
IncludeFileContentProvider fcp,
IParserLogService log)
Create the scanner to be used with the parser.
|
<T> T |
getAdapter(Class<T> adapter) |
IASTTranslationUnit |
getASTTranslationUnit(CodeReader reader,
IScannerInfo scanInfo,
ICodeReaderFactory codeReaderFactory,
IIndex index,
int options,
IParserLogService log)
Deprecated.
|
IASTTranslationUnit |
getASTTranslationUnit(CodeReader reader,
IScannerInfo scanInfo,
ICodeReaderFactory fileCreator,
IIndex index,
IParserLogService log)
Deprecated.
|
IASTTranslationUnit |
getASTTranslationUnit(FileContent reader,
IScannerInfo scanInfo,
IncludeFileContentProvider fileCreator,
IIndex index,
int options,
IParserLogService log)
Constructs an AST for the source code provided by
reader . |
String[] |
getBuiltinTypes()
Returns the built-in type names defined for this language.
|
IASTCompletionNode |
getCompletionNode(CodeReader reader,
IScannerInfo scanInfo,
ICodeReaderFactory fileCreator,
IIndex index,
IParserLogService log,
int offset)
Deprecated.
|
IASTCompletionNode |
getCompletionNode(FileContent reader,
IScannerInfo scanInfo,
IncludeFileContentProvider fileCreator,
IIndex index,
IParserLogService log,
int offset)
Returns the AST completion node for the given offset.
|
String[] |
getKeywords()
Returns the keywords defined for this language, excluding built-in types.
|
protected abstract ParserLanguage |
getParserLanguage() |
String[] |
getPreprocessorKeywords()
Returns the preprocessor keywords (directives) defined for this language.
|
protected IScannerExtensionConfiguration |
getScannerExtensionConfiguration()
Deprecated.
Do not override this method.
Override
getScannerExtensionConfiguration(IScannerInfo) instead. |
protected IScannerExtensionConfiguration |
getScannerExtensionConfiguration(IScannerInfo info) |
IASTName[] |
getSelectedNames(IASTTranslationUnit ast,
int start,
int length)
Deprecated.
|
getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, getLinkageID
@Deprecated protected IScannerExtensionConfiguration getScannerExtensionConfiguration()
getScannerExtensionConfiguration(IScannerInfo)
instead.protected IScannerExtensionConfiguration getScannerExtensionConfiguration(IScannerInfo info)
null
.protected abstract ISourceCodeParser createParser(IScanner scanner, ParserMode parserMode, IParserLogService logService, IIndex index)
protected ISourceCodeParser createParser(IScanner scanner, ParserMode parserMode, IParserLogService logService, IIndex index, int options, IParserSettings settings)
protected abstract ParserLanguage getParserLanguage()
@Deprecated public IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log) throws org.eclipse.core.runtime.CoreException
getASTTranslationUnit
in interface ILanguage
org.eclipse.core.runtime.CoreException
@Deprecated public IASTTranslationUnit getASTTranslationUnit(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory codeReaderFactory, IIndex index, int options, IParserLogService log) throws org.eclipse.core.runtime.CoreException
getASTTranslationUnit
in interface ILanguage
getASTTranslationUnit
in class AbstractLanguage
org.eclipse.core.runtime.CoreException
public IASTTranslationUnit getASTTranslationUnit(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws org.eclipse.core.runtime.CoreException
ILanguage
reader
.getASTTranslationUnit
in interface ILanguage
getASTTranslationUnit
in class AbstractLanguage
reader
- 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 of ILanguage.OPTION_SKIP_FUNCTION_BODIES
,
ILanguage.OPTION_NO_IMAGE_LOCATIONS
, or 0
.log
- loggerorg.eclipse.core.runtime.CoreException
@Deprecated public IASTCompletionNode getCompletionNode(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws org.eclipse.core.runtime.CoreException
getCompletionNode
in interface ILanguage
org.eclipse.core.runtime.CoreException
public IASTCompletionNode getCompletionNode(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset) throws org.eclipse.core.runtime.CoreException
ILanguage
getCompletionNode
in interface ILanguage
getCompletionNode
in class AbstractLanguage
org.eclipse.core.runtime.CoreException
protected ISourceCodeParser createParser(IScanner scanner, IParserLogService log, IIndex index, boolean forCompletion, int options)
scanner
- the IScanner to get tokens fromlog
- the parser log serviceindex
- the index to help resolve bindingsforCompletion
- whether the parser is used for code completionoptions
- for valid options see
AbstractLanguage.getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
protected ISourceCodeParser createParser(IScanner scanner, IParserLogService log, IIndex index, boolean forCompletion, int options, IParserSettings settings)
scanner
- the IScanner to get tokens fromlog
- the parser log serviceindex
- the index to help resolve bindingsforCompletion
- whether the parser is used for code completionoptions
- for valid options see
AbstractLanguage.getASTTranslationUnit(FileContent, IScannerInfo, IncludeFileContentProvider, IIndex, int, IParserLogService)
settings
- for the parser@Deprecated protected IScanner createScanner(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IParserLogService log)
createScanner(FileContent, IScannerInfo, IncludeFileContentProvider, IParserLogService)
protected IScanner createScanner(FileContent content, IScannerInfo scanInfo, IncludeFileContentProvider fcp, IParserLogService log)
@Deprecated public IASTName[] getSelectedNames(IASTTranslationUnit ast, int start, int length)
getSelectedNames
in interface ILanguage
public IContributedModelBuilder createModelBuilder(ITranslationUnit tu)
ILanguage
createModelBuilder
in interface ILanguage
tu
- the ITranslationUnit
to be parsed (non-null
)IModelBuilder
, which parses the given translation unit and
returns the ICElement
s of its model, or null
to parse using the default CDT model builderpublic <T> T getAdapter(Class<T> adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in class org.eclipse.core.runtime.PlatformObject
public String[] getBuiltinTypes()
ICLanguageKeywords
getBuiltinTypes
in interface ICLanguageKeywords
null
public String[] getKeywords()
ICLanguageKeywords
getKeywords
in interface ICLanguageKeywords
null
public String[] getPreprocessorKeywords()
ICLanguageKeywords
getPreprocessorKeywords
in interface ICLanguageKeywords
null
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.