Protocol for flexible construction of results (e.g. ASTs in case of parsers)