Search in sources :

Example 1 with ABSParserWrapper

use of abs.frontend.antlr.parser.ABSParserWrapper in project abstools by abstools.

the class ParserTest method entry_deltadecl.

@Test
public void entry_deltadecl() throws Exception {
    CompilationUnit u = new ABSParserWrapper().parse(new StringReader("delta Mon;"));
    DeltaDecl d = (DeltaDecl) u.getDeltaDecl(0);
    Assert.assertNotNull(d);
}
Also used : CompilationUnit(abs.frontend.ast.CompilationUnit) ABSParserWrapper(abs.frontend.antlr.parser.ABSParserWrapper) StringReader(java.io.StringReader) DeltaDecl(abs.frontend.ast.DeltaDecl) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 2 with ABSParserWrapper

use of abs.frontend.antlr.parser.ABSParserWrapper in project abstools by abstools.

the class ParserTest method testIllegalCharacter.

@Test(expected = ParseException.class)
public void testIllegalCharacter() throws Exception {
    String functionDecl = "module LexicalTest; def Bool æåëßfë() = True;";
    new ABSParserWrapper(null, true, false).parse(new StringReader(functionDecl));
}
Also used : ABSParserWrapper(abs.frontend.antlr.parser.ABSParserWrapper) StringReader(java.io.StringReader) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Example 3 with ABSParserWrapper

use of abs.frontend.antlr.parser.ABSParserWrapper in project abstools by abstools.

the class PrettyPrinterTests method prettyPrinterAddDataTypeModifierTest.

@Test
public void prettyPrinterAddDataTypeModifierTest() throws Exception {
    String deltaDecl = "delta Foo;adds data States=F|B|I|M;";
    DeltaDecl d = (DeltaDecl) new ABSParserWrapper(null, true, false).parse(new StringReader(deltaDecl)).getDeltaDecl(0);
    assertEquals("deltaFoo;addsdataStates=F|B|I|M;", replaceWhitespaceChars(prettyPrint(d)));
}
Also used : ABSParserWrapper(abs.frontend.antlr.parser.ABSParserWrapper) StringReader(java.io.StringReader) DeltaDecl(abs.frontend.ast.DeltaDecl) Test(org.junit.Test) ABSTest(abs.ABSTest)

Example 4 with ABSParserWrapper

use of abs.frontend.antlr.parser.ABSParserWrapper in project abstools by abstools.

the class ParserTest method deltaNameLowerCaseTest.

@Test(expected = ParseException.class)
public void deltaNameLowerCaseTest() throws Exception {
    String deltaDecl = "delta foo;";
    new ABSParserWrapper(null, true, false).parse(new StringReader(deltaDecl));
}
Also used : ABSParserWrapper(abs.frontend.antlr.parser.ABSParserWrapper) StringReader(java.io.StringReader) Test(org.junit.Test) FrontendTest(abs.frontend.FrontendTest)

Aggregations

ABSParserWrapper (abs.frontend.antlr.parser.ABSParserWrapper)4 StringReader (java.io.StringReader)4 Test (org.junit.Test)4 FrontendTest (abs.frontend.FrontendTest)3 DeltaDecl (abs.frontend.ast.DeltaDecl)2 ABSTest (abs.ABSTest)1 CompilationUnit (abs.frontend.ast.CompilationUnit)1