Search in sources :

Example 1 with TAnnotationArgument

use of org.eclipse.n4js.ts.types.TAnnotationArgument in project n4js by eclipse.

the class TypeStatesAnalyser method getDeclaredStates.

private Set<String> getDeclaredStates(ControlFlowElement container, String stateName) {
    Set<String> states = new HashSet<>();
    if (container instanceof ParameterizedCallExpression) {
        ParameterizedCallExpression pce = (ParameterizedCallExpression) container;
        TFunction tFunc = (TFunction) ts.tau(pce);
        for (TAnnotation ann : tFunc.getAnnotations()) {
            if (stateName.equals(ann.getName())) {
                for (TAnnotationArgument arg : ann.getArgs()) {
                    states.add(arg.getArgAsString());
                }
            }
        }
    }
    return states;
}
Also used : TFunction(org.eclipse.n4js.ts.types.TFunction) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) TAnnotationArgument(org.eclipse.n4js.ts.types.TAnnotationArgument) HashSet(java.util.HashSet) TAnnotation(org.eclipse.n4js.ts.types.TAnnotation)

Aggregations

HashSet (java.util.HashSet)1 ParameterizedCallExpression (org.eclipse.n4js.n4JS.ParameterizedCallExpression)1 TAnnotation (org.eclipse.n4js.ts.types.TAnnotation)1 TAnnotationArgument (org.eclipse.n4js.ts.types.TAnnotationArgument)1 TFunction (org.eclipse.n4js.ts.types.TFunction)1