Search in sources :

Example 6 with NestedDoStatement

use of claw.tatsu.xcodeml.abstraction.NestedDoStatement in project claw-compiler by C2SM-RCM.

the class ScaForward method analyze.

@Override
public boolean analyze(XcodeProgram xcodeml, Translator translator) {
    Xnode next = _claw.getPragma().nextSibling();
    if (next == null) {
        xcodeml.addError("Directive is not followed by a valid statement.", _claw.getPragma());
        return false;
    }
    if (Xnode.isOfCode(next, Xcode.EXPR_STATEMENT) || Xnode.isOfCode(next, Xcode.F_ASSIGN_STATEMENT)) {
        _isNestedInAssignment = Xnode.isOfCode(next, Xcode.F_ASSIGN_STATEMENT);
        Xnode fctCallNode = next.matchSeq(Xcode.FUNCTION_CALL);
        if (fctCallNode != null) {
            _fCall = new FunctionCall(fctCallNode);
            return analyzeForward(xcodeml);
        }
    } else if (Xnode.isOfCode(next, Xcode.F_DO_STATEMENT)) {
        _doStatements = new NestedDoStatement(next);
        return analyzeForwardWithDo(xcodeml);
    }
    xcodeml.addError("Directive is not followed by a valid statement.", _claw.getPragma());
    return false;
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) NestedDoStatement(claw.tatsu.xcodeml.abstraction.NestedDoStatement) FunctionCall(claw.tatsu.xcodeml.abstraction.FunctionCall)

Aggregations

NestedDoStatement (claw.tatsu.xcodeml.abstraction.NestedDoStatement)6 Xnode (claw.tatsu.xcodeml.xnode.common.Xnode)5 PromotionInfo (claw.tatsu.xcodeml.abstraction.PromotionInfo)2 IllegalTransformationException (claw.tatsu.xcodeml.exception.IllegalTransformationException)2 Context (claw.tatsu.common.Context)1 AcceleratorConfiguration (claw.tatsu.directive.configuration.AcceleratorConfiguration)1 DimensionDefinition (claw.tatsu.xcodeml.abstraction.DimensionDefinition)1 FunctionCall (claw.tatsu.xcodeml.abstraction.FunctionCall)1 Xblock (claw.tatsu.xcodeml.abstraction.Xblock)1 FfunctionDefinition (claw.tatsu.xcodeml.xnode.fortran.FfunctionDefinition)1