1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Added in template support to IAST hierarchy.
	Updated instantiation & specialization hierarchy.  
	Removed ASTTemplateDeclarationType.  
	Added full requestor callbacks for fields, variables, functions, methods & typedef declarations.
This commit is contained in:
John Camelon 2003-07-10 21:31:34 +00:00
parent 5de1f4a17b
commit eac791976f
32 changed files with 863 additions and 199 deletions

View file

@ -1,3 +1,9 @@
2003-07-10 John Camelon
Added in template support to IAST hierarchy.
Updated instantiation & specialization hierarchy.
Removed ASTTemplateDeclarationType.
Added full requestor callbacks for fields, variables, functions, methods & typedefs.
2003-07-08 John Camelon
Filled out IASTMethod & IASTFunction & added implementations.
Updated IScanner, clients & implementations to use IScannerInfo.

View file

@ -1,32 +0,0 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
import org.eclipse.cdt.core.parser.Enum;
/**
* @author jcamelon
*
*/
public class ASTTemplateDeclarationType extends Enum {
public static final ASTTemplateDeclarationType CLASS = new ASTTemplateDeclarationType(1);
public static final ASTTemplateDeclarationType FUNCTION = new ASTTemplateDeclarationType( 2 );
public static final ASTTemplateDeclarationType MEMBERCLASS = new ASTTemplateDeclarationType( 3 );
public static final ASTTemplateDeclarationType METHOD = new ASTTemplateDeclarationType( 4 );
public static final ASTTemplateDeclarationType FIELD = new ASTTemplateDeclarationType( 5 );
private ASTTemplateDeclarationType( int t )
{
super( t );
}
}

View file

@ -10,6 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
import java.util.List;
import org.eclipse.cdt.core.parser.Backtrack;
import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
@ -61,7 +62,7 @@ public interface IASTFactory
ASTClassKind kind,
ClassNameType type,
ASTAccessVisibility access,
IASTTemplateDeclaration ownerTemplateDeclaration,
IASTTemplate ownerTemplateDeclaration,
int startingOffset,
int nameOffset);
/**
@ -135,7 +136,7 @@ public interface IASTFactory
boolean isStatic,
int startOffset,
int nameOffset,
IASTTemplateDeclaration ownerTemplate);
IASTTemplate ownerTemplate);
public IASTAbstractDeclaration createAbstractDeclaration(
boolean isConst,
IASTTypeSpecifier typeSpecifier,
@ -152,7 +153,7 @@ public interface IASTFactory
boolean isStatic,
int startOffset,
int nameOffset,
IASTTemplateDeclaration ownerTemplate,
IASTTemplate ownerTemplate,
boolean isConst,
boolean isVolatile,
boolean isConstructor,
@ -163,13 +164,20 @@ public interface IASTFactory
ASTAccessVisibility visibility);
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression,
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic );
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset );
public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, ASTAccessVisibility visibility);
public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility);
public IASTParameterDeclaration createParameterDeclaration( boolean isConst, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, String parameterName, IASTInitializerClause initializerClause );
public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters );
public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters, boolean exported, int startingOffset );
public IASTTemplateParameter createTemplateParameter( IASTTemplateParameter.ParameterKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms );
public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset);
public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset);
public IASTTypedef createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset );
}

View file

@ -0,0 +1,21 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
/**
* @author jcamelon
*
*/
public interface IASTTemplate
{
public IASTDeclaration getOwnedDeclaration();
public void setOwnedDeclaration( IASTDeclaration declaration );
}

View file

