Search in sources :

Example 36 with Xnode

use of claw.tatsu.xcodeml.xnode.common.Xnode in project claw-compiler by C2SM-RCM.

the class XmlHelper method createXpragma.

public static Xnode createXpragma() {
    String xml = "<" + Xname.F_PRAGMA_STMT + "></" + Xname.F_PRAGMA_STMT + ">";
    Xnode n = XmlHelper.getElementFromString(xml);
    assertNotNull(n);
    return n;
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode)

Example 37 with Xnode

use of claw.tatsu.xcodeml.xnode.common.Xnode in project claw-compiler by C2SM-RCM.

the class XmlHelper method createXdeclTable.

public static XdeclTable createXdeclTable(String xml) {
    Xnode n = XmlHelper.getElementFromString(xml);
    assertNotNull(n);
    return new XdeclTable(n);
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) XdeclTable(claw.tatsu.xcodeml.xnode.common.XdeclTable)

Example 38 with Xnode

use of claw.tatsu.xcodeml.xnode.common.Xnode in project claw-compiler by C2SM-RCM.

the class XmlHelper method createXfctTypeFromString.

public static FfunctionType createXfctTypeFromString(String xml) {
    Xnode n = XmlHelper.getElementFromString(xml);
    assertNotNull(n);
    return new FfunctionType(n);
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) FfunctionType(claw.tatsu.xcodeml.xnode.fortran.FfunctionType)

Example 39 with Xnode

use of claw.tatsu.xcodeml.xnode.common.Xnode in project claw-compiler by C2SM-RCM.

the class XmlHelper method createXbasicTypeFromString.

public static FbasicType createXbasicTypeFromString(String xml) {
    Xnode n = XmlHelper.getElementFromString(xml);
    assertNotNull(n);
    return new FbasicType(n);
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) FbasicType(claw.tatsu.xcodeml.xnode.fortran.FbasicType)

Example 40 with Xnode

use of claw.tatsu.xcodeml.xnode.common.Xnode in project claw-compiler by C2SM-RCM.

the class ClawRangeTest method compareWithLoopIterationRangeTest.

@Test
public void compareWithLoopIterationRangeTest() {
    Xnode iterationRange1 = XmlHelper.createXnode(beginLoop + inductionVar1 + indexRange1 + endLoop);
    assertNotNull(iterationRange1);
    Xnode iterationRange2 = XmlHelper.createXnode(beginLoop + inductionVar1 + indexRange2 + endLoop);
    assertNotNull(iterationRange1);
    ClawRange range1 = new ClawRange("i", "1", "10", "1");
    assertTrue(range1.compareToDoStmt(iterationRange1));
    assertFalse(range1.compareToDoStmt(iterationRange2));
    ClawRange range2 = new ClawRange("i", "1", "10", "2");
    assertFalse(range2.compareToDoStmt(iterationRange1));
    assertFalse(range2.compareToDoStmt(iterationRange2));
    ClawRange range3 = new ClawRange("i", "1", "11", "1");
    assertFalse(range3.compareToDoStmt(iterationRange1));
    assertFalse(range3.compareToDoStmt(iterationRange2));
    ClawRange range4 = new ClawRange("i", "2", "10", "1");
    assertFalse(range4.compareToDoStmt(iterationRange1));
    assertFalse(range4.compareToDoStmt(iterationRange2));
    ClawRange range5 = new ClawRange("j", "1", "10", "1");
    assertFalse(range5.compareToDoStmt(iterationRange1));
    assertFalse(range5.compareToDoStmt(iterationRange2));
    ClawRange range6 = new ClawRange("i", "istart", "iend", "1");
    assertTrue(range6.compareToDoStmt(iterationRange2));
    assertFalse(range6.compareToDoStmt(iterationRange1));
    ClawRange range7 = new ClawRange("i", "istart", "iend", "2");
    assertFalse(range7.compareToDoStmt(iterationRange2));
    assertFalse(range7.compareToDoStmt(iterationRange1));
    ClawRange range8 = new ClawRange("i", "istart", "ieend", "1");
    assertFalse(range8.compareToDoStmt(iterationRange2));
    assertFalse(range8.compareToDoStmt(iterationRange1));
    ClawRange range9 = new ClawRange("i", "istarter", "iend", "1");
    assertFalse(range9.compareToDoStmt(iterationRange2));
    assertFalse(range9.compareToDoStmt(iterationRange1));
    ClawRange range10 = new ClawRange("j", "istart", "iend", "1");
    assertFalse(range10.compareToDoStmt(iterationRange2));
    assertFalse(range10.compareToDoStmt(iterationRange1));
    ClawRange range11 = new ClawRange();
    range11.setInductionVar("i");
    range11.setLowerBound("istart");
    range11.setUpperBound("iend");
    assertTrue(range11.compareToDoStmt(iterationRange2));
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) ClawRange(claw.wani.language.ClawRange) Test(org.junit.Test)

Aggregations

Xnode (claw.tatsu.xcodeml.xnode.common.Xnode)124 Context (claw.tatsu.common.Context)29 IllegalTransformationException (claw.tatsu.xcodeml.exception.IllegalTransformationException)24 Test (org.junit.Test)24 XcodeProgram (claw.tatsu.xcodeml.xnode.common.XcodeProgram)20 TestContext (helper.Utils.TestContext)20 ArrayList (java.util.ArrayList)18 FfunctionDefinition (claw.tatsu.xcodeml.xnode.fortran.FfunctionDefinition)17 Xblock (claw.tatsu.xcodeml.abstraction.Xblock)9 FunctionCall (claw.tatsu.xcodeml.abstraction.FunctionCall)8 Xid (claw.tatsu.xcodeml.xnode.common.Xid)8 FbasicType (claw.tatsu.xcodeml.xnode.fortran.FbasicType)8 HashSet (java.util.HashSet)7 PromotionInfo (claw.tatsu.xcodeml.abstraction.PromotionInfo)6 FfunctionType (claw.tatsu.xcodeml.xnode.fortran.FfunctionType)6 NestedDoStatement (claw.tatsu.xcodeml.abstraction.NestedDoStatement)5 ClawPragma (claw.wani.language.ClawPragma)5 ClawTranslator (claw.wani.x2t.translator.ClawTranslator)5 NodeList (org.w3c.dom.NodeList)5 DirectiveGenerator (claw.tatsu.directive.generator.DirectiveGenerator)4