Package org.apache.jena.riot.tokens

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


      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

  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

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.