public abstract class AbstractCLikeLanguage extends AbstractLanguage implements ICLanguageKeywords
getScannerExtensionConfiguration(IScannerInfo info),
getParserLanguage() and
createParser(IScanner scanner, ParserMode parserMode,
IParserLogService logService, IIndex index).AbstractScannerExtensionConfigurationOPTION_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.
|
getNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId, 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 ILanguageorg.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 ILanguagegetASTTranslationUnit in class AbstractLanguageorg.eclipse.core.runtime.CoreExceptionpublic IASTTranslationUnit getASTTranslationUnit(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws org.eclipse.core.runtime.CoreException
ILanguagereader.getASTTranslationUnit in interface ILanguagegetASTTranslationUnit in class AbstractLanguagereader - 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 ILanguageorg.eclipse.core.runtime.CoreExceptionpublic IASTCompletionNode getCompletionNode(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, IParserLogService log, int offset) throws org.eclipse.core.runtime.CoreException
ILanguagegetCompletionNode in interface ILanguagegetCompletionNode in class AbstractLanguageorg.eclipse.core.runtime.CoreExceptionprotected 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 ILanguagepublic IContributedModelBuilder createModelBuilder(ITranslationUnit tu)
ILanguagecreateModelBuilder in interface ILanguagetu - the ITranslationUnit to be parsed (non-null)IModelBuilder, which parses the given translation unit and
returns the ICElements 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.IAdaptablegetAdapter in class org.eclipse.core.runtime.PlatformObjectpublic String[] getBuiltinTypes()
ICLanguageKeywordsgetBuiltinTypes in interface ICLanguageKeywordsnullpublic String[] getKeywords()
ICLanguageKeywordsgetKeywords in interface ICLanguageKeywordsnullpublic String[] getPreprocessorKeywords()
ICLanguageKeywordsgetPreprocessorKeywords in interface ICLanguageKeywordsnullCopyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.