You can easily do it in AS2. I cannot publish the parser, because it is for a book, but here is the example:

http://flashscript.biz/book/chapter6...htm_final.html