Search in sources :

Example 1 with AnalyzedPragma

use of claw.shenron.translator.AnalyzedPragma in project claw-compiler by C2SM-RCM.

the class TransformationAndGroupTest method basicTransformationTest.

@Test
public void basicTransformationTest() {
    Transformation t1 = new T1();
    assertTrue(t1.abortOnFailedAnalysis());
    assertEquals(0, t1.getStartLine());
    t1.setStartLine(10);
    assertEquals(10, t1.getStartLine());
    assertNull(t1.getDirective());
    assertFalse(t1.isTransformed());
    Context context = new TestContext();
    XcodeProgram xcodeml = XmlHelper.getDummyXcodeProgram(context);
    Xnode pragma = xcodeml.createNode(Xcode.F_PRAGMA_STATEMENT);
    pragma.setLine(10);
    t1 = new T1(new AnalyzedPragma(pragma));
    assertNotNull(t1.getDirective());
    assertNotNull(t1.getDirective().getPragma());
    assertEquals(10, t1.getStartLine());
}
Also used : Context(claw.tatsu.common.Context) TestContext(helper.Utils.TestContext) Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) TestContext(helper.Utils.TestContext) XcodeProgram(claw.tatsu.xcodeml.xnode.common.XcodeProgram) AnalyzedPragma(claw.shenron.translator.AnalyzedPragma) Test(org.junit.Test)

Aggregations

AnalyzedPragma (claw.shenron.translator.AnalyzedPragma)1 Context (claw.tatsu.common.Context)1 XcodeProgram (claw.tatsu.xcodeml.xnode.common.XcodeProgram)1 Xnode (claw.tatsu.xcodeml.xnode.common.Xnode)1 TestContext (helper.Utils.TestContext)1 Test (org.junit.Test)1