Search in sources :

Example 16 with Start

use of de.be4.ltl.core.ctlparser.node.Start in project probparsers by bendisposto.

the class CreateFreetypeTest method printProlog.

private void printProlog(final IPrologTermOutput pto) {
    final Start machine = createMachine(MACHINE_NAME);
    final ASTProlog printer = new ASTProlog(pto, null);
    machine.apply(printer);
}
Also used : ASTProlog(de.be4.classicalb.core.parser.analysis.prolog.ASTProlog) Start(de.be4.classicalb.core.parser.node.Start)

Example 17 with Start

use of de.be4.ltl.core.ctlparser.node.Start in project probparsers by bendisposto.

the class RulesTransformation method runTransformation.

public void runTransformation() throws BCompoundException {
    start.apply(this);
    DefinitionInjector.injectDefinitions(start, iDefinitions);
    MissingPositionsAdder.injectPositions(start);
    if (!this.errorList.isEmpty()) {
        List<BException> list = new ArrayList<>();
        for (CheckException checkException : this.errorList) {
            list.add(new BException(this.rulesMachineChecker.getFileName(), checkException));
        }
        throw new BCompoundException(list);
    }
}
Also used : CheckException(de.be4.classicalb.core.parser.exceptions.CheckException) ArrayList(java.util.ArrayList) BException(de.be4.classicalb.core.parser.exceptions.BException) BCompoundException(de.be4.classicalb.core.parser.exceptions.BCompoundException)

Example 18 with Start

use of de.be4.ltl.core.ctlparser.node.Start in project probparsers by bendisposto.

the class OpPatternTest method checkParser.

private void checkParser(final String description, final String oppattern, final String expected) throws BCompoundException {
    final Start ast = parser.parse(BParser.OPERATION_PATTERN_PREFIX + oppattern, false);
    final Ast2String ast2String = new Ast2String();
    ast.apply(ast2String);
    final String parsed = ast2String.toString();
    assertEquals(description, "Start(AOppatternParseUnit(" + expected + "))", parsed);
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) Ast2String(util.Ast2String) Ast2String(util.Ast2String)

Example 19 with Start

use of de.be4.ltl.core.ctlparser.node.Start in project probparsers by bendisposto.

the class ParseableButProblematicOnWindows method testParsable.

@Test
public void testParsable() throws Exception {
    final BParser parser = new BParser(machine.getName());
    Start start = parser.parseFile(machine, false);
    start.apply(new PositionTester());
    assertNotNull(start);
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) AbstractParseMachineTest(util.AbstractParseMachineTest) Test(org.junit.Test)

Example 20 with Start

use of de.be4.ltl.core.ctlparser.node.Start in project probparsers by bendisposto.

the class ParseableButProblematicOnWindowsWindowsLF method testParsable.

@Test
public void testParsable() throws Exception {
    final BParser parser = new BParser(machine.getName());
    Start start = parser.parseFile(machine, false);
    start.apply(new PositionTester());
    assertNotNull(start);
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) AbstractParseMachineTest(util.AbstractParseMachineTest) Test(org.junit.Test)

Aggregations

Start (de.be4.classicalb.core.parser.node.Start)104 Test (org.junit.Test)84 BParser (de.be4.classicalb.core.parser.BParser)43 Ast2String (util.Ast2String)32 File (java.io.File)20 Start (de.be4.eventbalg.core.parser.node.Start)19 BCompoundException (de.be4.classicalb.core.parser.exceptions.BCompoundException)18 Start (de.be4.eventb.core.parser.node.Start)18 AMachineParseUnit (de.be4.eventb.core.parser.node.AMachineParseUnit)14 AMachineParseUnit (de.be4.eventbalg.core.parser.node.AMachineParseUnit)14 IOException (java.io.IOException)12 RecursiveMachineLoader (de.be4.classicalb.core.parser.analysis.prolog.RecursiveMachineLoader)11 PushbackReader (java.io.PushbackReader)11 StringReader (java.io.StringReader)11 ASTProlog (de.be4.classicalb.core.parser.analysis.prolog.ASTProlog)8 AExpressionParseUnit (de.be4.classicalb.core.parser.node.AExpressionParseUnit)7 AbstractParseMachineTest (util.AbstractParseMachineTest)7 ParsingBehaviour (de.be4.classicalb.core.parser.ParsingBehaviour)6 ClassicalPositionPrinter (de.be4.classicalb.core.parser.analysis.prolog.ClassicalPositionPrinter)6 ASTPrinter (de.be4.classicalb.core.parser.visualisation.ASTPrinter)6