+%code requires {#include "muscle-tab.h"};
+%union
+{
+ struct
+ {
+ char const *chars;
+ muscle_kind kind;
+ } value;
+};
+%type <value> value;
+%printer
+{
+ switch ($$.kind)
+ {
+ case muscle_code: fprintf (yyo, "{%s}", $$.chars); break;
+ case muscle_keyword: fprintf (yyo, "%s", $$.chars); break;
+ case muscle_string: fprintf (yyo, "\"%s\"", $$.chars); break;
+ }
+} <value>;
+
+value:
+ %empty { $$.kind = muscle_keyword; $$.chars = ""; }
+| ID { $$.kind = muscle_keyword; $$.chars = $1; }
+| STRING { $$.kind = muscle_string; $$.chars = $1; }
+| braceless { $$.kind = muscle_code; $$.chars = $1; }