Defining Database Dynamics with Attribute Grammars