"Peñá, Botp" <botp / delmonte-phil.com> wrote:
> Simon Strandgaard [mailto:neoneye / adslhome.dk] humbly wrote:
> 
> > I have been thinking about extending it so it can explain in 
> > more verbose what a regexp does. See this url for example: 
> > http://rubyforge.org/tracker/index.php?func=detail&aid=383&group_id=18&atid=152
> > 
> 
> wow, _that_ is really helpful. The  regex#tree and regex#explain would help
> a lot of regex newbies (like me). Your regex package, if complete w all
> these goodies, could be a lifesaver for a programmer (docs not needed :-).
> Pls keep on enriching your regex module.
> 

I think I will tear off the parser, and then extend that with an #explain
method. That way it can be mixed into oniguruma too (or GNU for that matter),
however each engine does things in sligthly different ways.
I don't know when I will do it.. sorry


> > 
> > 
> > > I hope you can do something like this for your other 
> > packages as well 
> > > (aeditor eg, -who knows aeditor may just run on a 
> > browser!). This way, 
> > > people can see your contribs in action before they download just to 
> > > test. And since you know your product better, you can 
> > display/demo all 
> > > the needing testings. And they can thus say "ah, it's working". [I 
> > > hope other packagers will have some demo page as well. Is this 
> > > possible w Rubyforge or something??]. Hope I wasn't asking too much 
> > > :-)
> > 
> > An editor web frontend, that new. Its sligthly more complex 
> > to move a cursor around, and send the position back to a 
> > server, rendering and transfer buffer text. It may require 
> > either JavaScipt or Java. I rather spend some time on 
> > finishing the sub-components: regexp, rubyembed, coverage...  
> > Sorry no web frontend this time. I could make some animated 
> > gif's, or a whole movie of the editor in action?
> > 
> 
> Well, I was just shooting for the stars. Your work and that of
> ErikVeenstra's webdialog just pop in my mind... just maybe.. it could be
> possible..

I think it is possible.. But I just lacks time.
If cloning of humans was legal, I would clone a small army of myself.
Then I could relax and go skiing.


>
> > However you are on to something, AEditor is too complex to 
> > install, because of the dependency on Ncurses. I have long 
> > been thinking about making a frontend for Curses which is 
> > distributed with Ruby, so that compilation of Ncurses can be 
> > avoided. However I plan to make a Fox widget, which can do 
> > some nice antialiased 
> > rendering and do other fancy graphics stuff.  However regexp 
> > has top priority.
> > 
> 
> yes, you're right there, especially since I also do windows stuff. Anyway,
> your aeditor is promising. I'd love to have an editor that is pure 100% ruby
> (I'm a text fan btw). Keep aeditor up, too.
> 

AEditor is the project to which my life is dedicated. I want some kind
of ligthweight emacs where Lisp is replaced with Ruby, however Emacs core is
written in C, where AEditor is written in Ruby. Besides that I hope to make
a nice GUI frontend. I almost have all the proof-of-concepts that I need.
Now I just need to optimize the regexp-engine, and then I can hopefully begin 
merging all these subcomponents into something bigger. 

Recently I did some experiments with a configuration file format, where
you can create modes/themes, and tell how/if these modes inherit from eachother.
You can also supply binding between filetype and modes.
See this URL for an example configuration-file:
http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/experimental/preferences/dotfile.rb?rev=1.2&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup

What do you think about the configuration?
 

> > 
> > > 
> > > I'm testing the sample. And the regexp.tree is cool :-)
> > >
> >  
> > Great. BTW: Do you have ideas to how 'regexp.tree' can be 
> > made even cooler ?
> 
> well, I also removed the word "error" in "Mismatch error" (sometimes I
> prefer "NO match" :-).

Thanks.. its now fixed

server> ruby interactive.rb "x" yy

+-Literal "x"
NO MATCH: regexp does not match string.
server> ruby interactive.rb x y

+-Literal "x"
NO MATCH: regexp does not match string.
server> ruby interactive.rb x x

+-Literal "x"
<<x>>
["x"]
server>



> 
> Is it possible to point on the tree where the match failed?? For example
> (don't worry, I know I'm shooting for the stars again here :-) :
[snip] 
> +-Group register=1
>   +-Sequence
>     +-Repeat greedy{0,-1}
>     | +-Group register=2
>     |   +-Sequence
>     |     +-Literal "a"
>     |     +-Literal "b"
>     +-Literal "x" <=== Match Failed here!
> 
> NO Match. regexp /((ab)*x)/ does not match string 'ab'. See tree pls.
> 

For simple cases this could be possible.
However other is much more cryptic, I guess these cases will only
confuse more than they help.
Besides that its a great idea.



[snip]
> > I run it via 'mod_ruby' through apache. I think it also can 
> > be run with FastCGI, but I have never tried it out. I have 
> > made a link named 'regexp.rbx' pointing at that file in my 
> > www folder. Bommer, I forgot to write these instructions in 
> > the top of 'web_interface.rb'.
> > 
> 
> thanks for this. 'will try if I can run it on webdialog
> 

I would like to hear how that works out ;-)


Thanks for your valuable feedback

--
Simon Strandgaard