add a sample of visitor pattern for resolving recursion limit problem
using generator.