--- trunk/src/selection/SelectionCompiler.hpp 2005/02/02 23:13:11 281 +++ trunk/src/selection/SelectionCompiler.hpp 2005/04/05 23:09:48 452 @@ -66,7 +66,7 @@ namespace oopse { clausePrimitive ::= clauseComparator | clauseWithin | - clauseChemObject | + clauseName | none | all | ( clauseOr ) @@ -75,25 +75,10 @@ namespace oopse { clauseWithin ::= WITHIN ( clauseDistance , expression ) clauseDistance ::= integer | decimal - - clauseChemObject::= {clauseMolecule} | {clauseStuntDouble} + + clauseName::= *|string{.string{.string}} - clauseMolecule ::= {clauseMolName} | {clauseMolIndex} - clauseMolName ::= molname clauseName - - clauseName::= *|string - - clauseMolIndex ::= molindex clauseIndex - - clauseIndex ::= integer {- integer } - - clauseStuntDouble ::= {clauseStuntDoubleName} | {clauseStuntDoubleIndex} - - clauseStuntDoubleName ::= name clauseName - - clauseStuntDoubleIndex ::= index clauseIndex - * */ class SelectionCompiler{ @@ -121,7 +106,6 @@ class SelectionCompiler{ strError += filename; } - strError += " line#" + lineCurrent; return strError; } @@ -132,7 +116,7 @@ class SelectionCompiler{ bool lookingAtLeadingWhitespace(); - bool lookingAtComment(); + //bool lookingAtComment(); bool lookingAtEndOfLine(); bool lookingAtEndOfStatement(); bool lookingAtString(); @@ -154,16 +138,15 @@ class SelectionCompiler{ bool clausePrimitive(); bool clauseWithin(); bool clauseComparator(); - bool clauseName(int tok); - bool clauseIndex(int tok); - + bool clauseChemObjName(); + bool clauseIndex(); Token tokenNext(); boost::any valuePeek(); int tokPeek(); bool addTokenToPostfix(const Token& token); + bool isNameValid(const std::string& name); - bool compileError(const std::string& errorMessage) { std::cerr << "SelectionCompiler Error: " << errorMessage << std::endl; error = true; @@ -220,8 +203,8 @@ class SelectionCompiler{ return compileError("comparison operator expected"); } - bool integerExpected() { - return compileError("integer expected"); + bool numberExpected() { + return compileError("number expected"); } bool numberOrKeywordExpected() {