예제 #1
0
파일: MetaGdl.cs 프로젝트: druzil/nggp-base
        private void ExamineAtomTerm(GdlAtom atom)
        {
            // if it's a variable, do nothing with it.
            /*if ( atom instanceof GdlVariable )
                return;*/

            int token = atom.GetToken();

            //TODO: This term must be an object constant. Make sure it is.
            //if (IsFunctionSymbol(token) || IsRelationSymbol(token))
            //    throw new Exception(string.Format("Symbol '{0}' ({1}) already exists, but not as an object symbol!", token, _parser.SymbolTable[token]));

            // Add it to our list of object symbols
            AddObjectSymbol(token);
        }
예제 #2
0
파일: MetaGdl.cs 프로젝트: druzil/nggp-base
        private void ExamineTopLevelAtom(GdlAtom atom)
        {
            int token = atom.GetToken();

            // This probably never happens. . . so make a note of it
            Console.WriteLine("WE GOT A TOP LEVEL ATOM!! " + _parser.SymbolTable[token]);

            //TODO: Make sure this symbol isn't a function/object symbol already.
            //if (IsFunctionSymbol(token) || IsObjectSymbol(token))
            //    throw new Exception(string.Format("Symbol '{0}' ({1}) already exists, but not as a relation symbol!", token, _parser.SymbolTable[token]));

            // It's a top level atom, so it has to be a relation symbol
            AddRelationSymbol(token, 0);
        }
예제 #3
0
파일: MetaGdl.cs 프로젝트: druzil/nggp-base
        private Expression ExamineAtomRelation(GdlAtom atom)
        {
            int relName = atom.GetToken();

            //TODO: Make sure this symbol isn't a function/object symbol already.
            //if (IsFunctionSymbol(relName) || IsObjectSymbol(relName))
            //    throw new Exception(string.Format("Symbol '{0}' ({1}) already exists, but not as a relation symbol!", relName, _parser.SymbolTable[relName]));

            // Add to relation name to our list of relation symbols
            AddRelationSymbol(relName, 0);

            return GroundFact.FromExpression(atom);
        }