@ -10,16 +10,14 @@
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
import java.util.Iterator;
/**
* @author jcamelon
*
*/
public interface IASTTemplateDeclaration extends IASTDeclaration {
public interface IASTTemplateDeclaration extends IASTDeclaration, IASTTemplate, IASTTemplateParameterList, IASTOffsetableElement {
public boolean isExported();
public ASTTemplateDeclarationType getTemplateDeclarationType();
public Iterator getTemplateParameters();
public IASTDeclaration getOwnedDeclaration();
}

View file

@ -14,8 +14,6 @@ package org.eclipse.cdt.core.parser.ast;
* @author jcamelon
*
*/
public interface IASTTemplateInstantiation {
public interface IASTTemplateInstantiation extends IASTTemplate, IASTDeclaration, IASTOffsetableElement {
public ASTTemplateDeclarationType getTemplateDeclarationType();
public IASTTemplateDeclaration getTemplateDeclaration();
}

View file

@ -10,10 +10,32 @@
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
import org.eclipse.cdt.core.parser.Enum;
/**
* @author jcamelon
*
*/
public interface IASTTemplateParameter {
public interface IASTTemplateParameter extends IASTTemplateParameterList {
public class ParameterKind extends Enum
{
public static final ParameterKind CLASS = new ParameterKind( 1 );
public static final ParameterKind TYPENAME = new ParameterKind( 2 );
public static final ParameterKind TEMPLATE_LIST = new ParameterKind( 3 );
public static final ParameterKind PARAMETER = new ParameterKind( 4 );
/**
* @param enumValue
*/
protected ParameterKind(int enumValue)
{
super(enumValue);
}
}
public ParameterKind getTemplateParameterKind();
public String getIdentifier();
public String getDefaultValueIdExpression();
}

View file

@ -0,0 +1,22 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.core.parser.ast;
import java.util.Iterator;
/**
* @author jcamelon
*
*/
public interface IASTTemplateParameterList
{
public Iterator getTemplateParameters();
}

View file

@ -14,8 +14,6 @@ package org.eclipse.cdt.core.parser.ast;
* @author jcamelon
*
*/
public interface IASTTemplateSpecialization {
public interface IASTTemplateSpecialization extends IASTDeclaration, IASTTemplate, IASTOffsetableElement {
public ASTTemplateDeclarationType getTemplateDeclarationType();
public IASTTemplateDeclaration getTemplateDeclaration();
}

View file

@ -16,5 +16,5 @@ package org.eclipse.cdt.core.parser.ast;
*/
public interface IASTTemplatedDeclaration {
public IASTTemplateDeclaration getOwnerTemplateDeclaration();
public IASTTemplate getOwnerTemplateDeclaration();
}

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.core.parser.ast;
* @author jcamelon
*
*/
public interface IASTTypedef extends IASTDeclaration {
public interface IASTTypedef extends IASTDeclaration, IASTOffsetableNamedElement {
public String getName();
public IASTAbstractDeclaration getAbstractDeclarator();

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.core.parser.ast;
* @author jcamelon
*
*/
public interface IASTVariable extends IASTDeclaration {
public interface IASTVariable extends IASTDeclaration, IASTOffsetableNamedElement {
public boolean isAuto();
public boolean isRegister();

View file

@ -13,7 +13,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ITokenDuple;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
@ -23,8 +22,9 @@ import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTypedef;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
/**
@ -34,12 +34,13 @@ import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
public class DeclarationWrapper implements IDeclaratorOwner
{
private ITokenDuple name;
private SimpleType simpleType = IASTSimpleTypeSpecifier.SimpleType.UNSPECIFIED;
private SimpleType simpleType =
IASTSimpleTypeSpecifier.SimpleType.UNSPECIFIED;
private boolean isSigned;
private boolean isLong;
private boolean isShort;
private boolean isUnsigned;
private final IASTTemplateDeclaration templateDeclaration;
private final IASTTemplate templateDeclaration;
private final IASTScope scope;
private IASTTypeSpecifier typeSpecifier;
private List declarators = new ArrayList();
@ -77,7 +78,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
public DeclarationWrapper(
IASTScope scope,
int startingOffset,
IASTTemplateDeclaration templateDeclaration)
IASTTemplate templateDeclaration)
{
this.scope = scope;
this.startingOffset = startingOffset;
@ -90,7 +91,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
typeNamed = b;
}
/**
* @param b
*/
@ -217,7 +217,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
return mutable;
}
/**
* @return
*/
@ -239,7 +238,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
return staticc;
}
/**
* @return
*/
@ -310,14 +308,33 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
boolean isWithinClass = (getScope() instanceof IASTClassSpecifier);
boolean isFunction = declarator.isFunction();
if (isTypedef())
return createTypedef(declarator);
if (isWithinClass && isFunction)
return createMethodASTNode(declarator);
else if (isWithinClass)
else if (isWithinClass && !isFunction)
return createFieldASTNode(declarator);
else if ((!isWithinClass) && isFunction)
return createFunctionASTNode(declarator);
else
else if (!isFunction && !isWithinClass)
return createVariableASTNode(declarator);
else
throw new Error("WTF"); //return IProblem?
}
/**
* @param declarator
* @return
*/
private IASTTypedef createTypedef(Declarator declarator)
{
return astFactory.createTypedef(
scope,
declarator.getName(),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
declarator.getArrayModifiers()), startingOffset, declarator.getNameStartOffset());
}
/**
* @param declarator
@ -329,7 +346,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
.createMethod(
scope,
declarator.getName(),
createParameterList( declarator.getParameters() ),
createParameterList(declarator.getParameters()),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
@ -344,11 +361,12 @@ public class DeclarationWrapper implements IDeclaratorOwner
templateDeclaration,
declarator.isConst(),
declarator.isVolatile(),
false, // isConstructor
false, // isDestructor
virtual,
explicit,
declarator.isPureVirtual(),
false,
// isConstructor
false, // isDestructor
virtual,
explicit,
declarator.isPureVirtual(),
((IASTClassSpecifier)scope).getCurrentVisibilityMode());
}
/**
@ -360,7 +378,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
return astFactory.createFunction(
scope,
declarator.getName(),
createParameterList( declarator.getParameters() ),
createParameterList(declarator.getParameters()),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
@ -380,30 +398,50 @@ public class DeclarationWrapper implements IDeclaratorOwner
*/
private IASTField createFieldASTNode(Declarator declarator)
{
return astFactory.createField( scope, declarator.getName(), auto, declarator.getInitializerClause(), declarator.getBitFieldExpression(),
astFactory.createAbstractDeclaration( constt, getTypeSpecifier(), declarator.getPtrOps(), declarator.getArrayModifiers() ),
mutable, extern, register, staticc, ((IASTClassSpecifier)scope).getCurrentVisibilityMode());
return astFactory.createField(
scope,
declarator.getName(),
auto,
declarator.getInitializerClause(),
declarator.getBitFieldExpression(),
astFactory.createAbstractDeclaration(
constt,
getTypeSpecifier(),
declarator.getPtrOps(),
declarator.getArrayModifiers()),
mutable,
extern,
register,
staticc,
startingOffset,
declarator.getNameEndOffset(),
((IASTClassSpecifier)scope).getCurrentVisibilityMode());
}
private List createParameterList( List currentParameters )
private List createParameterList(List currentParameters)
{
List result = new ArrayList();
Iterator i = currentParameters.iterator();
while( i.hasNext() )
{
DeclarationWrapper wrapper = (DeclarationWrapper)i.next();
Iterator j = wrapper.getDeclarators();
while( j.hasNext() )
{
Declarator declarator = (Declarator)j.next();
result.add( astFactory.createParameterDeclaration( wrapper.isConst(), wrapper.getTypeSpecifier(),
declarator.getPtrOps(), declarator.getArrayModifiers(),
declarator.getName() == null ? "" : declarator.getName(), declarator.getInitializerClause() ) );
}
}
return result;
List result = new ArrayList();
Iterator i = currentParameters.iterator();
while (i.hasNext())
{
DeclarationWrapper wrapper = (DeclarationWrapper)i.next();
Iterator j = wrapper.getDeclarators();
while (j.hasNext())
{
Declarator declarator = (Declarator)j.next();
result.add(
astFactory.createParameterDeclaration(
wrapper.isConst(),
wrapper.getTypeSpecifier(),
declarator.getPtrOps(),
declarator.getArrayModifiers(),
declarator.getName() == null
? ""
: declarator.getName(),
declarator.getInitializerClause()));
}
}
return result;
}
/**
* @param declarator
* @return
@ -424,7 +462,9 @@ public class DeclarationWrapper implements IDeclaratorOwner
mutable,
extern,
register,
staticc);
staticc,
getStartingOffset(),
declarator.getNameEndOffset());
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper()
@ -433,7 +473,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
return this;
}
/**
* @return
*/
@ -469,7 +508,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
isLong = b;
}
/**
* @param b
*/
@ -477,7 +515,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
isShort = b;
}
/**
* @param b
*/
@ -485,7 +522,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
isSigned = b;
}
/**
* @param b
*/
@ -500,7 +536,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
return simpleType;
}
/**
* @param type
*/
@ -513,9 +548,8 @@ public class DeclarationWrapper implements IDeclaratorOwner
*/
public void setTypeName(ITokenDuple duple)
{
name = duple;
name = duple;
}
/**
* @return
*/
@ -523,7 +557,6 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
return name;
}
/**
* @param duple
*/
@ -531,5 +564,11 @@ public class DeclarationWrapper implements IDeclaratorOwner
{
name = duple;
}
/**
* @return
*/
public IASTTemplate getOwnerTemplate()
{
return templateDeclaration;
}
}

