Q:

Bison Parser: Token string value returning NULL

My problem is simple but i cant find the solution for it.
I am building a simple parser for the LUA language (without a lot of things, mainly assignments, functions and iteration structures) and when i try to get the string value of a token, it returns null. 
I can get the INT  value of numbers fine.
Example:
Input code:
a = 1

Output of lexical phase:
TOKEN_ID TOKEN_ASSIGN TOKEN_NUMBER

When i try to get the value of TOKEN_ID and TOKEN_NUMBER, TOKEN_ID = null, TOKEN_NUMBER = 1
Here is all tokens definitions and later i will highlight the important parts for my problem.
%{
#include <cstdio>
#include <iostream>
#include "ast.h"
#include "potatoCodeGen.h"

using namespace std;

// stuff from flex that bison needs to know about:
extern "C" int yylex();
extern "C" int yyparse();
extern "C" FILE *yyin;
extern int line_num;
no *ast;
void yyerror(const char *s);
%}

%union {
    int ival;
    const char *sval;
    no *ast;
}

//Keywords
%token TOKEN_AND
%token TOKEN_BREAK
%token TOKEN_DO
%token TOKEN_ELSE
%token TOKEN_ELSEIF
%token TOKEN_END
%token TOKEN_FALSE
%token TOKEN_FOR
%token TOKEN_FUNCTION
%token TOKEN_IF
%token TOKEN_IN
%token TOKEN_LOCAL
%token TOKEN_NIL
%token TOKEN_NOT
%token TOKEN_OR
%token TOKEN_REPEAT
%token TOKEN_RETURN
%token TOKEN_THEN
%token TOKEN_TRUE
%token TOKEN_UNTIL
%token TOKEN_WHILE

//Valued Terminals
%token <sval> TOKEN_STRING
%token <ival> TOKEN_NUMBER
%token <sval> TOKEN_ID

//Operator/pontuation Terminals
%token TOKEN_LPAREN
%token TOKEN_RPAREN
%token TOKEN_PLUS
%token TOKEN_MULTIPLY
%token TOKEN_MINUS
%token TOKEN_DIV
%token TOKEN_MOD
%token TOKEN_HAT
%token TOKEN_CROSS
%token TOKEN_EQUAL
%token TOKEN_AEQUAL
%token TOKEN_NEQUAL
%token TOKEN_LEQUAL
%token TOKEN_GEQUAL
%token TOKEN_LESSER
%token TOKEN_GREATER
%token TOKEN_ASSIGN
%token TOKEN_LKEY
%token TOKEN_RKEY
%token TOKEN_LBOX
%token TOKEN_RBOX
%token TOKEN_SEMICOLON
%token TOKEN_TWOPOINTS
%token TOKEN_COLON
%token TOKEN_POINT
%token TOKEN_DOUBLEPOINT
%token TOKEN_ETC
%start Input

%type <ast> bloco 
%type <ast> comando 
%type <ast> exp
%type <ast> nomedafuncao 
%type <ast> corpodafuncao
%type <ast> chamadadefuncao
%type <ast> args
%type <ast> listaexp
%type <ast> listapares
%type <sval> opbin

%%
///*//Debug Area
//prototype: createNode (char *type, no *down, no *next);
Input:
    bloco {printf("programa finalizado \n"); ast = $1;}
    ;

bloco:
    comando {printf("bloco de um comando encontrado \n"); $$ = createNode("bloco", $1, NULL);} 
    | comando bloco {printf("varios comandos encontrados \n"); $$ = createNode("bloco", $1, $2); } 
    ;

//Comandos principais e coisas auxiliares
comando:
    TOKEN_ID TOKEN_ASSIGN exp {printf("assignemt de id %s para comando\n", $1); $$ = createNode("assign", createId($1), $3);}

/*
*>>Here comes the rest of the grammar and the main of the parser but i removed it for this post<<
*/

Here i define that sval is a string:
%union {
    int ival;
    const char *sval;
    no *ast;
}

Definition of Tokens
%token <sval> TOKEN_STRING
%token <ival> TOKEN_NUMBER
%token <sval> TOKEN_ID

And here i see that the string is NULL, in this print
TOKEN_ID TOKEN_ASSIGN exp {printf("assignemt de id %s para comando\n",     $1); $$ = createNode("assign", createId($1), $3);}

PS: i can get the string of "opbin" (defined in the %type part)

A:

Problem solved, as rici commented, i forgot to populate the yylval in the string and id token, was doing it only on the int tokens, my bad... here is an example of the lexer part of the string:
{string}    {printf("Token: %s Type: STRING \n", yytext); yylval.sval = strdup(yytext); return TOKEN_STRING;} 

