protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner)
            : base(original, cloner)
        {
            emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);

            foreach (ISymbol symbol in symbols.Values)
            {
                RegisterSymbolEvents(symbol);
            }

            programRootSymbol = cloner.Clone(original.programRootSymbol);
            startSymbol       = cloner.Clone(original.StartSymbol);
            defunSymbol       = cloner.Clone(original.defunSymbol);

            maximumFunctionArguments   = original.maximumFunctionArguments;
            minimumFunctionArguments   = original.minimumFunctionArguments;
            maximumFunctionDefinitions = original.maximumFunctionDefinitions;
            minimumFunctionDefinitions = original.minimumFunctionDefinitions;
        }
        protected SymbolicExpressionGrammar(string name, string description)
            : base(name, description)
        {
            emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);

            programRootSymbol = new ProgramRootSymbol();
            AddSymbol(programRootSymbol);
            SetSubtreeCount(programRootSymbol, 1, 1);

            startSymbol = new StartSymbol();
            AddSymbol(startSymbol);
            SetSubtreeCount(startSymbol, 1, 1);

            defunSymbol = new Defun();
            AddSymbol(defunSymbol);
            SetSubtreeCount(defunSymbol, 1, 1);

            AddAllowedChildSymbol(programRootSymbol, startSymbol, 0);
            UpdateAdfConstraints();
        }
Beispiel #3
0
 private Defun(Defun original, Cloner cloner) : base(original, cloner)
 {
 }
Beispiel #4
0
 public DefunTreeNode(Defun defunSymbol) : base(defunSymbol)
 {
 }
Beispiel #5
0
 private Defun(Defun original, Cloner cloner) : base(original, cloner) { }
 public DefunTreeNode(Defun defunSymbol) : base(defunSymbol) { }
    protected SymbolicExpressionGrammar(string name, string description)
      : base(name, description) {
      emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);

      programRootSymbol = new ProgramRootSymbol();
      AddSymbol(programRootSymbol);
      SetSubtreeCount(programRootSymbol, 1, 1);

      startSymbol = new StartSymbol();
      AddSymbol(startSymbol);
      SetSubtreeCount(startSymbol, 1, 1);

      defunSymbol = new Defun();
      AddSymbol(defunSymbol);
      SetSubtreeCount(defunSymbol, 1, 1);

      AddAllowedChildSymbol(programRootSymbol, startSymbol, 0);
      UpdateAdfConstraints();
    }
    protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner)
      : base(original, cloner) {
      emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);

      foreach (ISymbol symbol in symbols.Values)
        RegisterSymbolEvents(symbol);

      programRootSymbol = cloner.Clone(original.programRootSymbol);
      startSymbol = cloner.Clone(original.StartSymbol);
      defunSymbol = cloner.Clone(original.defunSymbol);

      maximumFunctionArguments = original.maximumFunctionArguments;
      minimumFunctionArguments = original.minimumFunctionArguments;
      maximumFunctionDefinitions = original.maximumFunctionDefinitions;
      minimumFunctionDefinitions = original.minimumFunctionDefinitions;
    }