Package org.apache.jena.riot.tokens

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


  private void parseBoolean()
  {
    isBooleanResults = true;
    if (lookingAt(TokenType.KEYWORD))
    {
      Token t = nextToken();
      String keyword = t.getImage();
      if (keyword.equals("true"))
      {
        boolResult = true;
      }
      else if (keyword.equals("false"))
View Full Code Here


      BindingMap b = BindingFactory.create();
      do
      {
        if (isPropertyName())
        {
          Token t = nextToken();
          String var = t.getImage();
          checkColon();
                   
          Node n = parseNode();
          b.add(Var.alloc(var), n);
         
View Full Code Here

    String type, value, lang, datatype;
    type = value = lang = datatype = null;
   
    if (lookingAt(TokenType.LBRACE))
    {
      Token pos = nextToken();
     
      //Collect the Properties
      do
      {
        if (isPropertyName())
        {
          Token t = nextToken();
          String name = t.getImage();
          checkColon();
         
          if (name.equals("type")) {
            if (type != null) exception(t, "Illegal duplicate type property");
            type = parseNodeInfo("type");
View Full Code Here

  }
 
  private String parseNodeInfo(String name) {
    if (lookingAt(TokenType.STRING1) || lookingAt(TokenType.STRING2))
    {
      Token t = nextToken();
      String value = t.getImage();
      checkComma(TokenType.RBRACE);
      return value;
    }
    else
    {
View Full Code Here

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

    private Token checkValidForStringProperty(String property)
    {
      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(TokenType.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

    public static Node parse(String string)
    {
        Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(string) ;
        if ( ! tokenizer.hasNext() )
            return null ;
        Token t = tokenizer.next();
        Node n = profile.create(null, t) ;
        if ( tokenizer.hasNext() )
            Log.warn(RiotLib.class, "String has more than one token in it: "+string) ;
        return n ;
    }
View Full Code Here

            Timer timer = new Timer() ;
            long count = 0 ;
            timer.startTimer() ;
            for ( ; tokenize.hasNext() ; )
            {
                Token t = tokenize.next() ;
                if ( print )
                    System.out.println(t) ;
                count++ ;
            }
            tokenize.close();
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.