Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/FallbackParser.java @ 20941:4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 15:16:14 +0200 |
parents | |
children |
rev | line source |
---|---|
20941
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.dsl.processor.parser; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
25 import java.lang.annotation.*; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
26 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import javax.lang.model.element.*; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 import com.oracle.truffle.api.dsl.*; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
30 import com.oracle.truffle.dsl.processor.*; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 import com.oracle.truffle.dsl.processor.model.*; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 import com.oracle.truffle.dsl.processor.model.SpecializationData.SpecializationKind; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 public class FallbackParser extends NodeMethodParser<SpecializationData> { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 public FallbackParser(ProcessorContext context, NodeData node) { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 super(context, node); |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
38 } |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
39 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 @Override |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
41 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 return createDefaultMethodSpec(method, mirror, true, null); |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 } |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 @Override |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 protected ParameterSpec createValueParameterSpec(NodeExecutionData execution) { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 ParameterSpec parameterSpec = super.createValueParameterSpec(execution); |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
48 parameterSpec.setAllowSubclasses(false); |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 return parameterSpec; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 } |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 @Override |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
53 public SpecializationData create(TemplateMethod method, boolean invalid) { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 return new SpecializationData(getNode(), method, SpecializationKind.FALLBACK); |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 } |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 @Override |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 public Class<? extends Annotation> getAnnotationType() { |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
59 return Fallback.class; |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
60 } |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
61 |
4f45e4d3361c
Truffle-DSL: rename GenericParser to Fallbackparser.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
62 } |