code: private void parsePrimaryExpr() throws TTXPathException {
  
          if (isLiteral()) {
              parseLiteral();
          } else if (mToken.getType() == TokenType.DOLLAR) {
              parseVarRef();
          } else if (mToken.getType() == TokenType.OPEN_BR) {
              parseParenthesizedExpr();
          } else if (mToken.getType() == TokenType.POINT) {
              parseContextItemExpr();
          } else if (!isReservedKeyword()) {
              parseFunctionCall();
          } else {
              throw new IllegalStateException("Found wrong token '" + mToken.getContent() + "'. "
                  + " Token should be either a literal, a variable," + "a '(', a '.' or a function call.");
          }
      }
docs: Parses the the rule PrimaryExpr according to the following production
  rule:
  <p>
  [41] PrimaryExpr ::= Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall .
  </p>
  
  @throws TTXPathException