Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java327
1 files changed, 0 insertions, 327 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java
deleted file mode 100644
index 71aab54ffa4..00000000000
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java
+++ /dev/null
@@ -1,327 +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.internal.core.parser.ast.quick;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
-import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
-import org.eclipse.cdt.core.parser.ast.IASTFunction;
-import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement;
-import org.eclipse.cdt.core.parser.ast.IASTScope;
-import org.eclipse.cdt.core.parser.ast.IASTTemplate;
-import org.eclipse.cdt.core.parser.ast.IReferenceManager;
-import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
-
-/**
- * @author jcamelon
- *
- */
-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 startLine, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean hasFunctionTryBlock, boolean hasVarArgs, int nameLine )
- {
- super(ownerTemplate != null ? null : scope );
- this.name = name;
- this.parms = parameters;
- this.returnType = returnType;
- this.exceptionSpec = exception;
- this.isInline = isInline;
- this.isFriend = isFriend;
- this.isStatic = isStatic;
- this.ownerTemplateDeclaration = ownerTemplate;
- if( ownerTemplate != null )
- ownerTemplate.setOwnedDeclaration( this );
- setStartingOffsetAndLineNumber( startOffset, startLine );
- setNameOffset( nameOffset );
- qualifiedName = new ASTQualifiedNamedElement( scope, name );
- setNameEndOffsetAndLineNumber(nameEndOffset, nameLine);
- this.hasFunctionTryBlock = hasFunctionTryBlock;
- this.varArgs = hasVarArgs;
- }
-
- private boolean previouslyDeclared;
- private boolean hasFunctionBody = false;
- private final IASTQualifiedNameElement qualifiedName;
- private final IASTTemplate ownerTemplateDeclaration;
- private List declarations = new ArrayList();
- private final IASTExceptionSpecification exceptionSpec;
- private final String name;
- private final List parms;
- private final IASTAbstractDeclaration returnType;
- private final boolean isInline, isFriend, isStatic;
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isInline()
- */
- public boolean isInline()
- {
- return isInline;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isFriend()
- */
- public boolean isFriend()
- {
- return isFriend;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isStatic()
- */
- public boolean isStatic()
- {
- return isStatic;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName()
- */
- public String getName()
- {
- return name;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getReturnType()
- */
- public IASTAbstractDeclaration getReturnType()
- {
- return returnType;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getParameters()
- */
- public Iterator getParameters()
- {
- return parms.iterator();
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getExceptionSpec()
- */
- public IASTExceptionSpecification getExceptionSpec()
- {
- return exceptionSpec;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration()
- */
- public IASTTemplate getOwnerTemplateDeclaration()
- {
- return ownerTemplateDeclaration;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations()
- */
- public Iterator getDeclarations()
- {
- return declarations.iterator();
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName()
- */
- public String[] getFullyQualifiedName()
- {
- return qualifiedName.getFullyQualifiedName();
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor)
- */
- public void acceptElement(ISourceElementRequestor requestor, IReferenceManager manager)
- {
- try
- {
- if( isFriend() )
- requestor.acceptFriendDeclaration(this);
- else
- requestor.acceptFunctionDeclaration(this);
-
- }
- catch (Exception e)
- {
- /* do nothing */
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor)
- */
- public void enterScope(ISourceElementRequestor requestor, IReferenceManager manager)
- {
- try
- {
- requestor.enterFunctionBody( this );
- }
- catch (Exception e)
- {
- /* do nothing */
- }
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor)
- */
- public void exitScope(ISourceElementRequestor requestor, IReferenceManager manager)
- {
- try
- {
- requestor.exitFunctionBody( this );
- }
- catch (Exception e)
- {
- /* do nothing */
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean)
- */
- public void setHasFunctionBody(boolean b) {
- hasFunctionBody = true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody()
- */
- public boolean hasFunctionBody() {
- return hasFunctionBody;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getOwnerCodeScope()
- */
- public IASTCodeScope getOwnerCodeScope()
- {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#previouslyDeclared()
- */
- public boolean previouslyDeclared()
- {
- return previouslyDeclared;
- }
- private boolean hasFunctionTryBlock = false;
- private final boolean varArgs;
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionTryBlock(boolean)
- */
- public void setHasFunctionTryBlock(boolean b)
- {
- hasFunctionTryBlock = b;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionTryBlock()
- */
- public boolean hasFunctionTryBlock()
- {
- return hasFunctionTryBlock;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTFunction#takesVarArgs()
- */
- public boolean takesVarArgs() {
- return varArgs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getContainingFunction()
- */
- public IASTFunction getContainingFunction() {
- return this;
- }
-
- private int startingLineNumber, startingOffset, endingLineNumber, endingOffset, nameStartOffset, nameEndOffset, nameLineNumber;
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
- */
- public final int getStartingLine() {
- return startingLineNumber;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
- */
- public final int getEndingLine() {
- return endingLineNumber;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameLineNumber()
- */
- public final int getNameLineNumber() {
- return nameLineNumber;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int)
- */
- public final void setStartingOffsetAndLineNumber(int offset, int lineNumber)
- {
- startingOffset = offset;
- startingLineNumber = lineNumber;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int)
- */
- public final void setEndingOffsetAndLineNumber(int offset, int lineNumber)
- {
- endingOffset = offset;
- endingLineNumber = lineNumber;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
- */
- public final int getStartingOffset()
- {
- return startingOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
- */
- public final int getEndingOffset()
- {
- return endingOffset;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset()
- */
- public final int getNameOffset()
- {
- return nameStartOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int)
- */
- public final void setNameOffset(int o)
- {
- nameStartOffset = o;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset()
- */
- public final int getNameEndOffset()
- {
- return nameEndOffset;
- }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int)
- */
- public final void setNameEndOffsetAndLineNumber(int offset, int lineNumber)
- {
- nameEndOffset = offset;
- nameLineNumber = lineNumber;
- }
-}

Back to the top