code: public static String genNaiveBaseNameForExpr(ExprNode exprNode, String fallbackBaseName) {
      if (exprNode instanceof VarRefNode) {
        return BaseUtils.convertToUpperUnderscore(((VarRefNode) exprNode).getName());
      } else if (exprNode instanceof FieldAccessNode) {
        return BaseUtils.convertToUpperUnderscore(((FieldAccessNode) exprNode).getFieldName());
      } else if (exprNode instanceof GlobalNode) {
        String globalName = ((GlobalNode) exprNode).getName();
        return BaseUtils.convertToUpperUnderscore(BaseUtils.extractPartAfterLastDot(globalName));
      }
  
      return fallbackBaseName;
    }
docs: Helper function to generate a base placeholder (or plural/select var) name from an expression,
  using the naive algorithm.
  
  <p>If the expression is a data ref or global, then the last key (if any) is used as the base
  placeholder name. Otherwise, the fallback name is used.
  
  <p>Examples:
  
  <ul>
  <li>{@code $aaaBbb -> AAA_BBB}
  <li>{@code $aaa_bbb -> AAA_BBB}
  <li>{@code $aaa.bbb -> BBB}
  <li>{@code $ij.aaa -> AAA}
  <li>{@code aaa.BBB -> BBB}
  <li>{@code $aaa.0 -> fallback}
  <li>{@code $aaa[0] -> fallback}
  <li>{@code $aaa[0].bbb -> BBB}
  <li>{@code length($aaa) -> fallback}
  <li>{@code $aaa + 1 -> fallback}
  </ul>
  
  @param exprNode The root node for an expression.
  @param fallbackBaseName The fallback base name.
  @return The base placeholder (or plural/select var) name for the given expression.