Guest User

Untitled

a guest
Jun 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. %{
  2. #include <stdio.h>
  3. int num_lines = 0, num_chars = 0;
  4. %}
  5. %%
  6. \n ++num_lines; ++num_chars;
  7. . ++num_chars;
  8.  
  9. %%
  10. main() {
  11. yylex();
  12. printf("# of lines = %d, # of chars = %d\n", num_lines, num_chars);
  13. }
Add Comment
Please, Sign In to add comment