Advertisement
Guest User

Untitled

a guest
Mar 31st, 2010
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. %{
  2. #include "tokens.h"
  3. #include "rsobjparser.h"
  4. #include <iostream>
  5. %}
  6.  
  7. %option noyywrap nounput noyy_push_state noyy_top_state stack reentrant
  8. %option debug
  9. %option perf-report
  10. %option extra-type="RS_ObjParser*"
  11. %x vertex
  12. FLOAT       [0-9]+(\.[0-9]+)?
  13.  
  14. %%
  15. "#"[^\n]+       {
  16.     RS_ObjParser * p;
  17.     p = yyget_extra( yyscanner );
  18.     std::cout << p->getFileName() << std::endl;
  19.     return TKN_COMMENT; }
  20. "v"             { BEGIN(vertex); return TKN_VERTEX; }
  21.  
  22. <vertex>{FLOAT} { return TKN_FLOAT; }
  23. <vertex>[\n]    { yy_pop_state( yyscanner ); }
  24. <vertex>.       { /* do nothing */ }
  25.  
  26. .               { /* eat up the rest */ }
  27.  
  28. %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement