Package org.apache.jena.riot.tokens

Examples of org.apache.jena.riot.tokens.Token


        if ( tokenEOF != null )
            return true ;
       
        if ( ! moreTokens() )
        {
            tokenEOF = new Token(tokens.getLine(), tokens.getColumn()) ;
            return true ;
        }
        return false ;
    }
View Full Code Here


        return peekTokens.hasNext() ;
    }
   
    final protected boolean lookingAt(TokenType tokenType)
    {
        Token t = peekTokens.peek() ;
        if ( t == null  )
            return tokenType == EOF ;
        return t.hasType(tokenType) ;
    }
View Full Code Here

        return t.hasType(tokenType) ;
    }
   
    final protected boolean lookingAtString()
    {
        Token t = peekTokens.peek() ;
        if ( t == null  )
            return false ;
        if ( t.hasType(TokenType.STRING1) ) return true ;
        if ( t.hasType(TokenType.STRING2) ) return true ;
        if ( t.hasType(TokenType.LONG_STRING1) ) return true ;
        if ( t.hasType(TokenType.LONG_STRING2) ) return true ;
        return false ;
    }
View Full Code Here

        return false ;
    }
   
    final protected boolean lookingAtNumber()
    {
        Token t = peekTokens.peek() ;
        if ( t == null  )
            return false ;
        if ( t.hasType(TokenType.INTEGER) ) return true ;
        if ( t.hasType(TokenType.HEX) )     return true ;
        if ( t.hasType(TokenType.DECIMAL) ) return true ;
        if ( t.hasType(TokenType.DOUBLE) )  return true ;
        return false ;
    }
View Full Code Here

    final protected Token nextToken()
    {
        if ( eof() )
            return tokenEOF ;
       
        Token t = peekTokens.next() ;
        currLine = t.getLine() ;
        currCol = t.getColumn() ;
//        if ( VERBOSE ) log.info("Move: " + t) ;
        return t ;
    }
View Full Code Here

    //Loop here because we might see some things we can discard first
    do
    {
      if (!isPropertyName())
      {
        Token t = nextToken();
        String name = t.getImage();
        checkColon();
       
        if (name.equals("head"))
        {
          if (headerSeen) exception(t, "Invalid duplicate header property");
View Full Code Here

  {
    do
    {
      if (isPropertyName())
      {
        Token t = nextToken();
        String name = t.getImage();
        checkColon();
       
        if (name.equals("vars"))
        {
          parseVars();
View Full Code Here

      vars.clear();
      do
      {
        if (lookingAt(TokenType.STRING1) || lookingAt(TokenType.STRING2))
        {
          Token t = nextToken();
          String var = t.getImage();
          vars.add(var);
          checkComma(TokenType.RBRACKET);
        }
        else if (lookingAt(TokenType.RBRACKET))
        {
View Full Code Here

    if (lookingAt(TokenType.LBRACE))
    {
      nextToken();
      if (isPropertyName())
      {
        Token t = nextToken();
        String name = t.getImage();
        if (name.equals("bindings"))
        {
          checkColon();
          if (lookingAt(TokenType.LBRACKET))
          {
View Full Code Here

     
      //TODO We should really care about the syntactic validity of objects we are ignoring but that seems like a bit too much effort
      int openBraces = 1;
      while (openBraces >= 1)
      {
        Token next = nextToken();
        if (next.getType().equals(TokenType.LBRACE)) {
          openBraces++;
        } else if (next.getType().equals(TokenType.RBRACE)) {
          openBraces--;
        }
      }
      checkComma(TokenType.RBRACE);
    } else if (lookingAt(TokenType.LBRACKET)) {
      //Start of an Array
      nextToken();
     
      //TODO We should really care about the syntactic validity of objects we are ignoring but that seems like a bit too much effort
      int openBraces = 1;
      while (openBraces >= 1)
      {
        Token next = nextToken();
        if (next.getType().equals(TokenType.LBRACKET)) {
          openBraces++;
        } else if (next.getType().equals(TokenType.RBRACKET)) {
          openBraces--;
        }
      }
      checkComma(TokenType.RBRACE);
    } else {
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.tokens.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.