Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include "tokens.h"
- #include "rsobjparser.h"
- #include <iostream>
- %}
- %option noyywrap nounput noyy_push_state noyy_top_state stack reentrant
- %option debug
- %option perf-report
- %option extra-type="RS_ObjParser*"
- %x vertex
- FLOAT [0-9]+(\.[0-9]+)?
- %%
- "#"[^\n]+ {
- RS_ObjParser * p;
- p = yyget_extra( yyscanner );
- std::cout << p->getFileName() << std::endl;
- return TKN_COMMENT; }
- "v" { BEGIN(vertex); return TKN_VERTEX; }
- <vertex>{FLOAT} { return TKN_FLOAT; }
- <vertex>[\n] { yy_pop_state( yyscanner ); }
- <vertex>. { /* do nothing */ }
- . { /* eat up the rest */ }
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement