1
/*******************************************************************************
2
* Copyright (c) 2010 Google, Inc and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Sergey Prigogin (Google) - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
13
import org.eclipse.cdt.core.dom.ILinkage;
14
import org.eclipse.cdt.core.dom.ast.DOMException;
15
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
16
import org.eclipse.cdt.core.dom.ast.IBinding;
17
import org.eclipse.cdt.core.dom.ast.IScope;
18
import org.eclipse.cdt.core.dom.ast.IType;
19
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
20
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
21
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
22
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
23
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
24
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
25
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType;
26
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionType;
27
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateTypeParameter;
28
import org.eclipse.core.runtime.CoreException;
31
* This class represents a template function used for deducing 'auto' types (C++0x: 7.1.6.4).
33
class AutoTypeResolver implements ICPPFunctionTemplate {
34
// Template parameter of the function. This parameter is used in place of 'auto' keyword.
35
public static final ICPPTemplateTypeParameter AUTO_TYPE =
36
new CPPTemplateTypeParameter(new CPPASTName(), false);
37
private static final ICPPTemplateTypeParameter[] TEMPLATE_PARAMETERS =
38
new ICPPTemplateTypeParameter[] { AUTO_TYPE };
39
private static final String UNEXPECTED_CALL = "Unexpected call"; //$NON-NLS-1$
40
private final CPPFunctionType functionType;
42
public AutoTypeResolver(IType paramType) {
43
functionType = new CPPFunctionType(new CPPBasicType(Kind.eVoid, 0), new IType[] { paramType });
46
public ICPPTemplateParameter[] getTemplateParameters() {
47
return TEMPLATE_PARAMETERS;
50
public ICPPFunctionType getType() {
54
public boolean isMutable() {
58
public boolean isInline() {
62
public boolean isExternC() {
66
public boolean isDeleted() {
70
public IType[] getExceptionSpecification() {
74
public ICPPParameter[] getParameters() {
75
throw new UnsupportedOperationException(UNEXPECTED_CALL);
78
public int getRequiredArgumentCount() {
82
public boolean hasParameterPack() {
86
public IScope getFunctionScope() {
87
throw new UnsupportedOperationException(UNEXPECTED_CALL);
90
public boolean isStatic() {
94
public boolean isExtern() {
98
public boolean isAuto() {
102
public boolean isRegister() {
106
public boolean takesVarArgs() {
110
public String getName() {
111
throw new UnsupportedOperationException(UNEXPECTED_CALL);
114
public char[] getNameCharArray() {
115
throw new UnsupportedOperationException(UNEXPECTED_CALL);
118
public ILinkage getLinkage() throws CoreException {
119
throw new UnsupportedOperationException(UNEXPECTED_CALL);
122
public IBinding getOwner() {
123
throw new UnsupportedOperationException(UNEXPECTED_CALL);
126
public IScope getScope() throws DOMException {
127
throw new UnsupportedOperationException(UNEXPECTED_CALL);
130
@SuppressWarnings("rawtypes")
131
public Object getAdapter(Class adapter) {
132
throw new UnsupportedOperationException(UNEXPECTED_CALL);
135
public String[] getQualifiedName() throws DOMException {
136
throw new UnsupportedOperationException(UNEXPECTED_CALL);
139
public char[][] getQualifiedNameCharArray() throws DOMException {
140
throw new UnsupportedOperationException(UNEXPECTED_CALL);
143
public boolean isGloballyQualified() throws DOMException {
144
throw new UnsupportedOperationException(UNEXPECTED_CALL);
b'\\ No newline at end of file'