I experienced this problem and put breakpoints on each instance of 'No tokens were provided' I could find using:
grep -lr 'No tokens were provided' vendor/
which returned:
vendor/zendframework/zend-code/src/Scanner/ConstantScanner.php
vendor/zendframework/zend-code/src/Scanner/TokenArrayScanner.php
vendor/zendframework/zend-code/src/Scanner/MethodScanner.php
vendor/zendframework/zend-code/src/Scanner/PropertyScanner.php
vendor/zendframework/zend-code/src/Scanner/ClassScanner.php
My exception was being thrown in the TokenArrayScanner.php
file. The "tokens" instance value is set in the constructor, so I put a break point there and re-launched the process. Unfortunately, this constructor is called many times on numerous files, and data for the file being tokenized is not included in the construct call. I was able to determine that the "tokens" are just lines of the file being inspected. Based on the post by CarComp, I used this to find the offending file:
find . -type f -name '*.php' -empty
This turned up a number of files that lived under paths that contained "dev/tests", which are excluded from scanning, and a single file from a third party developer. removing this file solved the issue and the compile command completed with only complaints and not exceptions.