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


So, summarizing back the proposal when I've incorporated Josh's latest suggestions:
- token-based
- separate executable is produced for generating documentation (incorporating the stap lexer + macro processor + not much else)
- lexer gathers such things as temporary '\n' tokens for macroprocessing purposes
- flow of data is INPUT TEXT =(lexer)=> TOKEN STREAM WITH '\n' =(macroprocessor)=> (TOKEN STREAM FOR PARSER / TEXT OUTPUT FOR DOCUMENTATION)
- it may be possible/necessary to subsume kernel-doc into the macroprocessor functionality to avoid having to reconstruct output text from a token stream

Macroprocessor syntax
- single-line definition %define foo(...) ... \n
- multiple-line definition %define foo(...) %( ... %) -- so plain '()' parens in a definition need not balance
- macro invocation %foo(...) -- so plain '()' parens in an invocation have to balance
- of course, all of the above can also be zero-parameter (without the parens)
- delete a definition with %undef foo
- conditional expression %( ... %? ... %: ... %)
- /** ... */ doc comment
- /*** ... */ doc comment continuation
- $1, $2, ... command line arguments


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