org.eclipse.cdt.core.model
Class AbstractLanguage
java.lang.Object
PlatformObject
org.eclipse.cdt.core.model.AbstractLanguage
- All Implemented Interfaces:
- ILanguage
- Direct Known Subclasses:
- org.eclipse.cdt.core.dom.parser.c.AbstractCLanguage, org.eclipse.cdt.core.dom.parser.cpp.AbstractCPPLanguage
- public abstract class AbstractLanguage
- extends PlatformObject
- implements ILanguage
Models the differences between various languages.
- Since:
- 4.0
- See Also:
- Serialized Form
Field Summary |
static int |
OPTION_ADD_COMMENTS
Option for getASTTranslationUnit(CodeReader, IScannerInfo, ICodeReaderFactory, IIndex, int, IParserLogService)
Instructs the parser to add comment nodes to the ast. |
static int |
OPTION_SKIP_FUNCTION_BODIES
Option for getASTTranslationUnit(CodeReader, IScannerInfo, ICodeReaderFactory, IIndex, int, IParserLogService)
Instructs the parser to skip function and method bodies. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OPTION_SKIP_FUNCTION_BODIES
public static final int OPTION_SKIP_FUNCTION_BODIES
- Option for
getASTTranslationUnit(CodeReader, IScannerInfo, ICodeReaderFactory, IIndex, int, IParserLogService)
Instructs the parser to skip function and method bodies.
- See Also:
- Constant Field Values
OPTION_ADD_COMMENTS
public static final int OPTION_ADD_COMMENTS
- Option for
getASTTranslationUnit(CodeReader, IScannerInfo, ICodeReaderFactory, IIndex, int, IParserLogService)
Instructs the parser to add comment nodes to the ast.
- See Also:
- Constant Field Values
AbstractLanguage
public AbstractLanguage()
getASTTranslationUnit
public final IASTTranslationUnit getASTTranslationUnit(ITranslationUnit file,
int style)
throws CoreException
- Specified by:
getASTTranslationUnit
in interface ILanguage
- Throws:
CoreException
getASTTranslationUnit
public final IASTTranslationUnit getASTTranslationUnit(ITranslationUnit file,
org.eclipse.cdt.core.dom.ICodeReaderFactory codeReaderFactory,
int style)
throws CoreException
- Specified by:
getASTTranslationUnit
in interface ILanguage
- Throws:
CoreException
getName
public String getName()
- Specified by:
getName
in interface ILanguage
- Returns:
- the human readable name corresponding to this language, suitable for display.
getASTTranslationUnit
public 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
- Construct an AST for the source code provided by
reader
.
As an option you can supply
- Parameters:
reader
- source code to be parsed.scanInfo
- provides include paths and defined symbols.fileCreator
- factory that provides CodeReaders for files included
by the source code being parsed.index
- (optional) index to use to provide support for ambiguity
resolution.options
- A combination of
OPTION_SKIP_FUNCTION_BODIES
and OPTION_ADD_COMMENTS
or 0
.log
- logger
- Returns:
- an AST for the source code provided by reader.
- Throws:
CoreException
Copyright (c) IBM Corp. and others 2004. All Rights Reserved.