Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Create type-safe Collections in Java... with Perlby John M. Dlugosz (Monsignor) |
on Jun 14, 2001 at 23:27 UTC ( [id://88586]=note: print w/replies, xml ) | Need Help?? |
Many years ago, before C++ templates were implemented, I wrote a preprocessor for that, so I could play with them ahead of time. It didn't look anything like modern template syntax—I used the @ symbol, which is not used anywhere else in C++, for stuff that my program manipulated. It wasn't as limited as modern templates, either, as it was a more general-purpose macro system. I see you're not using a grammar parser at all, but just looking for a pattern on each line. Won't that be very difficult to do "right" for quotes, comments, etc.? Why does it look only for known template types? Why not first recognise the template syntax, then check to see if that template is known (such as in a like-named file)? —John
In Section
Cool Uses for Perl
|
|