Logo Search packages:      
Sourcecode: kalzium version File versions  Download package

int Parser::getNextToken (  ) [protected, virtual]

Fetches the next token.

Reimplemented in MoleculeParser.

Definition at line 184 of file parser.cpp.

References FLOAT_TOKEN, getNextChar(), INT_TOKEN, m_floatVal, m_intVal, m_nextToken, nextChar(), and skipWhitespace().

Referenced by start().

    int  saveIndex = m_index;

    if (isdigit(nextChar())) {
      // At this point we know that there is a valid number in the
      // string.  The only question now, is whether it is an int or a
      // float.


      if (nextChar() == '.') {
          m_index = saveIndex;

          // No need to check since we already know it is correct.
          (void) parseSimpleFloat(&m_floatVal);
          m_nextToken = FLOAT_TOKEN;
          m_nextToken = INT_TOKEN;

    else if (nextChar() != -1) {
      // Any character.
      m_nextToken = nextChar();

      // End of string.
      m_nextToken = -1;

    return m_nextToken;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index