Is it valid (in the sense of formal grammars or formal language theory) to refer to outside of the grammar in attribute grammars?
What I mean is that since attribute grammars can contain semantic functions e.g.
E1 → E2+T { E1.val := sum(E2.val, T.val) }
then could there (in the place of the sum function) be a function that does e.g. a SQL query?
Should add that this is technically feasible, but I want to know that if it's reasonable and in accord to the theory of attribute grammars and the practice of semantic analysis.