Lines Matching full:line
62 * Line Numbering:: Tracking location within files.
105 returns preprocessing tokens individually, not a line at a time.
131 (*note Lexing a line::).
135 important for correct diagnostic positioning. Unless a specific line
137 `line' and `col' values of the token just before the location that
141 right. If whitespace (other than a new line) precedes a token, it sets
142 the `PREV_WHITE' bit in the token's flags. Each token has its `line'
143 and `col' variables set to the line and column of the first character
144 of the token. This line number is the line number in the translation
145 unit, and can be converted to a source (file, line) pair using the line
148 The first token on a logical, i.e. unescaped, line has the flag
149 `BOL' set for beginning-of-line. This flag is intended for internal
152 notified about the start of every non-directive line with tokens on it.
156 token on the line certainly won't have the `BOL' flag set.
169 The C standard also specifies that a new line in the middle of the
177 `PREV_WHITE' flag of a token if it meets a new line when `parsing_args'
178 is set to 2. It doesn't set it if it meets a new line when
195 as a single new line indicator. This allows it to transparently
243 middle of a line, and we want to report diagnostics in the correct
269 are handled by `_cpp_lex_direct' based upon command-line flags stored
279 Lexing a line
304 preprocessor lex all tokens on a line consecutively into a token buffer,
305 which I call a "token run", and when meeting an unescaped new line
307 the beginning of the run. Note that we do _not_ lex a line of tokens
313 line is valid, but since each logical line overwrites the tokens of the
314 previous line, tokens from prior lines are unavailable. In particular,
315 since a directive only occupies a single logical line, this means that
320 expansions, and what happens when we have a long line that overflows
325 line, we cannot reallocate the run. Instead, on overflow it is
330 `cpp_destroy'. So if a macro is expanded in the line of tokens, the
340 Lexing into a line of tokens solves some of the token memory
342 function-like macro name might lie on a different line, and the front
344 current line. So cpplib only moves back to the start of the token run
345 at the end of a line if the variable `keep_tokens' is zero.
346 Line-buffering is quite natural for the preprocessor, and as a result
357 that needs to be handled, or require a start-of-line call-back to be
383 These have been declared to be macros, either on the command line
587 from the lexer's current token run (*note Lexing a line::) using the
589 current line of tokens has been read in.
592 end of a line if it happens to be in the middle of a macro argument
598 File: cppinternals.info, Node: Token Spacing, Next: Line Numbering, Prev: Macro Expansion, Up: Top
635 than a new line. The stand-alone preprocessor can use this flag to
726 File: cppinternals.info, Node: Line Numbering, Next: Guard Macros, Prev: Token Spacing, Up: Top
728 Line numbering
731 Just which line number anyway?
735 the line number of a token passed to it:
737 * The source line it was lexed on.
739 * The line it is output on. This can be different to the line it was
749 * If the token results from a macro expansion, the line of the macro
750 name, or possibly the line of the closing parenthesis in the case
753 The `cpp_token' structure contains `line' and `col' members. The
754 lexer fills these in with the line and column of the first character of
766 recently _lexed_ token, unless they are passed a specific line and
774 the correct line to output the token on: the position attached to a
776 tokens on a logical line should be output on its first physical line, so
778 line other than the first.
781 whenever it lexes a preprocessing token that starts a new logical line
784 routine, which can then use the line and column of this token to
787 Representation of line numbers
790 As mentioned above, cpplib stores with each token the line number that
791 it was lexed on. In fact, this number is not the number of the line in
793 line in the translation unit.
795 The preprocessor maintains a monotonic increasing line count, which
796 is incremented at every new line character (and also at the end of any
797 buffer that does not end in a new line). Since a line number of zero is
801 This variable therefore uniquely enumerates each line in the
803 forward to map from this to the original source file and line number
804 pair, saving space whenever line number information needs to be saved.
805 The code the implements this mapping lies in the files `line-map.c' and
806 `line-map.h'.
808 Command-line macros and assertions are implemented by pushing a
811 Since these are all processed before the first line of the main input
812 file, it will typically have an assigned line closer to twenty than to
816 File: cppinternals.info, Node: Guard Macros, Next: Files, Prev: Line Numbering, Up: Top
845 pair, but the "null directive" (a line containing nothing other
936 such as glibc, pass twenty or thirty include paths on the command line,
985 in the command line (or system) include directories to which the mapping
998 * assertions: Hash Nodes. (line 6)
999 * controlling macros: Guard Macros. (line 6)
1000 * escaped newlines: Lexer. (line 6)
1001 * files: Files. (line 6)
1002 * guard macros: Guard Macros. (line 6)
1003 * hash table: Hash Nodes. (line 6)
1004 * header files: Conventions. (line 6)
1005 * identifiers: Hash Nodes. (line 6)
1006 * interface: Conventions. (line 6)
1007 line 6)
1008 * line numbers: Line Numbering. (line 6)
1009 * macro expansion: Macro Expansion. (line 6)
1010 * macro representation (internal): Macro Expansion. (line 19)
1011 * macros: Hash Nodes. (line 6)
1012 * multiple-include optimization: Guard Macros. (line 6)
1013 * named operators: Hash Nodes. (line 6)
1014 * newlines: Lexer. (line 6)
1015 * paste avoidance: Token Spacing. (line 6)
1016 * spacing: Token Spacing. (line 6)
1017 * token run: Lexer. (line 192)
1018 * token spacing: Token Spacing. (line 6)
1027 Ref: Lexing a line13498
1031 Node: Line Numbering35957