New ClassAds has a method call GetExternalReferences(), which returns the external attribute references in an expression. It doesn't have a method to obtain the internal references in an expression. We would have to write one, based GetExternalReferences().

Developer time: 1-2 days