protected boolean skipVariableReference_1()

in framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/ScriptParser.java [976:1097]


  protected boolean skipVariableReference_1(TokenStream currentStream)
    throws ScriptException
  {
    Token t = currentStream.peek();
    if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("("))
    {
      currentStream.skip();
      if (skipExpression(currentStream) == false)
        syntaxError(currentStream,"Missing expression after '('");
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(")"))
        syntaxError(currentStream,"Missing ')'");
      currentStream.skip();
      return true;
    }
    else if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("["))
    {
      currentStream.skip();
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals("]"))
      {
        while (true)
        {
          if (skipExpression(currentStream) == false)
            syntaxError(currentStream,"Missing expression in array initializer");
          t = currentStream.peek();
          if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("]"))
            break;
          if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(","))
            syntaxError(currentStream,"Missing ','");
          currentStream.skip();
        }
      }
      currentStream.skip();
      return true;
    }
    else if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("{"))
    {
      currentStream.skip();
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals("}"))
      {
        while (true)
        {
          if (skipExpression(currentStream) == false)
            syntaxError(currentStream,"Missing expression in configuration object initializer");
          t = currentStream.peek();
          if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("}"))
            break;
          if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(","))
            syntaxError(currentStream,"Missing ','");
          currentStream.skip();
        }
      }
      currentStream.skip();
      return true;
    }
    else if (t != null && t.getPunctuation() != null && t.getPunctuation().equals("<<"))
    {
      currentStream.skip();
      // Parse the node type
      if (skipExpression(currentStream) == false)
        syntaxError(currentStream,"Missing node type");
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(":"))
        syntaxError(currentStream,"Missing ':'");
      currentStream.skip();
      
      // Parse the node value
      if (skipExpression(currentStream) == false)
        syntaxError(currentStream,"Missing node value");
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(":"))
        syntaxError(currentStream,"Missing ':'");
      currentStream.skip();
      
      // Parse the attributes
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(":"))
      {
        while (true)
        {
          if (skipExpression(currentStream) == false)
            syntaxError(currentStream,"Missing name expression in configurationnode attribute initializer");
          t = currentStream.peek();
          if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals("="))
            syntaxError(currentStream,"Missing '='");
          currentStream.skip();
          if (skipExpression(currentStream) == false)
            syntaxError(currentStream,"Missing value expression in configurationnode attribute initializer");
          t = currentStream.peek();
          if (t != null && t.getPunctuation() != null && t.getPunctuation().equals(":"))
            break;
          if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(","))
            syntaxError(currentStream,"Missing ','");
          currentStream.skip();
        }
      }
      currentStream.skip();

      // Parse the children
      t = currentStream.peek();
      if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(">>"))
      {
        while (true)
        {
          if (skipExpression(currentStream) == false)
            syntaxError(currentStream,"Missing expression in configurationnode object initializer");
          t = currentStream.peek();
          if (t != null && t.getPunctuation() != null && t.getPunctuation().equals(">>"))
            break;
          if (t == null || t.getPunctuation() == null || !t.getPunctuation().equals(","))
            syntaxError(currentStream,"Missing ','");
          currentStream.skip();
        }
      }
      currentStream.skip();
      return true;
    }

    return skipVariableReference_2(currentStream);
  }