title: request for member 'sval' in something not a structure or union
body: <p>I am getting an error in my parser for a toy language I am making. Here is some of my parser code:</p>
  <pre><code>%union {
    char* &lt;sval&gt;;
  }
  
  %token INTEGER
  %token INTDEC FLODEC AS
  %token &lt;sval&gt; VARIABLE
  %token POINT LBRACKET RBRACKET
  %token SHOW ESC
  %left '+' '-'
  %left '*' '/' MODULO FACTORIAL FLOOR
  %left '^'
  
  %code requires {
    #define YYSTYPE float
  }
  </code></pre>
  <p>And some of my lexer code:</p>
  <pre><code>    as                         {return AS;}
  float                      {return FLODEC;}
  show                       {return SHOW;}
  int                        {return INTDEC;}
  esc                        {return ESC;}
  \.                         {return POINT;}
  {integer}                  {yylval = atoi(yytext); return INTEGER;}
  [a-zA-Z]+                  {yylval.sval = strdup(yytext); return VARIABLE;}
  [&quot;\\&quot;]                     {return FLOOR;}
  [-+/=*^\n]                 {return *yytext;}
  [&quot;(&quot;]                      {return LBRACKET;}
  [&quot;)&quot;]                      {return RBRACKET;}
  [&quot;!&quot;]                      {return FACTORIAL;}
  [&quot;%%&quot;]                     {return MODULO;}
  [&quot; \t\n&quot;]
  .                          {printf(&quot;Syntax error&quot;);}
  </code></pre>
  <p>How do I fix this as I think this is actually in a union but I am not sure what to do.</p>