#!/usr/bin/env python
import sys,os,re,platform,willcc

if __name__ == '__main__':
	for fn in sys.argv[1:]:
		os.chdir(willcc.util.rospath(fn))
		src = willcc.SourceFile(fn)
 		root = src.get_ast().root
		# print "++++++++++++++++++++++++++++++++"
		# print root.getstr()
		# print "++++++++++++++++++++++++++++++++"
		for d in root.children_of_type("DECL_REF_EXPR"):
		 	print d.getstr()
		 	print



# import willcc,os
# src = willcc.SourceFile("/Users/sheffler/hg/rosetta/rosetta_source/src/apps/pilot/jacob/test.cc")
# os.chdir("/Users/sheffler/hg/rosetta/rosetta_source/")
# ast = src.get_ast()
# o = ast.root.children_of_type("DECL_REF_EXPR")[0]
