Ejemplo n.º 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);
      }
    }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 private Prog(Prog original, Cloner cloner)
   : base(original, cloner) {
 }
Ejemplo n.º 4
0
 private Prog(Prog original, Cloner cloner)
     : base(original, cloner)
 {
 }