Mercurial > hg > truffle
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/MethodSpecParser.java @ 20938:18c0f02fa4d2
Truffle-DSL: make type systems optional.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 15:12:48 +0200 |
parents | 62c43fcf5be2 |
children | 476374f3fe9a |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/MethodSpecParser.java Tue Apr 14 22:12:03 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/MethodSpecParser.java Tue Apr 14 15:12:48 2015 +0200 @@ -48,10 +48,6 @@ return template; } - public TypeSystemData getTypeSystem() { - return template.getTypeSystem(); - } - public boolean isEmitErrors() { return emitErrors; } @@ -135,7 +131,7 @@ * end matching the required arguments, parsing fails. Parameters prior to the parsed required * ones are cut and used to parse the optional parameters. */ - private List<Parameter> parseParameters(MethodSpec spec, List<? extends VariableElement> parameterTypes, boolean varArgs) { + private static List<Parameter> parseParameters(MethodSpec spec, List<? extends VariableElement> parameterTypes, boolean varArgs) { List<Parameter> parsedRequired = null; int offset = 0; for (; offset <= parameterTypes.size(); offset++) { @@ -166,7 +162,7 @@ return finalParameters; } - private List<Parameter> parseParametersOptional(MethodSpec spec, List<? extends VariableElement> types) { + private static List<Parameter> parseParametersOptional(MethodSpec spec, List<? extends VariableElement> types) { List<Parameter> parsedParams = new ArrayList<>(); int typeStartIndex = 0; @@ -191,7 +187,7 @@ return parsedParams; } - private List<Parameter> parseParametersRequired(MethodSpec spec, List<VariableElement> types, boolean typeVarArgs) { + private static List<Parameter> parseParametersRequired(MethodSpec spec, List<VariableElement> types, boolean typeVarArgs) { List<Parameter> parsedParams = new ArrayList<>(); List<ParameterSpec> specifications = spec.getRequired(); boolean specVarArgs = spec.isVariableRequiredParameters(); @@ -248,7 +244,7 @@ return parsedParams; } - private Parameter matchAnnotatedParameter(MethodSpec spec, VariableElement variable) { + private static Parameter matchAnnotatedParameter(MethodSpec spec, VariableElement variable) { for (ParameterSpec parameterSpec : spec.getAnnotations()) { if (parameterSpec.matches(variable)) { Parameter matchedParameter = matchParameter(parameterSpec, variable, -1, -1); @@ -286,7 +282,7 @@ } } - private Parameter matchParameter(ParameterSpec specification, VariableElement variable, int specificationIndex, int varArgsIndex) { + private static Parameter matchParameter(ParameterSpec specification, VariableElement variable, int specificationIndex, int varArgsIndex) { TypeMirror resolvedType = variable.asType(); if (hasError(resolvedType)) { return null; @@ -296,12 +292,6 @@ return null; } - TypeData resolvedTypeData = getTypeSystem().findTypeData(resolvedType); - if (resolvedTypeData != null) { - return new Parameter(specification, resolvedTypeData, variable, specificationIndex, varArgsIndex); - } else { - return new Parameter(specification, variable, specificationIndex, varArgsIndex); - } + return new Parameter(specification, variable, specificationIndex, varArgsIndex); } - }