예제 #1
0
    private void Initialize() {
      // create all symbols
      var sum = new Sum();
      var prog = new Prog();
      var frog = new Frog();
      var left = new Left();
      var forward = new Forward();
      var constant = new Constant();

      var allSymbols = new List<ISymbol>() { sum, prog, frog, left, forward, constant };

      // add all symbols to the grammar
      foreach (var s in allSymbols)
        AddSymbol(s);

      // define grammar rules
      foreach (var s in allSymbols) {
        AddAllowedChildSymbol(sum, s);
        AddAllowedChildSymbol(sum, s);
        AddAllowedChildSymbol(prog, s);
        AddAllowedChildSymbol(prog, s);
        AddAllowedChildSymbol(frog, s);
        AddAllowedChildSymbol(StartSymbol, s);
      }
    }
예제 #2
0
        private void Initialize()
        {
            // create all symbols
            var sum      = new Sum();
            var prog     = new Prog();
            var frog     = new Frog();
            var left     = new Left();
            var forward  = new Forward();
            var constant = new Constant();

            var allSymbols = new List <ISymbol>()
            {
                sum, prog, frog, left, forward, constant
            };

            // add all symbols to the grammar
            foreach (var s in allSymbols)
            {
                AddSymbol(s);
            }

            // define grammar rules
            foreach (var s in allSymbols)
            {
                AddAllowedChildSymbol(sum, s);
                AddAllowedChildSymbol(sum, s);
                AddAllowedChildSymbol(prog, s);
                AddAllowedChildSymbol(prog, s);
                AddAllowedChildSymbol(frog, s);
                AddAllowedChildSymbol(StartSymbol, s);
            }
        }
예제 #3
0
 private Forward(Forward original, Cloner cloner)
     : base(original, cloner)
 {
 }
예제 #4
0
 private Forward(Forward original, Cloner cloner)
   : base(original, cloner) {
 }