[C] Implement line marker rule
This will be very useful for writing compilers, since line markers is the standard way to convey information where a line is from after a file has been preprocessed, and they can be used as "offsets" for proper error reporting.
The c grammar does not implement preprocessor directives, including #line. We don't implement a preprocessor.
But, let's assume that you generated the post-processed input via cpp or gcc -E. This would contain #line directives. For a concrete example, let's take the
source file hw.c-pre.txt and the post-processed generated file hw.c-post.txt
I assume that you'd want a lexer that creates a new token type that contains the additional information that computes the line/column back to the original source. However, in the example I provide, some #line directives don't follow the ISO spec. (The current draft is https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf. We don't have a grammar for the newest spec.)
It's possible to do something, but I don't have time at the moment to understand the #line directives that aren't ISO 9899 compliant, and to implement this.