Can some one please explain how the simple token ##document## is converted to a file path?

Inside \StringUtil parseSimpleTokens() function there is a block of code, what and how does it do the conversion of ##document## to a file path?
PHP Code:
        // Eval the code
        
ob_start();
        
$blnEval = eval("?>" $strReturn);
        
$strReturn ob_get_contents();
        
ob_end_clean(); 

I am using module notification-center to send email from the submitted forms. With the mail, I am attaching a dynamically generated PDF file containing some information from the submitted from POST. I am able to register a custom simple token ##myPDF## and generate the PDF using prepareFormData HOOK. But struggling to resolve the simpleToken ##myPDF## conversion into the file path.