This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: (PR11207) Macroprocessor discussion


smakarov wrote:

> [...]
> - flow of data is INPUT TEXT =(lexer)=> TOKEN STREAM WITH '\n' =(macroprocessor)=> (TOKEN STREAM FOR PARSER / TEXT OUTPUT FOR DOCUMENTATION)
> [...]

If the macroprocessor sits after the lexer, it will not see comments,
and cannot produce them for the parse.


> [...]
> Macroprocessor syntax
> - single-line definition %define foo(...) ... \n
> - multiple-line definition %define foo(...) %( ... %) -- so plain '()' parens in a definition need not balance
> [...]

Looks fine.

> - macro invocation %foo(...) -- so plain '()' parens in an invocation have to balance
> - conditional expression %( ... %? ... %: ... %)
> - /** ... */ doc comment
> - /*** ... */ doc comment continuation
> - $1, $2, ... command line arguments

It is essential to spell out the composition rules of these various
preprocessing / expansion mechanisms.  In other words, can one nest
%define within %( or vice versa?  Define or expand a macro with $1
argument?  Within a comment?


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]