+
+// define a local static variable declaration as one at some level of nesting
+// starting with the word static (exceptions?)
+@staticvardecl@
+type T;
+identifier func, var;
+expression value;
+@@
+func(...) {
+...
+( // default case
+static T
+- var
++ *var = SMPI_VARINIT_STATIC(T, var)
+;
+| // variable has initializer (not a struct or array)
+T
+- var = value
++ *var = SMPI_VARINIT_STATIC_AND_SET(var, T, value)
+;
+)
+...
+}
+
+//
+@rewritestaticaccess@
+type T;
+identifier staticvardecl.func, staticvardecl.var;
+@@
+func(...) {
+<...
+( // declaration
+T
+var
+;
+| // rewrite access
++SMPI_VARGET_STATIC(
+var
++)
+)
+...>