1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

Further stubbing out of the IASTNodeLocation related interfaces.

This commit is contained in:
John Camelon 2004-12-02 03:35:40 +00:00
parent 5d45047d01
commit d89f346613
9 changed files with 121 additions and 6 deletions

View file

@ -0,0 +1,20 @@
/**********************************************************************
* 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;
/**
* @author jcamelon
*/
public interface IASTFunctionStyleMacroDefinition extends IASTMacroDefinition {
public String [] getParameters();
public void addParameter( String parm );
}

View file

@ -15,6 +15,12 @@ package org.eclipse.cdt.core.dom.ast;
*
* @author Doug Schaefer
*/
public interface IASTMacroDefinition {
public interface IASTMacroDefinition extends IASTNode {
public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty( "Macro Name"); //$NON-NLS-1$
public IASTName getName();
public void setName( IASTName name );
public String getExpansion();
public void setExpansion( String exp );
}

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.core.dom.ast;
/**
* @author Doug Schaefer
*/
public interface IASTMacroExpansion {
public interface IASTMacroExpansion extends IASTNodeLocation {
/**
* The macro definition used for the expansion
@ -23,11 +23,11 @@ public interface IASTMacroExpansion {
public IASTMacroDefinition getMacroDefinition();
/**
* The source location for for the macro expansion. This is the location
* in the original source that expansion occured and was replaced.
* The source locations for for the macro expansion. These are the locations
* where the expansion in question occured and was replaced.
*
* @return
*/
public IASTNodeLocation getExpansionLocation();
public IASTNodeLocation[] getExpansionLocations();
}

View file

@ -19,6 +19,7 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTNode {
public IASTTranslationUnit getTranslationUnit();
public IASTNodeLocation[] getNodeLocations();
/**
* Get the parent node of this node in the tree.

View file

@ -0,0 +1,18 @@
/**********************************************************************
* 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;
/**
* @author jcamelon
*/
public interface IASTObjectStyleMacroDefinition extends IASTMacroDefinition {
}

View file

@ -56,4 +56,9 @@ public interface IASTTranslationUnit extends IASTNode {
*/
public List getReferences(IBinding binding);
public IASTNodeLocation getLocationInfo( int offset );
public IASTNodeLocation [] getLocationInfo( int offset, int length );
public IASTNode getNodeForLocation( IASTNodeLocation location );
}

View file

@ -9,10 +9,13 @@
* IBM Rational Software - Initial API and implementation */
package org.eclipse.cdt.internal.core.parser2;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
/**
* @author jcamelon
*/
public class ASTNode {
public abstract class ASTNode implements IASTNode {
private int length;
private int offset;
@ -33,4 +36,10 @@ public class ASTNode {
this.length = length;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTNode#getNodeLocations()
*/
public IASTNodeLocation[] getNodeLocations() {
return getTranslationUnit().getLocationInfo( offset, length );
}
}

View file

@ -12,6 +12,8 @@ package org.eclipse.cdt.internal.core.parser2.c;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
@ -97,4 +99,31 @@ public class CASTTranslationUnit extends CASTNode implements IASTTranslationUnit
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getLocationInfo(int)
*/
public IASTNodeLocation getLocationInfo(int offset) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getLocationInfo(int, int)
*/
public IASTNodeLocation[] getLocationInfo(int offset, int length) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getNodeForLocation(org.eclipse.cdt.core.dom.ast.IASTNodeLocation)
*/
public IASTNode getNodeForLocation(IASTNodeLocation location) {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -13,6 +13,8 @@ package org.eclipse.cdt.internal.core.parser2.cpp;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
@ -98,4 +100,29 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getLocationInfo(int)
*/
public IASTNodeLocation getLocationInfo(int offset) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getLocationInfo(int, int)
*/
public IASTNodeLocation[] getLocationInfo(int offset, int length) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getNodeForLocation(org.eclipse.cdt.core.dom.ast.IASTNodeLocation)
*/
public IASTNode getNodeForLocation(IASTNodeLocation location) {
// TODO Auto-generated method stub
return null;
}
}