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); }
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); }
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); }