Purely functional implementation of attribute grammars door