Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include <stdio.h>
- int num_lines = 0, num_chars = 0;
- %}
- %%
- \n ++num_lines; ++num_chars;
- . ++num_chars;
- %%
- main() {
- yylex();
- printf("# of lines = %d, # of chars = %d\n", num_lines, num_chars);
- }
Add Comment
Please, Sign In to add comment