Lines Matching full:line
61 * Line Numbering:: Tracking location within files.
104 returns preprocessing tokens individually, not a line at a time.
130 (*note Lexing a line::).
134 important for correct diagnostic positioning. Unless a specific line
136 `line' and `col' values of the token just before the location that
140 right. If whitespace (other than a new line) precedes a token, it sets
141 the `PREV_WHITE' bit in the token's flags. Each token has its `line'
142 and `col' variables set to the line and column of the first character
143 of the token. This line number is the line number in the translation
144 unit, and can be converted to a source (file, line) pair using the line
147 The first token on a logical, i.e. unescaped, line has the flag
148 `BOL' set for beginning-of-line. This flag is intended for internal
151 notified about the start of every non-directive line with tokens on it.
155 token on the line certainly won't have the `BOL' flag set.
168 The C standard also specifies that a new line in the middle of the
176 `PREV_WHITE' flag of a token if it meets a new line when `parsing_args'
177 is set to 2. It doesn't set it if it meets a new line when
194 as a single new line indicator. This allows it to transparently
242 middle of a line, and we want to report diagnostics in the correct
268 are handled by `_cpp_lex_direct' based upon command-line flags stored
278 Lexing a line
303 preprocessor lex all tokens on a line consecutively into a token buffer,
304 which I call a "token run", and when meeting an unescaped new line
306 the beginning of the run. Note that we do _not_ lex a line of tokens
312 line is valid, but since each logical line overwrites the tokens of the
313 previous line, tokens from prior lines are unavailable. In particular,
314 since a directive only occupies a single logical line, this means that
319 expansions, and what happens when we have a long line that overflows
324 line, we cannot reallocate the run. Instead, on overflow it is
329 `cpp_destroy'. So if a macro is expanded in the line of tokens, the
339 Lexing into a line of tokens solves some of the token memory
341 function-like macro name might lie on a different line, and the front
343 current line. So cpplib only moves back to the start of the token run
344 at the end of a line if the variable `keep_tokens' is zero.
345 Line-buffering is quite natural for the preprocessor, and as a result
356 that needs to be handled, or require a start-of-line call-back to be
382 These have been declared to be macros, either on the command line
586 from the lexer's current token run (*note Lexing a line::) using the
588 current line of tokens has been read in.
591 end of a line if it happens to be in the middle of a macro argument
597 File: cppinternals.info, Node: Token Spacing, Next: Line Numbering, Prev: Macro Expansion, Up: Top
634 than a new line. The stand-alone preprocessor can use this flag to
725 File: cppinternals.info, Node: Line Numbering, Next: Guard Macros, Prev: Token Spacing, Up: Top
727 Line numbering
730 Just which line number anyway?
734 the line number of a token passed to it:
736 * The source line it was lexed on.
738 * The line it is output on. This can be different to the line it was
748 * If the token results from a macro expansion, the line of the macro
749 name, or possibly the line of the closing parenthesis in the case
752 The `cpp_token' structure contains `line' and `col' members. The
753 lexer fills these in with the line and column of the first character of
765 recently _lexed_ token, unless they are passed a specific line and
773 the correct line to output the token on: the position attached to a
775 tokens on a logical line should be output on its first physical line, so
777 line other than the first.
780 whenever it lexes a preprocessing token that starts a new logical line
783 routine, which can then use the line and column of this token to
786 Representation of line numbers
789 As mentioned above, cpplib stores with each token the line number that
790 it was lexed on. In fact, this number is not the number of the line in
792 line in the translation unit.
794 The preprocessor maintains a monotonic increasing line count, which
795 is incremented at every new line character (and also at the end of any
796 buffer that does not end in a new line). Since a line number of zero is
800 This variable therefore uniquely enumerates each line in the
802 forward to map from this to the original source file and line number
803 pair, saving space whenever line number information needs to be saved.
804 The code the implements this mapping lies in the files `line-map.c' and
805 `line-map.h'.
807 Command-line macros and assertions are implemented by pushing a
810 Since these are all processed before the first line of the main input
811 file, it will typically have an assigned line closer to twenty than to
815 File: cppinternals.info, Node: Guard Macros, Next: Files, Prev: Line Numbering, Up: Top
844 pair, but the "null directive" (a line containing nothing other
935 such as glibc, pass twenty or thirty include paths on the command line,
984 in the command line (or system) include directories to which the mapping
997 * assertions: Hash Nodes. (line 6)
998 * controlling macros: Guard Macros. (line 6)
999 * escaped newlines: Lexer. (line 6)
1000 * files: Files. (line 6)
1001 * guard macros: Guard Macros. (line 6)
1002 * hash table: Hash Nodes. (line 6)
1003 * header files: Conventions. (line 6)
1004 * identifiers: Hash Nodes. (line 6)
1005 * interface: Conventions. (line 6)
1006 * lexer: Lexer. (line 6)
1007 * lineLine Numbering. (line 6)
1008 * macro expansion: Macro Expansion. (line 6)
1009 * macro representation (internal): Macro Expansion. (line 19)
1010 * macros: Hash Nodes. (line 6)
1011 * multiple-include optimization: Guard Macros. (line 6)
1012 * named operators: Hash Nodes. (line 6)
1013 * newlines: Lexer. (line 6)
1014 * paste avoidance: Token Spacing. (line 6)
1015 * spacing: Token Spacing. (line 6)
1016 * token run: Lexer. (line 192)
1017 * token spacing: Token Spacing. (line 6)
1026 Ref: Lexing a line13471
1030 Node: Line Numbering35930