Package org.openjena.riot.tokens

Examples of org.openjena.riot.tokens.Token


    return lookingAt(TokenType.STRING1) || lookingAt(TokenType.STRING2);
  }

    private Token checkValidForObjectProperty()
    {
      Token t = null;
      if (lookingAt(TokenType.STRING1) || lookingAt(TokenType.STRING2))
      {
        t = nextToken();
      }
      else
View Full Code Here


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

        if ( eof() )
            return tokenEOF ;
       
        // Tokenizer errors appear here!
        try {
            Token t = peekIter.next() ;
            currLine = t.getLine() ;
            currCol = t.getColumn() ;
            return t ;
        } catch (RiotParseException ex)
        {
            // Intercept to log it.
            raiseException(ex) ;
View Full Code Here

    protected final void expect(String msg, TokenType ttype)
    {
       
        if ( ! lookingAt(ttype) )
        {
            Token location = peekToken() ;
            exception(location, msg) ;
        }
        nextToken() ;
    }
View Full Code Here

                return createTypedLiteral(str, XSDDatatype.XSDdouble, line, col) ;
            case INTEGER:
                return createTypedLiteral(str, XSDDatatype.XSDinteger, line, col) ;
            case LITERAL_DT :
            {
                Token tokenDT = token.getSubToken() ;
                String uriStr ;
               
                switch(tokenDT.getType())
                {
                    case IRI:               uriStr = tokenDT.getImage() ; break ;
                    case PREFIXED_NAME:
                    {
                        String prefix = tokenDT.getImage() ;
                        String suffix = tokenDT.getImage2() ;
                        uriStr = expandPrefixedName(prefix, suffix, tokenDT) ;
                        break ;
                    }
                    default:
                        throw new RiotException("Expected IRI for datatype: "+token) ;
                }
               
                uriStr = resolveIRI(uriStr, tokenDT.getLine(), tokenDT.getColumn()) ;
                RDFDatatype dt = Node.getType(uriStr) ;
                return createTypedLiteral(str, dt, line, col) ;
            }
           
            case LITERAL_LANG :
View Full Code Here

        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.peekOrNull() ;
        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.peekOrNull() ;
        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.peekOrNull() ;
        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

        {
//            if ( VERBOSE ) log.info("Move: 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

TOP

Related Classes of org.openjena.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.