27Oct00
Procedural Macros for Java
Bachrach and Playford
Pattern Variables
•Denoted with ? prefixing their names
•Have constraints that restrict the syntactic type of fragments that they match
–Examples: name, expression, body, …
–Constraint denoted with a colon separated suffix (e.g., ?class:name)
–Variable name defaults to constraint name (e.g., ?:type is the same as ?type:type)
–Wildcard constraint (*) matches anything
–Ellipsis (…)is an abbreviation for wildcard
Ellipsis is not like scheme’s use