title: Flex token order
body: <p>I am having problem to declare the following tokens in flex: >, &lt;, >=, &lt;= >>,&lt;&lt;, >>=, &lt;&lt;=.</p>
  
  <p>I declared like this: (flex)</p>
  
  <pre><code>ID          [_a-zA-Z][_a-zA-Z0-9]*
  
  "&gt;"         {
                  ultimo_token = "&gt;";
                  return BT_OP;
              }
  
  "&lt;"         {
                  ultimo_token = "&lt;";
                  return LT_OP;
              }
  
  "&lt;&lt;"        {
                  ultimo_token = "&lt;&lt;";
                  return ESQ_OP;
              }
  "&gt;&gt;"        {
                  ultimo_token = "&lt;&lt;";
                  return DIR_OP;
              }                               
  
  "&lt;="        {
                  ultimo_token = "&lt;=";
                  return LE_OP;
              }
  
  "&gt;="        {
                  ultimo_token = "&gt;=";
                      return GE_OP;
                  }
  "&gt;&gt;="       {
                  ultimo_token = "&gt;&gt;=";
                  return DIR_ATRIBUICAO;
              }           
  
  "&lt;&lt;="       {
                  ultimo_token = "&lt;&lt;=";
                  return ESQ_ATRIBUICAO;
                  }
  
  {ID}+       {
                  ultimo_token = "IDENTIFICADOR ";
                  ultimo_token += yytext;
                  yylval.sval = new string(yytext) ;
                  return IDENTIFICADOR;
              }
  </code></pre>
  
  <p>and in bison its not working here:</p>
  
  <pre><code>expressao_relacional
      : expressao_shift { $$ = $1; }
      | expressao_relacional LE_OP expressao_shift { $$ = new NOperacaoBinaria($1, Operador::LE_OP, $3, $1-&gt;linha); }
      | expressao_relacional GE_OP expressao_shift { $$ = new NOperacaoBinaria($1, Operador::GE_OP, $3, $1-&gt;linha); }
      | expressao_relacional LT_OP expressao_shift { $$ = new NOperacaoBinaria($1, Operador::LT_OP, $3, $1-&gt;linha); }
      | expressao_relacional BT_OP expressao_shift { $$ = new NOperacaoBinaria($1, Operador::BT_OP, $3, $1-&gt;linha); }
      ;
  </code></pre>
  
  <p>in the code example like this one: if(a > b). It ignores > and match instead of IF '(' expression ')' where expression -> identifier rule. But there is a b identifier so it report an error...</p>
  
  <p>I wrote the test scanner with the -d option and it printed this:</p>
  
  <pre><code>--(end of buffer or a NUL)
  --accepting rule at line 434 ("if")
  if
  --accepting rule at line 274 ("(")
  (
  --accepting rule at line 478 ("a")
  a
  --accepting rule at line 484 (" &gt;&gt; ")
  --accepting rule at line 478 ("b")
  b
  --accepting rule at line 280 (")")
  )
  --accepting rule at line 484 (" ")
  --accepting rule at line 446 ("then")
  then
  --accepting rule at line 484 ("
  ")
  --accepting rule at line 248 ("{")
  {
  --accepting rule at line 484 ("
  
  ")
  --accepting rule at line 259 ("}")
  }
  --(end of buffer or a NUL)
  --accepting rule at line 484 ("
  ")
  --(end of buffer or a NUL)
  --EOF (start condition 0)
  </code></pre>
  
  <p>code: if(a >>b) { }</p>
  
  <p>&lt;&lt; is matching this rule:</p>
  
  <pre><code>[ &lt;&lt;EOF&gt;&gt;\0\t\v\r\n\f]+ ; /* eat up whitespace */
  </code></pre>
  
  <p>why?</p>
  
  <p>...</p>
  
  <p>thx rici...</p>