Guest User

Untitled

a guest
Aug 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. retrieving the results of a reentrant lexing without file i/o
  2. void scanProcedure(...threadInfo...) {
  3. yyscan_t tscanner;
  4.  
  5. yylex_init(tscanner);
  6. yy_scan_string(threadInfo->lexMe, tscanner);
  7. yylex(tscanner);
  8.  
  9. /* how to retrieve results of lexing in a
  10. reentrant manner ( no global state info )
  11. without having to do any file i/o */
  12.  
  13. /* threadInfo-> ?? */
  14.  
  15. yylex_destroy(tscanner);
  16. }
  17.  
  18. ...
  19.  
  20. pthread_create( ... scanProcedure ... threadInfoA ... );
  21. pthread_create( ... scanProcedure ... threadInfoB ... );
  22. pthread_create( ... scanProcedure ... threadInfoC ... );
  23.  
  24. pthread_join( ... );
Add Comment
Please, Sign In to add comment