title: Parsing hexadecimal and binary numbers
body: <p>I'm using boost spirit for parsing some complicated expression such as "0b111 &lt;&lt; (0x111 + 1) * ....", the problem is parsing hex and bin values, syntax analyzer found 0 before 'b' or 'x' first and takes it as num, but i want to take "0b1111".
  Tried to do that, but there is no effect.</p>
  
  <pre><code>            ............
              factor =
              num                                  [ qi::_val =    qi::_1  ]
              |   '('  &gt;&gt; expr                     [ qi::_val =    qi::_1  ] &gt;&gt;')'
              |   '-'  &gt;&gt; num                      [ qi::_val =   -qi::_1  ]
              |   '+'  &gt;&gt; num                      [ qi::_val =    qi::_1  ]
              |   '~'  &gt;&gt; num                      [ qi::_val =   ~qi::_1  ]
              ;
  
  
              num =
              qi::uint_                           [ qi::_val =    qi::_1  ]
              |   hexOrBinNum                     [  qi::_val =   qi::_1  ]
              ;
  
  
              hexOrBinNum =
              "0x"    &gt;&gt;    qi::int_parser&lt;int, 16&gt;{}        [ qi::_val =    qi::_1  ]
              |   "0b" &gt;&gt;    qi::int_parser&lt;int, 2&gt;{}         [ qi::_val =    qi::_1  ]
              ;
  </code></pre>