1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Some further DOM updates.

This commit is contained in:
John Camelon 2004-12-10 03:42:44 +00:00
parent 61c0dd0e48
commit 9508bc314e
5 changed files with 103 additions and 15 deletions

View file

@ -16,6 +16,7 @@ import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.core.dom.CDOM;
import org.eclipse.cdt.core.filetype.ICFileType;
import org.eclipse.cdt.core.filetype.ICFileTypeResolver;
import org.eclipse.cdt.core.filetype.IResolverModel;
@ -902,5 +903,10 @@ public class CCorePlugin extends Plugin {
return getPluginPreferences().getBoolean(PREF_USE_STRUCTURAL_PARSE_MODE);
}
public CDOM getDOM()
{
return CDOM.getInstance();
}
}

View file

@ -9,8 +9,7 @@
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.cdt.core.dom;
import org.eclipse.cdt.core.dom.IASTServiceProvider;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.dom.ast.IASTLocationFactory;
import org.eclipse.cdt.internal.core.dom.InternalASTServiceProvider;
import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
@ -22,8 +21,6 @@ import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
*/
public class CDOM {
private CDOM()
{
}
@ -91,4 +88,9 @@ public class CDOM {
return null;
}
public IASTLocationFactory getLocationFactory()
{
return new EclipseLocationFactory();
}
}

View file

@ -0,0 +1,56 @@
/**********************************************************************
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.cdt.core.dom;
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTLocationFactory;
import org.eclipse.cdt.core.dom.ast.IASTResourceLocation;
import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.internal.core.dom.parser.location.ASTFileLocation;
import org.eclipse.core.resources.IResource;
/**
* @author jcamelon
*/
public class EclipseLocationFactory implements IASTLocationFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTLocationFactory#createUnresolvedFileLocation(java.lang.String, int, int)
*/
public IASTFileLocation createUnresolvedFileLocation(String path,
int offset, int length) {
IASTFileLocation result = new ASTFileLocation();
result.setResolved(false);
result.setNodeOffset( offset );
result.setNodeLength( length );
result.setFileName( path );
return result;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTLocationFactory#createUnresolvedResourceLocation(org.eclipse.core.resources.IResource, int, int)
*/
public IASTResourceLocation createUnresolvedResourceLocation(
IResource resource, int offset, int length) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTLocationFactory#createUnresolvedWorkingCopyLocation(org.eclipse.cdt.core.model.IWorkingCopy, int, int)
*/
public IASTResourceLocation createUnresolvedWorkingCopyLocation(
IWorkingCopy workingCopy, int offset, int length) {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,24 @@
/**********************************************************************
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.core.resources.IResource;
/**
* @author jcamelon
*/
public interface IASTLocationFactory {
public IASTFileLocation createUnresolvedFileLocation( String path, int offset, int length );
public IASTResourceLocation createUnresolvedResourceLocation( IResource resource, int offset, int length );
public IASTResourceLocation createUnresolvedWorkingCopyLocation( IWorkingCopy workingCopy, int offset, int length );
}

View file

@ -32,17 +32,17 @@ import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.ParserUtil;
import org.eclipse.cdt.core.parser.ScannerInfo;
import org.eclipse.cdt.internal.core.parser2.IProblemRequestor;
import org.eclipse.cdt.internal.core.parser2.IRequiresLocationInformation;
import org.eclipse.cdt.internal.core.parser2.ISourceCodeParser;
import org.eclipse.cdt.internal.core.parser2.c.ANSICParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.parser2.c.GCCParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.parser2.c.GNUCSourceParser;
import org.eclipse.cdt.internal.core.parser2.c.ICParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.parser2.cpp.ANSICPPParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.parser2.cpp.GNUCPPParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.parser2.cpp.GNUCPPSourceParser;
import org.eclipse.cdt.internal.core.parser2.cpp.ICPPParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.IProblemRequestor;
import org.eclipse.cdt.internal.core.dom.parser.IRequiresLocationInformation;
import org.eclipse.cdt.internal.core.dom.parser.ISourceCodeParser;
import org.eclipse.cdt.internal.core.dom.parser.c.ANSICParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.c.GCCParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.c.GNUCSourceParser;
import org.eclipse.cdt.internal.core.dom.parser.c.ICParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ANSICPPParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.cpp.GNUCPPParserExtensionConfiguration;
import org.eclipse.cdt.internal.core.dom.parser.cpp.GNUCPPSourceParser;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPParserExtensionConfiguration;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;