@Override public Token nextToken(){
  int startPosition=getCurrentPositionInInput();
  if (lookAhead(1) == '(') {
    consume();
    return new Token(LogicTokenTypes.LPAREN,"(",startPosition);
  }
 else   if (lookAhead(1) == '[') {
    consume();
    return new Token(LogicTokenTypes.LSQRBRACKET,"[",startPosition);
  }
 else   if (lookAhead(1) == ')') {
    consume();
    return new Token(LogicTokenTypes.RPAREN,")",startPosition);
  }
 else   if (lookAhead(1) == ']') {
    consume();
    return new Token(LogicTokenTypes.RSQRBRACKET,"]",startPosition);
  }
 else   if (Character.isWhitespace(lookAhead(1))) {
    consume();
    return nextToken();
  }
 else   if (connectiveDetected(lookAhead(1))) {
    return connective();
  }
 else   if (symbolDetected(lookAhead(1))) {
    return symbol();
  }
 else   if (lookAhead(1) == (char)-1) {
    return new Token(LogicTokenTypes.EOI,"EOI",startPosition);
  }
 else {
    throw new LexerException("Lexing error on character " + lookAhead(1) + " at position "+ getCurrentPositionInInput(),getCurrentPositionInInput());
  }
}

@ Override public Token nextToken ( ) { int startPosition = getCurrentPositionInInput ( ) ; if ( lookAhead ( 1 ) == '(' ) { consume ( ) ; return new Token ( LogicTokenTypes . LPAREN , "(" , startPosition ) ; } else if ( lookAhead ( 1 ) == '[' ) { consume ( ) ; return new Token ( LogicTokenTypes . LSQRBRACKET , "[" , startPosition ) ; } else if ( lookAhead ( 1 ) == ')' ) { consume ( ) ; return new Token ( LogicTokenTypes . RPAREN , ")" , startPosition ) ; } else if ( lookAhead ( 1 ) == ']' ) { consume ( ) ; return new Token ( LogicTokenTypes . RSQRBRACKET , "]" , startPosition ) ; } else if ( Character . isWhitespace ( lookAhead ( 1 ) ) ) { consume ( ) ; return nextToken ( ) ; } else if ( connectiveDetected ( lookAhead ( 1 ) ) ) { return connective ( ) ; } else if ( symbolDetected ( lookAhead ( 1 ) ) ) { return symbol ( ) ; } else if ( lookAhead ( 1 ) == ( char ) - 1 ) { return new Token ( LogicTokenTypes . EOI , "EOI" , startPosition ) ; } else { throw new LexerException ( "Lexing error on character " + lookAhead ( 1 ) + " at position " + getCurrentPositionInInput ( ) , getCurrentPositionInInput ( ) ) ; } }
returns the next propositional token from the character stream .
