Search in sources :

Example 1 with Exp

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

the class FreeVarTest method binaryExp.

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

Example 2 with Exp

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

the class FreeVarTest method callExp2.

@Test
public void callExp2() {
    Exp e = getExp("interface I { Unit m(Bool b); } { Bool b = True; I i; Bool c = i.m(True); }", 2);
    assertEquals(e.getFreeVars(), "i");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 3 with Exp

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

the class FreeVarTest method ifExpr.

@Test
public void ifExpr() {
    Exp e = getExp("{ Int x = 3; Int y = 4; Int z = 5; Int a = if x == 3 then y else z; }", 3);
    assertEquals(e.getFreeVars(), "x", "y", "z");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 4 with Exp

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

the class FreeVarTest method asyncCallExp.

@Test
public void asyncCallExp() {
    Exp e = getExp("interface I { Unit m(Bool b); } { Bool b = True; I i; Bool c = i!m(b); }", 2);
    assertEquals(e.getFreeVars(), "i", "b");
}
Also used : Exp(abs.frontend.ast.Exp) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 5 with Exp

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

the class FreeVarTest method binaryExp2.

@Test
public void binaryExp2() {
    Exp e = getSecondExp("{ Bool b = True; Bool c = True != 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