Beispiel #1
0
        public void MakeGrammarTest_Right()
        {
            Symbol symbolA = new Symbol('a');
            Symbol symbolB = new Symbol('b');
            Symbol symbolC = new Symbol('c');

            BinaryConcat   concat1         = new BinaryConcat(symbolA, symbolB);
            Iteration      iteration1      = new Iteration(concat1, false);
            ConstIteration constIteration1 = new ConstIteration(iteration1, 0);

            BinaryConcat   concat2         = new BinaryConcat(symbolA, symbolC);
            Iteration      iteration2      = new Iteration(concat2, false);
            ConstIteration constIteration2 = new ConstIteration(iteration2, 1);

            BinaryConcat   concat3         = new BinaryConcat(symbolB, symbolC);
            Iteration      iteration3      = new Iteration(concat3, false);
            ConstIteration constIteration3 = new ConstIteration(iteration3, 3);

            BinaryUnion union1 = new BinaryUnion(constIteration1, constIteration2);
            BinaryUnion union2 = new BinaryUnion(union1, constIteration3);

            IList <GrammarPostReport> reports = new List <GrammarPostReport>();

            FLaGLib.Data.Grammars.Grammar grammar = union2.MakeGrammar(FLaGLib.Data.Grammars.GrammarType.Right,
                                                                       d => reports.Add(d));

            Assert.Fail("Not Implemented");
        }
Beispiel #2
0
        public void MakeStateMachineTest()
        {
            Symbol symbolA = new Symbol('a');
            Symbol symbolB = new Symbol('b');
            Symbol symbolC = new Symbol('c');

            BinaryConcat   concat1         = new BinaryConcat(symbolA, symbolB);
            Iteration      iteration1      = new Iteration(concat1, false);
            ConstIteration constIteration1 = new ConstIteration(iteration1, 0);

            BinaryConcat   concat2         = new BinaryConcat(symbolA, symbolC);
            Iteration      iteration2      = new Iteration(concat2, false);
            ConstIteration constIteration2 = new ConstIteration(iteration2, 1);

            BinaryConcat   concat3         = new BinaryConcat(symbolB, symbolC);
            Iteration      iteration3      = new Iteration(concat3, false);
            ConstIteration constIteration3 = new ConstIteration(iteration3, 3);

            BinaryUnion union1 = new BinaryUnion(constIteration1, constIteration2);
            BinaryUnion union2 = new BinaryUnion(union1, constIteration3);

            IList <StateMachinePostReport> reports = new List <StateMachinePostReport>();

            FLaGLib.Data.StateMachines.StateMachine stateMachine = union2.MakeStateMachine(d => reports.Add(d));

            Assert.Fail("Not Implemented");
        }
Beispiel #3
0
        public void ToStringTest()
        {
            BinaryUnion binaryUnion = new BinaryUnion(new Symbol('a'), new Symbol('b'));

            Assert.AreEqual("a + b", binaryUnion.ToString());
        }
Beispiel #4
0
 public void CctorTest_Ok()
 {
     BinaryUnion binatyUnion = new BinaryUnion(new Symbol('a'), new Symbol('b'));
 }