If you are going to require ME to organize the effort, then this will likely be a long time in coming. I have a lot of items in the queue ahead of this. However, if somebody else would like to step up and define this, I might even be inspired to write the compiler for it.
Rick On Sat, May 8, 2010 at 4:48 PM, Rony G. Flatscher <rony.flatsc...@wu-wien.ac.at> wrote: > >>> One caveat though: regular expressions are very powerful, but (since a >>> lot of Perlish style (PCRE) in the form of cryptic letters at certain >>> positions meaning something specific, shines through) hard to learn and >>> hard to keep the acquired knowledge, if one does not use them for a >>> longer time. Being confronted with people who are beginners in learning >>> a programming language, regular "regular expressions" are something >>> almost unbearable for them. So one idea would be to try to come up with >>> some "Rexxish" notation for the regex in addition to the "pure" one, >>> which will be a boon for the regex-experts. E.g. coming up with an >>> encoding for the regex patterns that make it instantenous clear that a >>> pattern is greedy, lazy/reluctant or possessive, or all the >>> non-capturing lookaround "(?" patterns and the like. The Rexxish >>> version should be as self-describable as possible (such that one does >>> not need to look-up the regex documentation to learn what the meaning of >>> an expression would be in effect). >>> >>> The goal would be that Rexx programmers who have never dealt with regex >>> the power of your implementation may become easily tangible. And of >>> course, all ideas would be helpful that would allow to define a Rexxish >>> interface to this powerful regex package. >>> >> The package was designed with this possibility in mind. Unlike the >> Java versions, I've maintained a clean separation between the Pattern >> class and the .RegexCompiler class. Any number of compilers can be >> written to provide integration, and even the Pattern engine can be >> extended by writing addtional MatchNode subclasses. All it takes is >> for somebody to define such an expression language and write a >> compiler for that. I'm not prepared to do such a think. When I first >> came up with the idea of doing this, I challenged Chip to come up with >> a language, but I've seen no action on that front. One problem with >> trying to do something like that is the language tends to become very >> "wordy". For example, that URL example above in a less terse syntax >> would be several times the size. On the other hand, with reusable >> pieces, that example becomes easier to understand because you pattern >> starts to read more like a BNF description. Indeed, you could >> probably write a compiler that could build pattern matches from a BNF >> grammer description. >> > How about challenging the entire Rexx community, asking Chip and Gil to > come up with initial sketches, ideas and others joining (I for one would > love to try to help develop such an expression language; in any case I > would be able to conduct informal experiments with any expression > language ideas with some of my students to see which parts are easy > comprehensible and which are not) ? > :) > > Maybe it becomes possible to then define the url example by first > defining the constituent parts giving them names and then using those > names to build the entire url. Even though this might be much wordier it > may also be much more ledgible/comprehensible (and then even allowing to > parse an url into all of its constituent parts with one parse statement). > > >>> P.S.: One feature that would be also nice is being able to redefine >>> predefined character classes (and maybe named patterns), like being able >>> to redefine "\w" and the like (this would allow to use "\w" to e.g. >>> match a Rexx word or a German word and the like). That's would is partly >>> possible in the vim syntax highlighting definition file (which is based >>> on regex, but one is able to redefine the fundamental regex). >>> >> Ok, I just checked in a change to allow that. This is done by >> defining /w, /d, and /s to use the appropriate registered class family >> in the compiler (Word, Digit, and Space, respectively). You can >> define this to be anything you want by registering a new class family >> in your compiler instance. >> > That's just *great*! > > ---rony > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > ------------------------------------------------------------------------------ _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel