public static PrincipalDesc getPrincipalDesc(ASTNode principal) {
    PrincipalType type = getPrincipalType(principal);
    if (type != null) {
      String text = principal.getChild(0).getText();
      String principalName = BaseSemanticAnalyzer.unescapeIdentifier(text);
      return new PrincipalDesc(principalName, type);
    }
    return null;
  }
Utility functions for creating objects relevant for authorization operations
from AST
ql/src/java/org/apache/hadoop/hive/ql/parse/authorization/AuthorizationParseUtils.java