An Algebraic Approach to Implementing a Shape Grammar Interpreter