AS3 has a method called describeType
If you call describeType(Foo)
on the above example, you'll get:
<type name="Foo" base="Class" isDynamic="true" isFinal="true" isStatic="true">
<extendsClass type="Class"/>
<extendsClass type="Object"/>
<accessor name="prototype" access="readonly" type="*" declaredBy="Class"/>
<factory type="Foo">
<extendsClass type="Object"/>
<method name="bar" declaredBy="Foo" returnType="void">
<parameter index="1" type="Number" optional="false"/>
<parameter index="2" type="String" optional="false"/>
<metadata name="__go_to_definition_help">
<arg key="pos" value="51"/>
</metadata>
</method>
<metadata name="__go_to_definition_help">
<arg key="pos" value="23"/>
</metadata>
</factory>
</type>
Now, you can use AS3's XML
class and e4x to find the definition of the method with the name bar
and grab the parameter
elements.