View file

@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
import org.eclipse.cdt.core.parser.IProblem;
import java.util.Locale;
import org.eclipse.cdt.core.parser.IProblem;
/**
* Factory used during translation to build the actual problems
* which are handed back in the translation result.

View file

@ -10,6 +10,7 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.Backtrack;
@ -31,21 +32,31 @@ import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTExpression;
import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
import org.eclipse.cdt.core.parser.ast.IASTTypedef;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.internal.core.model.Util;
import org.eclipse.cdt.internal.core.parser.ast.*;
import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
/**
@ -171,7 +182,7 @@ public class Parser implements IParser
try
{
checkToken = LA(1);
declaration(translationUnit, compilationUnit);
declaration(translationUnit, compilationUnit, null);
if (LA(1) == checkToken)
errorHandling();
}
@ -436,7 +447,7 @@ public class Parser implements IParser
default :
try
{
declaration(linkageSpec, linkage);
declaration(linkageSpec, linkage, null);
}
catch (Backtrack bt)
{
@ -464,7 +475,7 @@ public class Parser implements IParser
IASTLinkageSpecification linkage =
astFactory.createLinkageSpecification(scope, spec.getImage());
requestor.enterLinkageSpecification(linkage);
declaration(linkageSpec);
declaration(linkageSpec, linkage, null);
try
{
callback.linkageSpecificationEnd(linkageSpec);
@ -487,7 +498,7 @@ public class Parser implements IParser
* @param container Callback object representing the scope these definitions fall into.
* @throws Backtrack request for a backtrack
*/
protected void templateDeclaration(Object container) throws Backtrack
protected void templateDeclaration(Object container, IASTScope scope) throws Backtrack
{
IToken firstToken = null;
if (LT(1) == IToken.t_export)
@ -508,7 +519,13 @@ public class Parser implements IParser
catch (Exception e)
{
}
declaration(instantiation);
IASTTemplateInstantiation templateInstantiation = astFactory.createTemplateInstantiation( scope, firstToken.getOffset() );
requestor.enterTemplateExplicitInstantiation( templateInstantiation );
declaration(instantiation, scope, templateInstantiation );
templateInstantiation.setEndingOffset( lastToken.getEndOffset() );
requestor.exitTemplateExplicitInstantiation( templateInstantiation );
try
{
callback.explicitInstantiationEnd(instantiation);
@ -534,7 +551,13 @@ public class Parser implements IParser
catch (Exception e)
{
}
declaration(specialization);
IASTTemplateSpecialization templateSpecialization = astFactory.createTemplateSpecialization( scope, firstToken.getOffset() );
requestor.enterTemplateSpecialization( templateSpecialization );
declaration(specialization, scope, templateSpecialization );
templateSpecialization.setEndingOffset( lastToken.getEndOffset() );
requestor.exitTemplateSpecialization( templateSpecialization );
try
{
callback.explicitSpecializationEnd(specialization);
@ -558,7 +581,7 @@ public class Parser implements IParser
}
templateParameterList(templateDeclaration);
consume(IToken.tGT);
declaration(templateDeclaration);
declaration(templateDeclaration, scope, null);
try
{
callback.templateDeclarationEnd(
@ -746,10 +769,7 @@ public class Parser implements IParser
}
}
}
protected void declaration(Object container) throws Backtrack
{
declaration(container, null);
}
/**
* The most abstract construct within a translationUnit : a declaration.
*
@ -773,7 +793,7 @@ public class Parser implements IParser
* @param container IParserCallback object which serves as the owner scope for this declaration.
* @throws Backtrack request a backtrack
*/
protected void declaration(Object container, IASTScope scope)
protected void declaration(Object container, IASTScope scope, IASTTemplate ownerTemplate)
throws Backtrack
{
switch (LT(1))
@ -809,7 +829,7 @@ public class Parser implements IParser
return;
case IToken.t_export :
case IToken.t_template :
templateDeclaration(container);
templateDeclaration(container, scope);
return;
case IToken.t_extern :
if (LT(2) == IToken.tSTRING)
@ -821,14 +841,14 @@ public class Parser implements IParser
IToken mark = mark();
try
{
simpleDeclaration(container, true, false, scope);
simpleDeclaration(container, true, false, scope, ownerTemplate);
// try it first with the original strategy
}
catch (Backtrack bt)
{
// did not work
backup(mark);
simpleDeclaration(container, false, false, scope);
simpleDeclaration(container, false, false, scope, ownerTemplate);
// try it again with the second strategy
}
}
@ -890,7 +910,7 @@ public class Parser implements IParser
default :
try
{
declaration(namespace, namespaceDefinition);
declaration(namespace, namespaceDefinition, null);
}
catch (Backtrack bt)
{
@ -949,11 +969,11 @@ public class Parser implements IParser
Object container,
boolean tryConstructor,
boolean forKR,
IASTScope scope)
IASTScope scope, IASTTemplate ownerTemplate)
throws Backtrack
{
Object simpleDecl = null;
DeclarationWrapper sdw = new DeclarationWrapper(scope, LA(1).getOffset(), null);
DeclarationWrapper sdw = new DeclarationWrapper(scope, LA(1).getOffset(), ownerTemplate);
try
{
simpleDecl = callback.simpleDeclarationBegin(container, LA(1));
@ -1015,29 +1035,82 @@ public class Parser implements IParser
}
List l = sdw.createASTNodes(astFactory);
if( hasFunctionBody )
Iterator i = l.iterator();
if( hasFunctionBody && l.size() != 1 )
{
// if( l.size() != 1 )
// requestor.acceptProblem( ParserFactory.createProblem());
Object function = null;
try
{
function = callback.functionBodyBegin(simpleDecl);
}
catch (Exception e)
{
}
handleFunctionBody(d.getDeclarator());
try
{
callback.functionBodyEnd(function);
}
catch (Exception e)
{
}
failParse();
throw backtrack; //TODO Should be an IProblem
}
if( i.hasNext() ) // no need to do this unless we have a declarator
{
if( ! hasFunctionBody )
{
while( i.hasNext() )
{
IASTDeclaration declaration = (IASTDeclaration)i.next();
((IASTOffsetableElement)declaration).setEndingOffset( lastToken.getEndOffset() );
if( declaration instanceof IASTField )
requestor.acceptField( (IASTField)declaration );
else if( declaration instanceof IASTVariable )
requestor.acceptVariable( (IASTVariable)declaration );
else if( declaration instanceof IASTMethod )
requestor.acceptMethodDeclaration( (IASTMethod)declaration );
else if( declaration instanceof IASTFunction )
requestor.acceptFunctionDeclaration( (IASTFunction)declaration );
else if( declaration instanceof IASTTypedef )
requestor.acceptTypedef( (IASTTypedef)declaration);
else
{
if( hasFunctionBody && l.size() != 1 )
{
failParse();
throw backtrack; //TODO Should be an IProblem
}
}
}
}
else
{
IASTDeclaration declaration = (IASTDeclaration)i.next();
if( declaration instanceof IASTMethod )
requestor.enterMethodBody( (IASTMethod)declaration );
else if( declaration instanceof IASTFunction )
requestor.enterFunctionBody( (IASTFunction)declaration );
else
{
if( hasFunctionBody && l.size() != 1 )
{
failParse();
throw backtrack; //TODO Should be an IProblem
}
}
Object function = null;
try
{
function = callback.functionBodyBegin(simpleDecl);
}
catch (Exception e)
{
}
handleFunctionBody(d.getDeclarator());
try
{
callback.functionBodyEnd(function);
}
catch (Exception e)
{
}
if( declaration instanceof IASTMethod )
requestor.exitMethodBody( (IASTMethod)declaration );
else if( declaration instanceof IASTFunction )
requestor.exitFunctionBody( (IASTFunction)declaration );
}
}
try
{
@ -2477,7 +2550,7 @@ public class Parser implements IParser
oldKRParameterDeclarationClause,
false,
true,
sdw.getScope());
sdw.getScope(), sdw.getOwnerTemplate());
}
while (LT(1) != IToken.tLBRACE);
}
@ -3060,7 +3133,7 @@ public class Parser implements IParser
default :
try
{
declaration(classSpec,astClassSpecifier);
declaration(classSpec,astClassSpecifier, null);
}
catch (Backtrack bt)
{
@ -3367,7 +3440,7 @@ public class Parser implements IParser
{
consume();
consume(IToken.tLPAREN);
declaration(null); // was exceptionDeclaration
declaration(null, null, null); // was exceptionDeclaration
consume(IToken.tRPAREN);
compoundStatement();
}
@ -3413,7 +3486,7 @@ public class Parser implements IParser
{
}
// declarationStatement
declaration(null);
declaration(null,null, null);
}
}
/**

View file

@ -12,8 +12,8 @@ package org.eclipse.cdt.internal.core.parser;
import java.util.Iterator;
import org.eclipse.cdt.core.parser.*;
import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.ITokenDuple;
/**
* @author jcamelon

View file

@ -19,8 +19,9 @@ package org.eclipse.cdt.internal.core.parser;
* </ul>
*/
import org.eclipse.cdt.core.parser.*;
import org.eclipse.cdt.core.parser.IProblem;
import org.eclipse.cdt.core.parser.IReferenceContext;
import org.eclipse.cdt.core.parser.ITranslationResult;
//import org.eclipse.cdt.core.model.ITranslationUnit;
public class TranslationResult implements ITranslationResult {

View file

@ -14,6 +14,7 @@ import java.util.Iterator;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
@ -92,7 +93,7 @@ public class ASTClassSpecifier implements IASTFClassSpecifier, IPSTSymbolExtensi
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
*/
public IASTTemplateDeclaration getOwnerTemplateDeclaration() {
public IASTTemplate getOwnerTemplateDeclaration() {
if( getSymbol().getContainingSymbol().getType() == ParserSymbolTable.TypeInfo.t_template )
return (IASTTemplateDeclaration)getSymbol().getContainingSymbol().getASTNode();
return null;

View file

@ -37,8 +37,13 @@ import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTypedef;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
@ -46,6 +51,7 @@ import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParameterKind;
import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory;
import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
@ -172,7 +178,7 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
*/
public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplate ownerTemplateDeclaration, int startingOffset, int nameOffset) {
// TODO Auto-generated method stub
return null;
}
@ -276,7 +282,7 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
*/
public IASTFunction createFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplateDeclaration ownerTemplate)
public IASTFunction createFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate)
{
// TODO Auto-generated method stub
return null;
@ -294,7 +300,7 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility)
*/
public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplateDeclaration ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility)
public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility)
{
// TODO Auto-generated method stub
return null;
@ -303,7 +309,7 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean)
*/
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic)
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset)
{
// TODO Auto-generated method stub
return null;
@ -312,7 +318,7 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility)
*/
public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, ASTAccessVisibility visibility)
public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility)
{
// TODO Auto-generated method stub
return null;
@ -330,7 +336,43 @@ public class FullParseASTFactory extends BaseASTFactory implements IASTFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateDeclaration(java.util.List)
*/
public IASTTemplateDeclaration createTemplateDeclaration(IASTScope scope, List templateParameters)
public IASTTemplateDeclaration createTemplateDeclaration(IASTScope scope, List templateParameters, boolean exported, int startingOffset)
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateParameter(org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParameterKind, org.eclipse.cdt.core.parser.IToken, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration)
*/
public IASTTemplateParameter createTemplateParameter(ParameterKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms)
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateInstantiation()
*/
public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset)
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateSpecialization()
*/
public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset)
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypedef(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration)
*/
public IASTTypedef createTypedef(IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset)
{
// TODO Auto-generated method stub
return null;

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
/**
* @author jcamelon
@ -34,17 +34,17 @@ public class ASTClassSpecifier
ASTClassKind kind,
ClassNameType type,
ASTAccessVisibility access,
IASTTemplateDeclaration ownerTemplateDeclaration)
IASTTemplate ownerTemplate)
{
super(scope, name );
classNameType = type;
classKind = kind;
this.access = access;
this.name = name;
templateOwner = ownerTemplateDeclaration;
templateOwner = ownerTemplate;
}
private IASTTemplateDeclaration templateOwner = null;
private IASTTemplate templateOwner = null;
private final String name;
private List declarations = new ArrayList();
private List baseClauses = new ArrayList();
@ -111,7 +111,7 @@ public class ASTClassSpecifier
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
*/
public IASTTemplateDeclaration getOwnerTemplateDeclaration()
public IASTTemplate getOwnerTemplateDeclaration()
{
return templateOwner;
}

View file

@ -26,7 +26,8 @@ public class ASTEnumerator
private final IASTExpression initialValue;
private final String name;
private final IASTEnumerationSpecifier enumeration;
private final NamedOffsets offsets = new NamedOffsets();
private final NamedOffsets offsets = new NamedOffsets();
/**
* @param enumeration
* @param string

View file

@ -37,7 +37,7 @@ public class ASTField extends ASTVariable implements IASTField
* @param isRegister
* @param isStatic
*/
public ASTField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, ASTAccessVisibility visibility)
public ASTField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility)
{
super(
scope,
@ -49,7 +49,7 @@ public class ASTField extends ASTVariable implements IASTField
isMutable,
isExtern,
isRegister,
isStatic);
isStatic, startingOffset, nameOffset);
this.visibility = visibility;
}

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
/**
@ -31,7 +31,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction
* @param scope
*/
public ASTFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception,
boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplateDeclaration ownerTemplate )
boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate )
{
super(scope);
this.name = name;
@ -46,7 +46,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction
offsets.setNameOffset( nameOffset );
}
private final IASTTemplateDeclaration ownerTemplateDeclaration;
private final IASTTemplate ownerTemplateDeclaration;
private NamedOffsets offsets = new NamedOffsets();
private List declarations = new ArrayList();
private final IASTExceptionSpecification exceptionSpec;
@ -122,7 +122,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
*/
public IASTTemplateDeclaration getOwnerTemplateDeclaration()
public IASTTemplate getOwnerTemplateDeclaration()
{
return ownerTemplateDeclaration;
}

