Home | History | Annotate | Download | only in info

Lines Matching full:macro

60 * Macro Expansion::     Macro expansion algorithm.
154 might be a macro, and the tokens of a macro expansion do not have the
155 `BOL' flag set. The macro expansion may even be empty, and the next
161 in the middle of a macro expansion. Therefore, if the state variable
167 unterminated macro argument list.
170 arguments to a macro is treated as whitespace. This white space is
171 important in case the macro argument is stringified. The state variable
173 arguments to a macro call. It is set to 1 when looking for the opening
174 parenthesis to a function-like macro, and 2 when collecting the actual
248 macro expansion we don't want to complain with each use of the macro.
253 `__VA_ARGS__' in the expansion of a variable-argument macro. Therefore
289 token stream. For example, after the name of a function-like macro, it
319 Two issues remain: what about tokens that arise from macro
328 The tokens forming a macro's replacement list are collected by the
330 `cpp_destroy'. So if a macro is expanded in the line of tokens, the
342 function-like macro name might lie on a different line, and the front
349 function-like macro. In the near future cpplib will export an
359 conditional blocks, and invalidates the control macro of the
365 File: cppinternals.info, Node: Hash Nodes, Next: Macro Expansion, Prev: Lexer, Up: Top
373 well as keywords, directive names, macro names and so on. For example,
386 for a normal macro points to a structure with more information
387 about the macro, such as whether it is function-like, how many
402 currently a macro, or a macro that has since been undefined with
410 and pasting macro operators `#' and `##'. Named operator hash
420 each identifier in the macro's expansion, lookup to see if it is an
426 File: cppinternals.info, Node: Macro Expansion, Next: Token Spacing, Prev: Hash Nodes, Up: Top
428 Macro Expansion Algorithm
431 Macro expansion is a tricky operation, fraught with nasty corner cases
438 of how things like nested macro expansion, stringification and token
444 The preprocessor stores macro expansions in tokenized form. This saves
448 is all you need to get the replacement list of a macro.
450 If the macro is a function-like macro the preprocessor also stores
452 table entry of each parameter's identifier. Further, in the macro's
458 parameters to the macro, both for dumping with e.g., `-dD', and to warn
459 about non-trivial macro redefinitions when the parameter names have
462 Macro expansion overview
466 list of `cpp_context' structures, which together represent the macro
469 normally holds the unexpanded replacement list of the innermost macro
482 If it encounters an identifier that is both a macro and enabled for
483 expansion, cpplib prepares to push a new context for that macro on the
486 replacement list of that macro. In the case of function-like macros,
488 list, stored as `CPP_MACRO_ARG' tokens, with the appropriate macro
490 its expanded argument, the argument will have been fully macro expanded
500 to mark the macro disabled for expansion (except for special macros
501 like `__TIME__'). The macro is re-enabled when its context is later
503 ordering ensures that a macro is disabled whilst its expansion is being
515 the macro in question was disabled.
523 parenthesis in its macro's argument list), and when it replaces its
524 parameter in the macro's replacement list, the subsequent token happens
532 importantly ensures that the macro corresponding to the current context
541 argument, `foo' does not expand even though the macro is enabled, since
544 the macro invocation]. This still leaves the argument token `foo'
547 ineligible for future expansion, since the macro is now disabled. It
548 is disabled because the replacement list `bar foo' of the macro is
552 then tested whether the macro were disabled it would be subtly wrong.
557 Looking for a function-like macro's opening parenthesis
592 end of a line if it happens to be in the middle of a macro argument
594 situations where no macro expansion is involved, so the optimization is
598 File: cppinternals.info, Node: Token Spacing, Next: Line Numbering, Prev: Macro Expansion, Up: Top
606 taking special measures, this might not be the case because of macro
626 avoidance". Token addition and removal can only occur because of macro
628 and after each macro replacement, each argument replacement, and
638 Now consider the result of the following macro expansion:
648 space preceding `add' in the macro invocation, _not_ replacement list.
650 the macro replacement list, and `3' has no preceding space because
655 in-progress macro expansions. So instead of modifying the two tokens
659 in front of every macro expansion and expanded macro argument. These
662 in the macro invocation, and `y' and `z' in the macro replacement list,
666 example if a macro's first replacement token expands straight into
667 another macro.
680 But what if a macro expansion is left? Adjusting the above example
693 tokens, one per macro invocation, before the token `baz'. We would
698 any of these macro expansions could be stringified, where spacing
701 So, this demonstrates that not just entering macro and argument
704 macro expansions, as well as after each replaced argument in a macro's
749 * If the token results from a macro expansion, the line of the macro
751 of function-like macro expansion.
756 replacement list of a macro expansion carries the location of the token
757 within the `#define' directive, because cpplib expands a macro by
768 macro expansions, it might also be helpful for the user to see the
769 original location in the macro definition that the token came from.
775 token is fairly useless if the token came from a macro expansion. All
857 must have come directly from the source file--no macro expansion
858 must have been involved. This is because macro definitions can
867 `_stack_include_file' sets the controlling macro `mi_cmacro' to `NULL',
880 pass the controlling macro to the function `push_conditional'. cpplib
883 onto the stack. In this structure it records the controlling macro for
886 controlling macro for that block is cleared to `NULL'. Otherwise, it
888 sets `mi_valid' to true and stores the controlling macro in `mi_cmacro'.
892 With this, and requiring top-of-file to record a controlling macro, and
904 remembers the controlling macro associated with the file. Subsequent
906 controlling macro is defined, effecting the optimization.
914 in order in a `#if' expression. If so, they return the guard macro to
916 `enter_macro_context' sets `mi_valid' to false, so if a macro was
955 macro is defined when we leave the header file for the first time. If
1009 * macro expansion: Macro Expansion. (line 6)
1010 * macro representation (internal): Macro Expansion. (line 19)
1029 Node: Macro Expansion21135