Search in sources :

Example 6 with Exp

use of abs.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method newExp.

@Test
public void newExp() {
    Exp e = getSecondExp("class C(Bool b) {}  { Bool b = True; new local C(b); }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 7 with Exp

use of abs.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method caseExp.

@Test
public void caseExp() {
    Exp e = getSecondExp("{ Bool b = True; Bool c = case True { y => y; }; }");
    assertTrue(e.getFreeVars().isEmpty());
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 8 with Exp

use of abs.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method binaryExp3.

@Test
public void binaryExp3() {
    Exp e = getSecondExp("{ Bool b = True; Bool c = b == b; }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 9 with Exp

use of abs.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method letExp2.

@Test
public void letExp2() {
    Exp e = getSecondExp("{ Bool b = True; Bool c = let (Bool d) = b in d; }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 10 with Exp

use of abs.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method unaryExp.

@Test
public void unaryExp() {
    Exp e = getSecondExp("{ Bool b = True; Bool c = !b; }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Aggregations

Exp (abs.frontend.ast.Exp)24 FrontendTest (abs.frontend.FrontendTest)22 Test (org.junit.Test)22 PureExp (abs.frontend.ast.PureExp)2 ABSData (apet.testCases.ABSData)2 PreviousCall (apet.testCases.PreviousCall)2 Block (abs.frontend.ast.Block)1 ClassDecl (abs.frontend.ast.ClassDecl)1 DataTypeUse (abs.frontend.ast.DataTypeUse)1 EqExp (abs.frontend.ast.EqExp)1 InterfaceTypeUse (abs.frontend.ast.InterfaceTypeUse)1 MethodImpl (abs.frontend.ast.MethodImpl)1 NullExp (abs.frontend.ast.NullExp)1 ReturnStmt (abs.frontend.ast.ReturnStmt)1 Stmt (abs.frontend.ast.Stmt)1 VarUse (abs.frontend.ast.VarUse)1 ABSObject (apet.testCases.ABSObject)1 ABSRef (apet.testCases.ABSRef)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1