Boost C++ Libraries: Ticket #6253: lex::lexertl::generate_static_dfa compiler errors if lexer has wchar_t as underlying stream type https://svn.boost.org/trac10/ticket/6253 <p> Try and compile the following code, you will get compiler errors because generate_static.hpp has one line which says a std::map has a element type of char when, in this case, it should be wchar_t. After fixing that to use Char (which is an existing template param on the method with the error) the output C++ code from this method further encodes 'char' in a number of places thus compiling a lexer using the produced static table also fails. </p> <p> &lt;--------------------- Begin Repro ------------------------------&gt; </p> <p> #include &lt;fstream&gt; #include &lt;boost/config/warning_disable.hpp&gt; #include &lt;boost/spirit/include/lex_lexertl.hpp&gt; #include &lt;boost/spirit/include/lex_generate_static_lexertl.hpp&gt; #include &lt;boost/spirit/include/lex_static_lexertl.hpp&gt; </p> <p> using namespace std; using namespace boost::spirit; </p> <p> template &lt;typename <a class="missing wiki">BaseLexer</a>&gt; struct <a class="missing wiki">MyLexer</a> : boost::spirit::lex::lexer&lt;<a class="missing wiki">BaseLexer</a>&gt; { </p> <blockquote> <p> <a class="missing wiki">MyLexer</a>() { </p> <blockquote> <p> token = L"Yay winning!"; this-&gt;self = token; </p> </blockquote> <p> } </p> </blockquote> <blockquote> <p> lex::token_def&lt;lex::unused_type, wchar_t&gt; token; </p> </blockquote> <p> }; </p> <p> int main(int argc, char* argv[]) { </p> <blockquote> <p> typedef lex::lexertl::token&lt;const wchar_t*&gt; token_type; typedef lex::lexertl::lexer&lt;token_type&gt; lexer_type; </p> </blockquote> <blockquote> <p> <a class="missing wiki">MyLexer</a>&lt;lexer_type&gt; lexer; </p> </blockquote> <blockquote> <p> ofstream outputStream("test.hpp"); </p> </blockquote> <blockquote> <p> return lex::lexertl::generate_static_dfa(lexer, outputStream, "test") ? 0 : -1; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6253 Trac 1.4.3 Ryan Molden <ryanmolden@…> Sun, 11 Dec 2011 19:34:56 GMT attachment set https://svn.boost.org/trac10/ticket/6253 https://svn.boost.org/trac10/ticket/6253 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">hackfix.patch</span> </li> </ul> <p> This is a hacky fix I have used locally to unblock myself. Don't think it is boost quality or even necessarily the right approach, including mostly for completeness. </p> Ticket Ryan Molden <ryanmolden@…> Sun, 11 Dec 2011 21:13:26 GMT <link>https://svn.boost.org/trac10/ticket/6253#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6253#comment:1</guid> <description> <p> hmmm the tracking system apparently did some weird formatting on my repro including eliminating new lines and adding ? after some things...not sure why. Sorry about that. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Sun, 11 Dec 2011 21:17:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6253#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6253#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6253#comment:1" title="Comment 1">Ryan Molden &lt;ryanmolden@…&gt;</a>: </p> <blockquote class="citation"> <p> hmmm the tracking system apparently did some weird formatting on my repro including eliminating new lines and adding ? after some things...not sure why. Sorry about that. </p> </blockquote> <p> Would you mind (re-)attaching your code snippet to this ticket? </p> <p> Regards Hartmut </p> </description> <category>Ticket</category> </item> <item> <author>Ryan Molden <ryanmolden@…></author> <pubDate>Sun, 11 Dec 2011 21:31:17 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6253 https://svn.boost.org/trac10/ticket/6253 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">BoostRepro.cpp</span> </li> </ul> <p> Repro of bug as attachment (the ticket system did some weird formatting to it for unknown reasons) </p> Ticket Ryan Molden <ryanmolden@…> Sun, 11 Dec 2011 21:32:21 GMT <link>https://svn.boost.org/trac10/ticket/6253#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6253#comment:3</guid> <description> <p> Sure thing, added as attachment, looks better when viewed that way. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Mon, 12 Dec 2011 00:48:44 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6253#comment:4 https://svn.boost.org/trac10/ticket/6253#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/75910" title="Spirit: fixed #6253: lex::lexertl::generate_static_dfa compiler errors ...">[75910]</a>) Spirit: fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6253" title="#6253: Bugs: lex::lexertl::generate_static_dfa compiler errors if lexer has wchar_t ... (closed: fixed)">#6253</a>: lex::lexertl::generate_static_dfa compiler errors if lexer has wchar_t as underlying stream type </p> Ticket Ryan Molden <ryanmolden@…> Mon, 12 Dec 2011 01:38:10 GMT <link>https://svn.boost.org/trac10/ticket/6253#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6253#comment:5</guid> <description> <p> Wow, thanks for the quick fix! </p> </description> <category>Ticket</category> </item> </channel> </rss>