mush4brains has asked for the wisdom of the Perl Monks concerning the following question:
In my language, I'd like something like:#define add(a,b) (a+b)
where "any_expression" is any old (deep) expression defined elsewhere in the grammar, and (x,y) would be replaced/instantiated in that expression.myMacro(x,y): any_expression
where, again, expr is defined fully in the grammar. Adding arguments to this... I need to instantiate my (x,y) into the "expr" string before the subrules interpret it.macro: identifier ':' expr
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Macros in a RecDescent grammar
by merlyn (Sage) on Jun 21, 2002 at 21:29 UTC | |
by mush4brains (Acolyte) on Jun 21, 2002 at 21:51 UTC | |
by Aristotle (Chancellor) on Jun 22, 2002 at 16:12 UTC | |
by mush4brains (Acolyte) on Jun 21, 2002 at 22:18 UTC | |
|
Re: Macros in a RecDescent grammar
by dws (Chancellor) on Jun 21, 2002 at 21:08 UTC | |
|
Re: Macros in a RecDescent grammar
by kvale (Monsignor) on Jun 21, 2002 at 21:04 UTC | |
by mush4brains (Acolyte) on Jun 21, 2002 at 21:12 UTC | |
|
Re: Macros in a RecDescent grammar
by Anonymous Monk on Jun 22, 2002 at 16:19 UTC | |
|
Re: Macros in a RecDescent grammar
by mush4brains (Acolyte) on Jun 25, 2002 at 13:30 UTC |