diff options
author | atikhomirov | 2006-10-30 21:13:08 +0000 |
---|---|---|
committer | atikhomirov | 2006-10-30 21:13:08 +0000 |
commit | e5abcdee1e9c901d6d3ccdecaa76ac7cbf046608 (patch) | |
tree | cecddfe8e91c56455cb21ff77d082fe2eae574f6 /plugins | |
parent | b5a25cedb1ff746d96e8e6bb72673c5a80615eaf (diff) | |
download | org.eclipse.gmf-tooling-e5abcdee1e9c901d6d3ccdecaa76ac7cbf046608.tar.gz org.eclipse.gmf-tooling-e5abcdee1e9c901d6d3ccdecaa76ac7cbf046608.tar.xz org.eclipse.gmf-tooling-e5abcdee1e9c901d6d3ccdecaa76ac7cbf046608.zip |
this class was not used anywhere
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/expression/ast/StaticFeatureCall.java | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/expression/ast/StaticFeatureCall.java b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/expression/ast/StaticFeatureCall.java deleted file mode 100644 index b905f6cb4..000000000 --- a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/expression/ast/StaticFeatureCall.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * <copyright> - * - * Copyright (c) 2005-2006 Sven Efftinge and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sven Efftinge - Initial API and implementation - * - * </copyright> - */ -package org.eclipse.gmf.internal.xpand.expression.ast; - -import java.util.Set; - -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EEnumLiteral; -import org.eclipse.gmf.internal.xpand.BuiltinMetaModel; -import org.eclipse.gmf.internal.xpand.expression.AnalysationIssue; -import org.eclipse.gmf.internal.xpand.expression.EvaluationException; -import org.eclipse.gmf.internal.xpand.expression.ExecutionContext; -import org.eclipse.gmf.internal.xpand.expression.SyntaxConstants; - -/** - * @author Sven Efftinge - * @author Arno Haase - */ -public class StaticFeatureCall extends Expression { - private Identifier type; - - private Identifier feature; - - public StaticFeatureCall(final int start, final int end, final int line, final Identifier type, - final Identifier feature) { - super(start, end, line); - this.type = type; - this.feature = feature; - } - - public Identifier getFeature() { - return feature; - } - - public Identifier getEClassifier() { - return type; - } - - @Override - public Object evaluateInternal(final ExecutionContext ctx) { - final EClassifier targetEClassifier = ctx.getTypeForName(type.getValue()); - if (targetEClassifier == null) { - throw new EvaluationException("Unknown type : " + type.getValue(), type); - } - if (false == (targetEClassifier instanceof EEnum)) { - throw new EvaluationException("Enum type expected instead of " + type.getValue(), type); - } - final EEnumLiteral sp = ((EEnum) targetEClassifier).getEEnumLiteral(getFeature().getValue()); - if (sp == null) { - throw new EvaluationException("Unknown enumeration literal : " + toString(), type); - } - return sp.getValue(); - } - - public EClassifier analyze(final ExecutionContext ctx, final Set<AnalysationIssue> issues) { - final EClassifier targetEClassifier = ctx.getTypeForName(type.getValue()); - if (targetEClassifier == null) { - issues.add(new AnalysationIssue(AnalysationIssue.TYPE_NOT_FOUND, "Unknown type : " + type.getValue(), type)); - return null; - } - if (false == (targetEClassifier instanceof EEnum)) { - issues.add(new AnalysationIssue(AnalysationIssue.INCOMPATIBLE_TYPES, "Enum type expected instead of " + type.getValue(), type)); - return null; - } - - final EEnumLiteral sp = ((EEnum) targetEClassifier).getEEnumLiteral(getFeature().getValue()); - if (sp == null) { - issues.add(new AnalysationIssue(AnalysationIssue.FEATURE_NOT_FOUND, "Unknown enumeration literal : " + toString(), type)); - return null; - } - return BuiltinMetaModel.getReturnType(sp); - } - - @Override - public String toString() { - return type + SyntaxConstants.NS_DELIM + feature; - } - -} |