Eclipse CDT
Pre-release 3.0

org.eclipse.cdt.core.model
Class AbstractLanguage

java.lang.Object
  extended byPlatformObject
      extended byorg.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.
 
Fields inherited from interface org.eclipse.cdt.core.model.ILanguage
AST_SKIP_ALL_HEADERS, AST_SKIP_IF_NO_BUILD_INFO, AST_SKIP_INDEXED_HEADERS, AST_USE_INDEX, KEY
 
Constructor Summary
AbstractLanguage()
           
 
Method Summary
 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)
          Construct an AST for the source code provided by reader.
 IASTTranslationUnit getASTTranslationUnit(ITranslationUnit file, org.eclipse.cdt.core.dom.ICodeReaderFactory codeReaderFactory, int style)
           
 IASTTranslationUnit getASTTranslationUnit(ITranslationUnit file, int style)
           
 String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.cdt.core.model.ILanguage
createModelBuilder, getASTTranslationUnit, getCompletionNode, getId, getSelectedNames
 

Field Detail

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
Constructor Detail

AbstractLanguage

public AbstractLanguage()
Method Detail

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

Eclipse CDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2004. All Rights Reserved.