docs: private static int readingState(char[] nchar, DDLStatement retval) {
  
          if ( ! Character.isUnicodeIdentifierPart(nchar[0])) {
              char prev = prevChar(retval.statement);
              /* Since we only have access to the current character and the characters we have seen so far,
               * we can check for the token only after its completed and then look if it matches the required token. */
              if (checkForNextBegin) {
                  if (prev == 'n' || prev == 'N') {
                      if (SQLLexer.matchToken(retval.statement, retval.statement.length() - 5, "begin") ) {
                          inAsBegin = true;
                      }
                  }
                  checkForNextBegin = false;
              }
              if (prev == 'd' || prev == 'D') {
                  if (SQLLexer.matchToken(retval.statement, retval.statement.length() - 3, "end") ) {
                      if (inCaseWhen > 0) {
                          inCaseWhen--;
                      } else {
                          // we can terminate BEGIN ... END for multi stmt proc
                          // after all CASE ... END stmts are completed
                          inAsBegin = false;
                      }
                  }
              } else if (prev == 'e' || prev == 'E') {
                  if (SQLLexer.matchToken(retval.statement, retval.statement.length() - 4, "case") ) {
                      inCaseWhen++;
                  }
              } else if (prev == 's' || prev == 'S') {
                  if (SQLLexer.matchToken(retval.statement, retval.statement.length() - 2, "as") ) {
                      checkForNextBegin = true;
                  }
              }
          }
          if (nchar[0] == '-') {
              // remember that a possible '--' is being examined
              return kStateReadingCommentDelim;
          }
          else if (nchar[0] == '\n') {
              // normalize newlines to spaces
              retval.endLineNo += 1;
              retval.statement += " ";
          }
          else if (nchar[0] == '\r') {
              // ignore carriage returns
          }
          else if (nchar[0] == ';') {
              // end of the statement
              retval.statement += nchar[0];
              // statement completed only if outside of begin..end
              if(!inAsBegin) {
                  return kStateCompleteStatement;
              }
          }
          else if (nchar[0] == '\'') {
              retval.statement += nchar[0];
              return kStateReadingStringLiteral;
          }
          else if (SQLLexer.isBlockDelimiter(nchar[0])) {
              // we may be examining ### code block delimiters
              retval.statement += nchar[0];
              return kStateReadingCodeBlockDelim;
          }
          else {
              // accumulate and continue
              retval.statement += nchar[0];
          }
  
          return kStateReading;
      }