View file

@ -10,12 +10,13 @@
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
import java.util.List;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTMethod;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
/**
* @author jcamelon
*
@ -54,7 +55,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod
boolean isStatic,
int startOffset,
int nameOffset,
IASTTemplateDeclaration ownerTemplate,
IASTTemplate ownerTemplate,
boolean isConst,
boolean isVolatile,
boolean isConstructor,

View file

@ -13,10 +13,10 @@ package org.eclipse.cdt.internal.core.parser.ast.quick;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ast.ASTTemplateDeclarationType;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
/**
* @author jcamelon
@ -26,28 +26,24 @@ public class ASTTemplateDeclaration extends ASTDeclaration implements IASTTempla
{
private IASTDeclaration ownedDeclaration;
private List templateParameters;
private ASTTemplateDeclarationType type;
private Offsets offsets = new Offsets();
private final boolean isExported;
/**
* @param templateParameters
*/
public ASTTemplateDeclaration(IASTScope scope, List templateParameters)
public ASTTemplateDeclaration(IASTScope scope, List templateParameters, int startingOffset, boolean isExported)
{
super( scope );
this.templateParameters = templateParameters;
setStartingOffset(startingOffset);
this.isExported = isExported;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#getTemplateDeclarationType()
*/
public ASTTemplateDeclarationType getTemplateDeclarationType()
{
return type;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#getTemplateParameters()
*/
public Iterator getTemplateParameters()
{
// TODO Auto-generated method stub
return templateParameters.iterator();
}
/* (non-Javadoc)
@ -55,7 +51,51 @@ public class ASTTemplateDeclaration extends ASTDeclaration implements IASTTempla
*/
public IASTDeclaration getOwnedDeclaration()
{
// TODO Auto-generated method stub
return ownedDeclaration;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
*/
public int getElementStartingOffset()
{
return offsets.getElementStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
*/
public int getElementEndingOffset()
{
return offsets.getElementEndingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
ownedDeclaration = declaration;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#isExported()
*/
public boolean isExported()
{
return isExported;
}
}

View file

@ -0,0 +1,83 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
/**
* @author jcamelon
*
*/
public class ASTTemplateInstantiation extends ASTDeclaration implements IASTTemplateInstantiation
{
private IASTDeclaration declaration;
private Offsets offsets = new Offsets();
/**
* @param scope
*/
public ASTTemplateInstantiation(IASTScope scope, int startingOffset)
{
super( scope );
setStartingOffset(startingOffset);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration()
*/
public IASTDeclaration getOwnedDeclaration()
{
return declaration;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
this.declaration = declaration;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset( o );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
*/
public int getElementStartingOffset()
{
return offsets.getElementStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
*/
public int getElementEndingOffset()
{
return offsets.getElementEndingOffset();
}
}

View file

@ -0,0 +1,73 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter;
/**
* @author jcamelon
*
*/
public class ASTTemplateParameter implements IASTTemplateParameter
{
private final List templateParms;
private final IASTParameterDeclaration parameter;
private final ParameterKind kind;
private final String identifier;
private final String defaultValue;
/**
* @param kind
* @param identifier
* @param defaultValue
* @param parameter
*/
public ASTTemplateParameter(ParameterKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List templateParms)
{
this.kind = kind;
this.identifier = identifier;
this.defaultValue = defaultValue;
this.parameter = parameter;
this.templateParms = templateParms;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getTemplateParameterKind()
*/
public ParameterKind getTemplateParameterKind()
{
return kind;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getIdentifier()
*/
public String getIdentifier()
{
return identifier;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getDefaultValueIdExpression()
*/
public String getDefaultValueIdExpression()
{
return defaultValue;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameterList#getTemplateParameters()
*/
public Iterator getTemplateParameters()
{
// TODO Auto-generated method stub
return templateParms.iterator();
}
}

View file

@ -0,0 +1,78 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
import org.eclipse.cdt.internal.core.parser.ast.Offsets;
/**
* @author jcamelon
*
*/
public class ASTTemplateSpecialization extends ASTDeclaration implements IASTTemplateSpecialization
{
private Offsets offsets = new Offsets();
private IASTDeclaration ownedDeclaration;
/**
* @param scope
*/
public ASTTemplateSpecialization(IASTScope scope, int startingOffset )
{
super(scope);
setStartingOffset(startingOffset);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration()
*/
public IASTDeclaration getOwnedDeclaration()
{
return ownedDeclaration;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
offsets.setStartingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
offsets.setEndingOffset(o);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
*/
public int getElementStartingOffset()
{
return offsets.getElementStartingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
*/
public int getElementEndingOffset()
{
return offsets.getElementEndingOffset();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration)
*/
public void setOwnedDeclaration(IASTDeclaration declaration)
{
ownedDeclaration = declaration;
}
}

View file

@ -0,0 +1,101 @@
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.parser.ast.quick;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTTypedef;
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
/**
* @author jcamelon
*
*/
public class ASTTypedef extends ASTDeclaration implements IASTTypedef
{
private final String name;
private final IASTAbstractDeclaration mapping;
private NamedOffsets offsets = new NamedOffsets();
/**
* @param scope
* @param name
* @param mapping
*/
public ASTTypedef(IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset)
{
super( scope );
this.name = name;
this.mapping = mapping;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTypedef#getName()
*/
public String getName()
{
return name;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTTypedef#getAbstractDeclarator()
*/
public IASTAbstractDeclaration getAbstractDeclarator()
{
return mapping;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset()
*/
public int getElementNameOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
*/
public int getElementStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
*/
public int getElementEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
}

View file

@ -15,6 +15,7 @@ import org.eclipse.cdt.core.parser.ast.IASTExpression;
import org.eclipse.cdt.core.parser.ast.IASTInitializerClause;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
/**
* @author jcamelon
@ -31,11 +32,12 @@ public class ASTVariable extends ASTDeclaration implements IASTVariable
private final boolean isRegister;
private final boolean isStatic;
private final String name;
private NamedOffsets offsets = new NamedOffsets();
/**
* @param scope
*/
public ASTVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression,
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic )
IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset )
{
super(scope);
this.isAuto = isAuto;
@ -120,5 +122,53 @@ public class ASTVariable extends ASTDeclaration implements IASTVariable
// TODO Auto-generated method stub
return bitfieldExpression;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
*/
public void setStartingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
*/
public void setEndingOffset(int o)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset()
*/
public int getElementStartingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset()
*/
public int getElementEndingOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset()
*/
public int getElementNameOffset()
{
// TODO Auto-generated method stub
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
*/
public void setNameOffset(int o)
{
// TODO Auto-generated method stub
}
}

View file

@ -37,8 +37,13 @@ import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTScope;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter;
import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTTypedef;
import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
import org.eclipse.cdt.core.parser.ast.IASTVariable;
@ -46,6 +51,7 @@ import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor;
import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType;
import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParameterKind;
import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory;
import org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier;
@ -106,7 +112,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
*/
public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplateDeclaration ownerTemplateDeclaration, int startingOffset, int nameOffset) {
public IASTClassSpecifier createClassSpecifier(IASTScope scope, String name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, IASTTemplate ownerTemplateDeclaration, int startingOffset, int nameOffset) {
IASTClassSpecifier spec = new ASTClassSpecifier( scope, name, kind, type, access, ownerTemplateDeclaration );
spec.setStartingOffset( startingOffset );
spec.setNameOffset( nameOffset );
@ -201,7 +207,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
*/
public IASTFunction createFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplateDeclaration ownerTemplate)
public IASTFunction createFunction(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate)
{
return new ASTFunction(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate );
}
@ -217,7 +223,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility)
*/
public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplateDeclaration ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility)
public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isConstructor, boolean isDestructor, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility)
{
return new ASTMethod(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, isConstructor, isDestructor, isVirtual, isExplicit, isPureVirtual, visibility);
}
@ -225,17 +231,17 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean)
*/
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic)
public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset)
{
return new ASTVariable(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic);
return new ASTVariable(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility)
*/
public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, ASTAccessVisibility visibility)
public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, ASTAccessVisibility visibility)
{
return new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, visibility);
return new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, visibility);
}
/* (non-Javadoc)
@ -249,8 +255,42 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateDeclaration(java.util.List)
*/
public IASTTemplateDeclaration createTemplateDeclaration(IASTScope scope, List templateParameters)
public IASTTemplateDeclaration createTemplateDeclaration(IASTScope scope, List templateParameters, boolean exported, int startingOffset)
{
return new ASTTemplateDeclaration( scope, templateParameters );
return new ASTTemplateDeclaration( scope, templateParameters, startingOffset, exported );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateParameter(org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParameterKind, org.eclipse.cdt.core.parser.IToken, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration)
*/
public IASTTemplateParameter createTemplateParameter(ParameterKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms)
{
return new ASTTemplateParameter( kind, identifier, defaultValue, parameter, parms );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateInstantiation()
*/
public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset)
{
return new ASTTemplateInstantiation(scope, startingOffset);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateSpecialization()
*/
public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset)
{
return new ASTTemplateSpecialization(scope, startingOffset );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypedef(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration)
*/
public IASTTypedef createTypedef(IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset)
{
return new ASTTypedef( scope, name, mapping, startingOffset, nameOffset );
}
}

View file

@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser.problem;
import org.eclipse.cdt.core.parser.IProblem;
import org.eclipse.cdt.core.parser.IProblemReporter;
import org.eclipse.cdt.core.parser.IReferenceContext;
import org.eclipse.cdt.core.parser.ITranslationOptions;
import org.eclipse.cdt.core.parser.ITranslationResult;
import org.eclipse.cdt.internal.core.parser.IErrorHandlingPolicy;
import org.eclipse.cdt.internal.core.parser.IProblemFactory;
import org.eclipse.cdt.core.parser.IProblem;
import org.eclipse.cdt.core.parser.IProblemReporter;
import org.eclipse.cdt.core.parser.IReferenceContext;
import org.eclipse.cdt.core.parser.ITranslationOptions;
import org.eclipse.cdt.core.parser.ITranslationResult;
import org.eclipse.cdt.internal.core.parser.IErrorHandlingPolicy;
import org.eclipse.cdt.internal.core.parser.IProblemFactory;
public class ProblemReporter extends ProblemHandler implements IProblemReporter {