From neoneye@adslhome.dk Sun Dec 7 11:44:35 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hB7GiYPf002408 for ; Sun, 7 Dec 2003 11:44:35 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 6451926296E for ; Sun, 7 Dec 2003 17:44:35 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: text/plain Organization: Message-Id: <1070815297.10976.2.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Subject: [Aeditor-talk] regexp-engine 0.7 X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 07 Dec 2003 16:44:35 -0000 X-Original-Date: 07 Dec 2003 17:41:37 +0100 X-List-Received-Date: Sun, 07 Dec 2003 16:44:35 -0000 Today version 0.7 has been released. download it here: http://rubyforge.org/download.php/233/regexp-engine-0.7.tar.gz AEditor needs a regexp engine. You probably think, why not rely on an existing engine (for instance Ruby's regexp engine) ? Existing engines are not flexible enough. The iterator pattern provides that needed flexibility. Thus it should not matter wheter the engine operate on: UCS-4 or UTF-8 or ASCII. Goal is to build an engine which is fully compatible with Ruby's regexp syntax, which can work with iterators. Eventualy extend the regexp syntax, with some editor-stuff. For instance: point where cursor should be placed, match text which is legal ruby code, execute regexp within retangular selection... etc. I am open to other suggestions. Eventualy re-implement in C++ to gain performance. Running the engine against the Rubicon testsuite, yields pass=1444, fail=116, pass/total=92.5641025641026 Data structure has stabilized and the fundemental operations are working quite good (was difficult to implement). Uses iterators, this should make it easy to operate on many different kinds of input-streams (unicode, UTF-8), but right now the iterator only works on ASCII. Performance is not impressive. Left is all the easy stuff (unicode, optimizaition). Its being developed by using test-first development, current status are: 563 tests, 565 assertions, 0 failures, 0 errors -- Simon Strandgaard From neoneye@adslhome.dk Mon Dec 8 15:26:56 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hB8KQtPf010894 for ; Mon, 8 Dec 2003 15:26:56 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 45C912629C7; Mon, 8 Dec 2003 21:26:52 +0100 (CET) From: Simon Strandgaard To: AEditor In-Reply-To: <200312081950.48093.msparshatt@yahoo.co.uk> References: <3FAE801A.5030603@yahoo.co.uk> <200312042004.58410.msparshatt@yahoo.co.uk> <1070571494.81559.13.camel@server.neoneye.home> <200312081950.48093.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1070915036.15049.87.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Mark Subject: [Aeditor-talk] Re: Regexp engine X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 08 Dec 2003 20:26:56 -0000 X-Original-Date: 08 Dec 2003 21:23:57 +0100 X-List-Received-Date: Mon, 08 Dec 2003 20:26:56 -0000 On Mon, 2003-12-08 at 20:50, Mark wrote: > I've added two files > regexp/perl6parser.rb > test/test_perl6parser.rb > > I've started changing some of the tests and working on the parser to use the > new syntax. At the moment I'm working on moving the character classes to the > new <[...]. syntax exciting news :-) > ruby test_perl6parser.rb 38 tests, 38 assertions, 9 failures, 0 errors > I have created a mailinglist for AEditor, perhaps we should move our correspondence to there? http://rubyforge.org/mail/?group_id=18 Now 92.5 % of the rubicon tests passes OK. Within the next days I will rework 'scanner.rb' and leave the current recursive design, into a more iterative design (more efficient). This will not influence on 'parser.rb'. You can follow my work in the 'repeat_mismatch' branch, here: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/regexp_engine/?cvsroot=aeditor&only_with_tag=repeat_mismatch -- Simon Strandgaard From msparshatt@yahoo.co.uk Fri Dec 12 15:55:31 2003 Received: from smtp107.mail.sc5.yahoo.com (smtp107.mail.sc5.yahoo.com [66.163.169.227]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBCKtUPf001690 for ; Fri, 12 Dec 2003 15:55:31 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp107.mail.sc5.yahoo.com with SMTP; 12 Dec 2003 20:55:31 -0000 From: Mark To: aeditor-talk@rubyforge.org Date: Fri, 12 Dec 2003 20:46:49 +0000 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312122046.49029.msparshatt@yahoo.co.uk> Subject: [Aeditor-talk] Regexp assertions X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2003 20:55:31 -0000 Hi, As reccomended I've subscribed to the mailing list. the [...] format is now working for non capturing grouping I've almost finished working on assertions with the following working <1,5> repeat named character class <[0-9]> explicit character class <-[0-9]> inverse character class I still need to work on more complicated assertions such as < - [0-2] > which would match all digits except 0,1 and 2, and code assertions. I have a couple of questions I want to add some new classes for code assertions and closures, CodeBlock CodeAssertion Closure am I right in thinking that abstractsyntax.rb is the best place to put them? Also I'm making a list of features that I still need. Would it be best to put it in the TODO file or to set up a seperate TODO file for Perl6 features? Best Regards Mark Sparshatt From neoneye@adslhome.dk Sat Dec 13 05:41:20 2003 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBDAfJPf030696 for ; Sat, 13 Dec 2003 05:41:20 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id A6B2F480109 for ; Sat, 13 Dec 2003 11:41:17 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312122046.49029.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1071311906.33616.67.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sat, 13 Dec 2003 10:41:20 -0000 X-Original-Date: 13 Dec 2003 11:38:28 +0100 X-List-Received-Date: Sat, 13 Dec 2003 10:41:20 -0000 On Fri, 2003-12-12 at 21:46, Mark wrote: > the [...] format is now working for non capturing grouping Add this illegal testcase, it may surprise you. compile("a[xy)b") # compiles fine, shouldn't it fail? > I've almost finished working on assertions with the following working > <1,5> repeat I think I read that perl6 also has inverse ranges, so that ATOM are equal to ( ATOM<0,2> | ATOM<6,> ) not sure though > named character class > <[0-9]> explicit character class > <-[0-9]> inverse character class > > I still need to work on more complicated assertions such as > < - [0-2] > which would match all digits except 0,1 and 2, and code > assertions. Yes thats not trivial. the #parse_charclass will require some rewrite. The variable 'symbols' (also 'inverse_symbols'), are an Array containing either A) letter 'Y' B) letter-range 'X'..'Z' Some sort of add/subtract for this array seems to be necessary. > I have a couple of questions > > I want to add some new classes for code assertions and closures, > > CodeBlock > CodeAssertion > Closure >From my brief understanding of perl6, the only thing which are the difference on {closure} and , are that codeassert ignores the result ? Is that correct? If this is the case, then I would join the 2 classes. Perhaps call the class 'InlineCode'... and have a boolean which indicates weather the result should be ignored or not. > am I right in thinking that abstractsyntax.rb is the best place to put them? Exactly. > Also I'm making a list of features that I still need. Would it be best to put > it in the TODO file or to set up a seperate TODO file for Perl6 features? make it separate, 'TODO.perl6', 'README.perl6' ... etc. except for 'CHANGES'. The last week I have been sick.. now my headache are gone, and I am ready to work again. I will focus on implementing a better scanner-routine for Repeat. -- Simon Strandgaard From msparshatt@yahoo.co.uk Sat Dec 13 07:18:49 2003 Received: from smtp104.mail.sc5.yahoo.com (smtp104.mail.sc5.yahoo.com [66.163.169.223]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBDCImPf032278 for ; Sat, 13 Dec 2003 07:18:49 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp104.mail.sc5.yahoo.com with SMTP; 13 Dec 2003 12:18:49 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Sat, 13 Dec 2003 12:10:02 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <1071311906.33616.67.camel@server.neoneye.home> In-Reply-To: <1071311906.33616.67.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312131210.03021.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2003 12:18:49 -0000 On Saturday 13 Dec 2003 10:38 am, Simon Strandgaard wrote: > On Fri, 2003-12-12 at 21:46, Mark wrote: > > the [...] format is now working for non capturing grouping > > Add this illegal testcase, it may surprise you. > > compile("a[xy)b") # compiles fine, shouldn't it fail? > good point. I'll add some tests for cases like this and a fix right away > > I've almost finished working on assertions with the following working > > <1,5> repeat > > I think I read that perl6 also has inverse ranges, so that ATOM > are equal to ( ATOM<0,2> | ATOM<6,> ) not sure though > Yes negated ranges are allowed. > > named character class > > <[0-9]> explicit character class > > <-[0-9]> inverse character class > > > > I still need to work on more complicated assertions such as > > < - [0-2] > which would match all digits except 0,1 and 2, and > > code assertions. > > Yes thats not trivial. the #parse_charclass will require some rewrite. > Actually I've moved the handling for <...> into a seperate parse_assertion function. most of the complexity is in there. Parse Character class (which now just handles any cases of [...] within an assertion) hasn't had to change very much. > The variable 'symbols' (also 'inverse_symbols'), are an Array > containing either > A) letter 'Y' > B) letter-range 'X'..'Z' > > Some sort of add/subtract for this array seems to be necessary. > I agree that will be the best way > > I have a couple of questions > > > > I want to add some new classes for code assertions and closures, > > > > CodeBlock > > CodeAssertion > > Closure > > From my brief understanding of perl6, the only thing which are the > difference on {closure} and , are that codeassert ignores > the result ? Is that correct? > Actually closures ignore the result. > If this is the case, then I would join the 2 classes. Perhaps call the > class 'InlineCode'... and have a boolean which indicates weather the > result should be ignored or not. > One problem is after rereading the docs I've found a third type of code block, created using <{...}>. this executes the code and adds the result to the regexp. The types are Closure {...} Fails the match if the code raises an exception Code assertion <(...)> Fails the match if the code returns false Regexp code <{...}> Inserts the return value into the regexp There are two ways to handle these 1: use a single class, storing the type of code block as a flag within the class 2: use a class for each type of code block Personally I'd prefer to go the second route. Most of the code would be within the base class with each subclass overriding the call method to do the right thing. > > am I right in thinking that abstractsyntax.rb is the best place to put > > them? > > Exactly. > > > Also I'm making a list of features that I still need. Would it be best to > > put it in the TODO file or to set up a seperate TODO file for Perl6 > > features? > > make it separate, 'TODO.perl6', 'README.perl6' ... etc. > Okay, will do > except for 'CHANGES'. > > > The last week I have been sick.. now my headache are gone, and I am > ready to work again. I will focus on implementing a better > scanner-routine for Repeat. > I'm glad you're feeling better Best Regards Mark Sparshatt From neoneye@adslhome.dk Sat Dec 13 09:18:03 2003 Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBDEI2Pf001540 for ; Sat, 13 Dec 2003 09:18:03 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepb.post.tele.dk (Postfix) with ESMTP id 222635EE2DF for ; Sat, 13 Dec 2003 15:18:03 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312131210.03021.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <1071311906.33616.67.camel@server.neoneye.home> <200312131210.03021.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1071324908.33616.129.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sat, 13 Dec 2003 14:18:03 -0000 X-Original-Date: 13 Dec 2003 15:15:09 +0100 X-List-Received-Date: Sat, 13 Dec 2003 14:18:03 -0000 On Sat, 2003-12-13 at 13:10, Mark wrote: > On Saturday 13 Dec 2003 10:38 am, Simon Strandgaard wrote: > > On Fri, 2003-12-12 at 21:46, Mark wrote: > > > I have a couple of questions > > > > > > I want to add some new classes for code assertions and closures, > > > > > > CodeBlock > > > CodeAssertion > > > Closure > > > > From my brief understanding of perl6, the only thing which are the > > difference on {closure} and , are that codeassert ignores > > the result ? Is that correct? > > > Actually closures ignore the result. OK > > If this is the case, then I would join the 2 classes. Perhaps call the > > class 'InlineCode'... and have a boolean which indicates weather the > > result should be ignored or not. > > > > One problem is after rereading the docs I've found a third type of code block, > created using <{...}>. this executes the code and adds the result to the > regexp. ok > The types are > Closure {...} Fails the match if the code raises an exception > Code assertion <(...)> Fails the match if the code returns false > Regexp code <{...}> Inserts the return value into the regexp > > There are two ways to handle these > 1: use a single class, storing the type of code block as a flag within the > class > 2: use a class for each type of code block > > Personally I'd prefer to go the second route. Most of the code would be within > the base class with each subclass overriding the call method to do the right > thing. problem with (2) are that you will repeat code _many_ times. You will have to add 3 classes to AbstractSyntax module, extend every visitors with 3 #visit_xx methods. (1) is easiest to maintain and keep the big overview, thats what OO are all about. I like (1). -- Simon Strandgaard From msparshatt@yahoo.co.uk Sat Dec 13 10:19:04 2003 Received: from smtp004.mail.ukl.yahoo.com (smtp004.mail.ukl.yahoo.com [217.12.11.35]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBDFJ3Pf002400 for ; Sat, 13 Dec 2003 10:19:04 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp004.mail.ukl.yahoo.com with SMTP; 13 Dec 2003 15:19:04 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Sat, 13 Dec 2003 15:10:19 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312131210.03021.msparshatt@yahoo.co.uk> <1071324908.33616.129.camel@server.neoneye.home> In-Reply-To: <1071324908.33616.129.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312131510.20062.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2003 15:19:04 -0000 On Saturday 13 Dec 2003 2:15 pm, Simon Strandgaard wrote: > On Sat, 2003-12-13 at 13:10, Mark wrote: > > On Saturday 13 Dec 2003 10:38 am, Simon Strandgaard wrote: > > > On Fri, 2003-12-12 at 21:46, Mark wrote: > > > > I have a couple of questions > > > > > > > > I want to add some new classes for code assertions and closures, > > > > > > > > CodeBlock > > > > CodeAssertion > > > > Closure > > > > > > From my brief understanding of perl6, the only thing which are the > > > difference on {closure} and , are that codeassert > > > ignores the result ? Is that correct? > > > > Actually closures ignore the result. > > OK > > > > If this is the case, then I would join the 2 classes. Perhaps call the > > > class 'InlineCode'... and have a boolean which indicates weather the > > > result should be ignored or not. > > > > One problem is after rereading the docs I've found a third type of code > > block, created using <{...}>. this executes the code and adds the result > > to the regexp. > > ok > > > The types are > > Closure {...} Fails the match if the code raises an exception > > Code assertion <(...)> Fails the match if the code returns false > > Regexp code <{...}> Inserts the return value into the regexp > > > > There are two ways to handle these > > 1: use a single class, storing the type of code block as a flag within > > the class > > 2: use a class for each type of code block > > > > Personally I'd prefer to go the second route. Most of the code would be > > within the base class with each subclass overriding the call method to do > > the right thing. > > problem with (2) are that you will repeat code _many_ times. Not that much code needs to be repeated. The only methods that change are match and match_inspect. Everything else can just be put in the base class > You will have to add 3 classes to AbstractSyntax module, 4 including the abstract base class > extend every visitors with 3 #visit_xx methods. really you just need 1 visit method. Or at least that's how it seems from looking at the visitor classes that are already defined. > > (1) is easiest to maintain and keep the big overview, thats what > OO are all about. I like (1). Well OO-ness is in the eye of the beholder. IMHO giving objects that should have different behaviours different classes is more OO and helps maintainability by better encapsulating any changes. Anyway this is the code that I'm proposing adding class CodeBlock < Expression def initialize(code) @src = code #fix me #meed better way to create Proc object @code = eval "proc {#{code}}" end attr_reader :code, :src def match(other) raise "Calling match on abstract class" end def accept(visitor); visitor.visit_codeblock self end def ==(other); self.class == other.class and @src == other.src end def match_inspect raise "Calling match_inspect on abstract class" end end class CodeAssertion < CodeBlock def match(other) @code.call(other) end def match_inspect "<(#@src)>" end end class Closure < CodeBlock def match(other) begin @code.call(other) return true rescue return false; end end def match_inspect "{#@src}" end end class RegexpAssertion < CodeBlock def match(other) regexp = @code.call() #parse returned regexp #match against other end def match_inspect "<{#@src}>" end end class AssignRegisterVisitor def visit_codeblock(i); end end class RegexPrettyPrintVisitor def visit_codeblock(i) format_leaf("Code block " + i.match_inspect) end end Best Regards Mark Sparshatt From neoneye@adslhome.dk Sat Dec 13 13:04:15 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBDI4EPf005047 for ; Sat, 13 Dec 2003 13:04:15 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id B028B262A4A for ; Sat, 13 Dec 2003 19:04:14 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312131510.20062.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312131210.03021.msparshatt@yahoo.co.uk> <1071324908.33616.129.camel@server.neoneye.home> <200312131510.20062.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1071338486.33616.137.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sat, 13 Dec 2003 18:04:15 -0000 X-Original-Date: 13 Dec 2003 19:01:26 +0100 X-List-Received-Date: Sat, 13 Dec 2003 18:04:15 -0000 On Sat, 2003-12-13 at 16:10, Mark wrote: > > (1) is easiest to maintain and keep the big overview, thats what > > OO are all about. I like (1). > > Well OO-ness is in the eye of the beholder. IMHO giving objects that should > have different behaviours different classes is more OO and helps > maintainability by better encapsulating any changes. > > Anyway this is the code that I'm proposing adding I didn't expect to see such kind of solution. Its OK, I like it, still little (2).. but OK. You are welcome to add it. -- Simon Strandgaard From msparshatt@yahoo.co.uk Mon Dec 15 17:03:37 2003 Received: from smtp104.mail.sc5.yahoo.com (smtp104.mail.sc5.yahoo.com [66.163.169.223]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBFM3aPf022973 for ; Mon, 15 Dec 2003 17:03:37 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp104.mail.sc5.yahoo.com with SMTP; 15 Dec 2003 22:03:37 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Mon, 15 Dec 2003 21:54:47 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312131510.20062.msparshatt@yahoo.co.uk> <1071338486.33616.137.camel@server.neoneye.home> In-Reply-To: <1071338486.33616.137.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312152154.47949.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2003 22:03:37 -0000 Hi, > > > > Anyway this is the code that I'm proposing adding > > I didn't expect to see such kind of solution. I guess I wasn't clear when explaining what I intended. > Its OK, I like it, still little (2).. but OK. > You are welcome to add it. > okay I've commited it. I've also added tests for the cases /(...]/ amd /[...)/ to make sure that they throw errors. At the moment either case throws a runtime error saying "mismatched brackets" I've added a TODO.perl6 file as well Best Regards Mark Sparshatt From neoneye@adslhome.dk Mon Dec 15 18:19:26 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBFNJPPf023965 for ; Mon, 15 Dec 2003 18:19:26 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 968E22629D0 for ; Tue, 16 Dec 2003 00:19:25 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312152154.47949.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312131510.20062.msparshatt@yahoo.co.uk> <1071338486.33616.137.camel@server.neoneye.home> <200312152154.47949.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1071530200.43483.19.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 15 Dec 2003 23:19:26 -0000 X-Original-Date: 16 Dec 2003 00:16:41 +0100 X-List-Received-Date: Mon, 15 Dec 2003 23:19:26 -0000 On Mon, 2003-12-15 at 22:54, Mark wrote: > > You are welcome to add it. > > okay I've commited it. Great > I've also added tests for the cases /(...]/ amd /[...)/ to make sure that they > throw errors. > > At the moment either case throws a runtime error saying "mismatched brackets" > > I've added a TODO.perl6 file as well Yes I have looked at it. Are you aware that you can get the constructed AbstractSyntaxTree printed?? so that when you are straigthen out parse problems, its will be easier to spot errornous constructions, and perhaps get a clue why they occured. enabling debugging for just one testcase: You can also use puts/p/print statements inside your code the same way as in 'scanner.rb'. In order to do that, you will have to "include Debuggable" into the Perl6Parser class. In the TestPerl6Parser class you can now use the 'debug' keyword, For instance: debug :test_repeat_range1 Can you get this debugging thing to work? need any help? BTW: Do you know if there exists testsuites that exercises this user-friendly perl6 syntax ? -- Simon Strandgaard From msparshatt@yahoo.co.uk Mon Dec 22 14:47:39 2003 Received: from smtp001.mail.ukl.yahoo.com (smtp001.mail.ukl.yahoo.com [217.12.11.32]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBMJlcPf023734 for ; Mon, 22 Dec 2003 14:47:38 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp001.mail.ukl.yahoo.com with SMTP; 22 Dec 2003 19:47:39 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Mon, 22 Dec 2003 19:38:13 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312152154.47949.msparshatt@yahoo.co.uk> <1071530200.43483.19.camel@server.neoneye.home> In-Reply-To: <1071530200.43483.19.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312221938.13864.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2003 19:47:39 -0000 Hi, > Are you aware that you can get the constructed AbstractSyntaxTree > printed?? so that when you are straigthen out parse problems, its will > be easier to spot errornous constructions, and perhaps get a clue why > they occured. > > enabling debugging for just one testcase: > You can also use puts/p/print statements inside your code the > same way as in 'scanner.rb'. In order to do that, you will have > to "include Debuggable" into the Perl6Parser class. > In the TestPerl6Parser class you can now use the 'debug' keyword, > For instance: debug :test_repeat_range1 > > Can you get this debugging thing to work? need any help? > I've managd to get the debugging working okay. I was doing my debugging by adding p statements then commenting out all but the test I wanted to check. This way seems to be a lot easier, thanks. > > BTW: Do you know if there exists testsuites that exercises this > user-friendly perl6 syntax ? > There are some tests available for it that come with parrot. They're all in perl but I think it shouldn't be too hard to write a script that extracts the test cases and outputs the correct ruby code. Though at the moment the tests aren't very comprehensive. I'm going to work on negative ranges such as . The best way to do this seems to be to add a flag to the range class to say whether it's negated or not, as with character classes. Does this seem reasonable to you? Best Regards Mark Sparshatt From neoneye@adslhome.dk Mon Dec 22 18:04:26 2003 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBMN4OPf026990 for ; Mon, 22 Dec 2003 18:04:26 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id 9CC5E47FF52 for ; Tue, 23 Dec 2003 00:04:23 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312221938.13864.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312152154.47949.msparshatt@yahoo.co.uk> <1071530200.43483.19.camel@server.neoneye.home> <200312221938.13864.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1072134109.69026.29.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 22 Dec 2003 23:04:26 -0000 X-Original-Date: 23 Dec 2003 00:01:49 +0100 X-List-Received-Date: Mon, 22 Dec 2003 23:04:26 -0000 On Mon, 2003-12-22 at 20:38, Mark wrote: > > BTW: Do you know if there exists testsuites that exercises this > > user-friendly perl6 syntax ? > There are some tests available for it that come with parrot. They're all in > perl but I think it shouldn't be too hard to write a script that extracts the > test cases and outputs the correct ruby code. Though at the moment the tests > aren't very comprehensive. Great.. I will look into this one day. > I'm going to work on negative ranges such as . The best way to do this > seems to be to add a flag to the range class to say whether it's negated or > not, as with character classes. Does this seem reasonable to you? Maybe its easier to interpret negative ranges.. lets for instance consider we are interpreting Then I would translate it into an alternation between the surrounding ranges, in this case <0,41> and <667,>. res = mk_alternation( mk_repeat(expression, 0, min), mk_repeat(expression, max, -1) ) Later it can be optimized, as you mention, by having a flag for it. I am very busy this Christmas, I guess all coding will be on standby until next year. I will probably loose some braincells because of strong alcohol, and thus the quality of the code will be reduced. Anyway, I am in the process of reworking the repeat algorithm. The current routine are incorrect and inefficient. My changes only have effect on 'scanner.rb' so don't expect any big changes. wish you a happy Christmas too. -- Simon Strandgaard From msparshatt@yahoo.co.uk Tue Dec 23 17:05:01 2003 Received: from smtp004.mail.ukl.yahoo.com (smtp004.mail.ukl.yahoo.com [217.12.11.35]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBNM50Pf032571 for ; Tue, 23 Dec 2003 17:05:00 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp004.mail.ukl.yahoo.com with SMTP; 23 Dec 2003 22:04:59 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Tue, 23 Dec 2003 21:55:50 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312221938.13864.msparshatt@yahoo.co.uk> <1072134109.69026.29.camel@server.neoneye.home> In-Reply-To: <1072134109.69026.29.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312232155.50422.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2003 22:05:01 -0000 Hi, On Monday 22 Dec 2003 11:01 pm, Simon Strandgaard wrote: > On Mon, 2003-12-22 at 20:38, Mark wrote: > > I'm going to work on negative ranges such as . The best way to do > > this seems to be to add a flag to the range class to say whether it's > > negated or not, as with character classes. Does this seem reasonable to > > you? > > Maybe its easier to interpret negative ranges.. lets for instance > consider we are interpreting Then I would translate it > into an alternation between the surrounding ranges, in this case > <0,41> and <667,>. > > res = mk_alternation( > mk_repeat(expression, 0, min), > mk_repeat(expression, max, -1) > ) > > Later it can be optimized, as you mention, by having a flag for it. > Okay, that's how I've done it. One optimisation I've added is if min=0 then it only creates the second range. > > > I am very busy this Christmas, I guess all coding will be on standby > until next year. I will probably loose some braincells because of strong > alcohol, and thus the quality of the code will be reduced. > > Anyway, I am in the process of reworking the repeat algorithm. > The current routine are incorrect and inefficient. > My changes only have effect on 'scanner.rb' so don't expect any big > changes. > I've started working on parsing the different types of code block. I've added a test creating a regexp that matches a number that is up to 3 digits long then uses a code assertion to check that the number is less than 256. One thing I'd like to do is modify the NewRegexp class so that the initialize function takes as an optional parameter a class object which it would use as the parser for the regexp. This would default to being the standard Parser class. What do you thinkk? > wish you a happy Christmas too. To you too. And a happy Yule as well :-) Best Regards Mark Sparshatt From neoneye@adslhome.dk Tue Dec 23 19:07:28 2003 Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBO07RPf001955 for ; Tue, 23 Dec 2003 19:07:28 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepb.post.tele.dk (Postfix) with ESMTP id EB6F35EE120; Wed, 24 Dec 2003 01:07:27 +0100 (CET) From: Simon Strandgaard To: wayne@mail.gomonarch.com, AEditor In-Reply-To: <00ca01c3c9af$35f64e60$410a0a0a@gomonarch.com> References: <00ca01c3c9af$35f64e60$410a0a0a@gomonarch.com> Content-Type: text/plain Organization: Message-Id: <1072224293.82498.54.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: undo pattern X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 24 Dec 2003 00:07:29 -0000 X-Original-Date: 24 Dec 2003 01:04:53 +0100 X-List-Received-Date: Wed, 24 Dec 2003 00:07:29 -0000 On Wed, 2003-12-24 at 00:48, Wayne Rasmussen wrote: > Some time ago you posted an article about this class and that you had > some 110 line code to give as an example. The link doesn't work > anymore. How could I get a chance to see this? Is there an updated > link? yes rubyforge has changed from using cvsweb to viewcvs. The undo/redo/macro system of 110 lines of code, see 'history.rb', here: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/core/source/history.rb?rev=1.9&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup You can look at some of the other files for examples of usage. For instance have a look at: http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/core/source/commands_movement.rb?rev=1.5&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup If you want to try undo/redo/macros out, I suggest you try downloading AEditor. It depends on Ruby-1.8.0 and ruby-ncurses. http://rubyforge.org/project/showfiles.php?group_id=18 Are you familiar with the Ruby programming language ? BTW: happy christmas ;-) -- Simon Strandgaard From neoneye@adslhome.dk Tue Dec 23 19:32:51 2003 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBO0WoPf002362 for ; Tue, 23 Dec 2003 19:32:51 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id 2971547FFF0; Wed, 24 Dec 2003 01:32:51 +0100 (CET) From: Simon Strandgaard To: wayne@mail.gomonarch.com, AEditor In-Reply-To: <00d601c3c9b3$00071920$410a0a0a@gomonarch.com> References: <00d601c3c9b3$00071920$410a0a0a@gomonarch.com> Content-Type: text/plain Organization: Message-Id: <1072225816.82498.65.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] RE: undo pattern X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 24 Dec 2003 00:32:52 -0000 X-Original-Date: 24 Dec 2003 01:30:16 +0100 X-List-Received-Date: Wed, 24 Dec 2003 00:32:52 -0000 On Wed, 2003-12-24 at 01:15, Wayne Rasmussen wrote: > > From: Simon Strandgaard [mailto:neoneye@adslhome.dk] > > On Wed, 2003-12-24 at 00:48, Wayne Rasmussen wrote: > > > Some time ago you posted an article about this class and > > > that you had some 110 line code to give as an example. > > > The link doesn't work anymore. How could I get a chance > > > to see this? Is there an updated link? > > > > yes rubyforge has changed from using cvsweb to viewcvs. > > > > The undo/redo/macro system of 110 lines of code, see > > 'history.rb', here: > > http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/core/source/history.rb?rev=1.9&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup > > Thank you very much. I am looking at it right now! If there are conceptual things you have problems understanding, then feel free to ask. > > You can look at some of the other files for examples of usage. > > For instance have a look at: > > http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/core/source/commands_movement.rb?rev=1.5&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup > > > > > > If you want to try undo/redo/macros out, I suggest you try > > downloading AEditor. It depends on Ruby-1.8.0 and ruby-ncurses. > > http://rubyforge.org/project/showfiles.php?group_id=18 > > > > Are you familiar with the Ruby programming language ? > > Actually, no. I am looking to do something in java for a friend and someone > pointed me in the pattern direction. It was going to be small but I not > sure how much larger it will be getting... > > thank you again for the information! It will be helpful. > wayne The same primitives are available in Java. I rely on Object.clone() and a list data structure, IIRC thats about it. I'm curious to which kind of application you plan to implement? BTW: Whats your first impression of Ruby, is it understandable to you? -- Simon Strandgaard From neoneye@adslhome.dk Wed Dec 24 04:10:12 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBO9ABPf026524 for ; Wed, 24 Dec 2003 04:10:12 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id C22E0262973; Wed, 24 Dec 2003 10:10:11 +0100 (CET) From: Simon Strandgaard To: wayne@mail.gomonarch.com, AEditor In-Reply-To: <00dd01c3c9b6$97156b20$410a0a0a@gomonarch.com> References: <00dd01c3c9b6$97156b20$410a0a0a@gomonarch.com> Content-Type: text/plain Organization: Message-Id: <1072256861.84381.8.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] RE: undo pattern X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 24 Dec 2003 09:10:12 -0000 X-Original-Date: 24 Dec 2003 10:07:41 +0100 X-List-Received-Date: Wed, 24 Dec 2003 09:10:12 -0000 On Wed, 2003-12-24 at 01:40, Wayne Rasmussen wrote: > > From: Simon Strandgaard [mailto:neoneye@adslhome.dk] > > I'm curious to which kind of application you plan to implement? > > My friend is running his Wild West Campaign so I thought it might be nice to > implement something to step through the game when we play. Currently there > is a card drawing scheme for that, plus people sometimes conviently forget > certain actions in the game like reloading their guns. So this was the > idea. I know at some point, someone would want to back up from what they > did, or the friend might have clicked on the wrong button! Ok. > http://tdasys.com/the_bengal_club/ Wow there are _many_ tin soldiers.. amazing. > > BTW: Whats your first impression of Ruby, is it understandable to you? > > Not sure if it was applicable, not having a lot of free time to explore new > languages as such. I am just doing a simple thing. I have done some > programming in the past. Machine language, assembly, and when I was at > Symbolics, Inc. Lisp. The code you are looking at (the files with suffix ".rb") are Ruby code. I think Ruby is some of the cleanest languages that I have seen so far. I assume its quite readable to non-ruby-programmers. All I were asking about were if understood my code ;-) -- Simon Strandgaard From neoneye@adslhome.dk Wed Dec 24 04:59:02 2003 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBO9x1Pf026773 for ; Wed, 24 Dec 2003 04:59:02 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id F0308262A5A for ; Wed, 24 Dec 2003 10:59:01 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312232155.50422.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312221938.13864.msparshatt@yahoo.co.uk> <1072134109.69026.29.camel@server.neoneye.home> <200312232155.50422.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1072259785.84381.31.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 24 Dec 2003 09:59:03 -0000 X-Original-Date: 24 Dec 2003 10:56:26 +0100 X-List-Received-Date: Wed, 24 Dec 2003 09:59:03 -0000 On Tue, 2003-12-23 at 22:55, Mark wrote: > On Monday 22 Dec 2003 11:01 pm, Simon Strandgaard wrote: > > On Mon, 2003-12-22 at 20:38, Mark wrote: > > > I'm going to work on negative ranges such as . The best way to do > > > this seems to be to add a flag to the range class to say whether it's > > > negated or not, as with character classes. Does this seem reasonable to > > > you? > > > > Maybe its easier to interpret negative ranges.. lets for instance > > consider we are interpreting Then I would translate it > > into an alternation between the surrounding ranges, in this case > > <0,41> and <667,>. > > > > res = mk_alternation( > > mk_repeat(expression, 0, min), > > mk_repeat(expression, max, -1) > > ) > > > > Later it can be optimized, as you mention, by having a flag for it. > > > > Okay, that's how I've done it. One optimisation I've added is if min=0 then it > only creates the second range. Looks OK to me... I see you are using Debuggable, great :-) http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/projects/regexp_engine/source/perl6parser.rb.diff?r1=1.4&r2=1.5&cvsroot=aeditor When doing 'ruby test_perl6parser.rb', so that the file gets executed alone, were broken.. I have fixed it. > > I am very busy this Christmas, I guess all coding will be on standby > > until next year. I will probably loose some braincells because of strong > > alcohol, and thus the quality of the code will be reduced. > > > > Anyway, I am in the process of reworking the repeat algorithm. > > The current routine are incorrect and inefficient. > > My changes only have effect on 'scanner.rb' so don't expect any big > > changes. > > > > I've started working on parsing the different types of code block. I've added > a test creating a regexp that matches a number that is up to 3 digits long > then uses a code assertion to check that the number is less than 256. Why is there a max limit of 256 ? I think I have misunderstood something. > One thing I'd like to do is modify the NewRegexp class so that the initialize > function takes as an optional parameter a class object which it would use as > the parser for the regexp. This would default to being the standard Parser > class. What do you thinkk? Thats Ok, if things doesn't work out, then we can alway change it. > > wish you a happy Christmas too. > > To you too. And a happy Yule as well :-) In danish its named 'jul', which are the same as 'yule'.. pronounced the same way. -- Simon Strandgaard From msparshatt@yahoo.co.uk Wed Dec 24 05:29:04 2003 Received: from smtp004.mail.ukl.yahoo.com (smtp004.mail.ukl.yahoo.com [217.12.11.35]) by rubyforge.org (8.12.8/8.12.5) with SMTP id hBOAT3Pf027600 for ; Wed, 24 Dec 2003 05:29:03 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp004.mail.ukl.yahoo.com with SMTP; 24 Dec 2003 10:11:36 -0000 From: Mark To: aeditor-talk@rubyforge.org Subject: Re: [Aeditor-talk] Regexp assertions Date: Wed, 24 Dec 2003 10:02:27 +0000 User-Agent: KMail/1.5.3 References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312232155.50422.msparshatt@yahoo.co.uk> <1072259785.84381.31.camel@server.neoneye.home> In-Reply-To: <1072259785.84381.31.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312241002.28880.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2003 10:29:04 -0000 On Wednesday 24 Dec 2003 9:56 am, Simon Strandgaard wrote: > When doing 'ruby test_perl6parser.rb', so that the file gets > executed alone, were broken.. I have fixed it. > Okay, thanks. > > I've started working on parsing the different types of code block. I've > > added a test creating a regexp that matches a number that is up to 3 > > digits long then uses a code assertion to check that the number is less > > than 256. > > Why is there a max limit of 256 ? I think I have misunderstood > something. well it's just an example of using a code assertion. If you wanted to extract a number between 0 and 256 from a string then this is one way to do it. > > > One thing I'd like to do is modify the NewRegexp class so that the > > initialize function takes as an optional parameter a class object which > > it would use as the parser for the regexp. This would default to being > > the standard Parser class. What do you thinkk? > > Thats Ok, if things doesn't work out, then we can alway change it. > Okay then. I'm home early from work today so I'll do that now. Best Regards Mark Sparshatt From neoneye@adslhome.dk Wed Dec 24 05:44:11 2003 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBOAiAPf027623 for ; Wed, 24 Dec 2003 05:44:11 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id 19007480049 for ; Wed, 24 Dec 2003 11:44:11 +0100 (CET) Subject: Re: [Aeditor-talk] Regexp assertions From: Simon Strandgaard To: AEditor In-Reply-To: <200312241002.28880.msparshatt@yahoo.co.uk> References: <200312122046.49029.msparshatt@yahoo.co.uk> <200312232155.50422.msparshatt@yahoo.co.uk> <1072259785.84381.31.camel@server.neoneye.home> <200312241002.28880.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1072262500.84381.42.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: aeditor-talk@rubyforge.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 24 Dec 2003 10:44:11 -0000 X-Original-Date: 24 Dec 2003 11:41:40 +0100 X-List-Received-Date: Wed, 24 Dec 2003 10:44:11 -0000 On Wed, 2003-12-24 at 11:02, Mark wrote: > On Wednesday 24 Dec 2003 9:56 am, Simon Strandgaard wrote: > > > I've started working on parsing the different types of code block. I've > > > added a test creating a regexp that matches a number that is up to 3 > > > digits long then uses a code assertion to check that the number is less > > > than 256. > > > > Why is there a max limit of 256 ? I think I have misunderstood > > something. > > well it's just an example of using a code assertion. If you wanted to extract > a number between 0 and 256 from a string then this is one way to do it. Using old perl5 syntax then it becomes a huge expression. Using a code-hook simplifies things I see.. I have to turn off my computer now and switch to christmas-mode. see you in the next year when all these christmas parties are finished. Have a nice evening. -- Simon Strandgaard From neoneye@adslhome.dk Mon Dec 29 10:05:23 2003 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id hBTF5MPf028414 for ; Mon, 29 Dec 2003 10:05:23 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id 80DA147FF75 for ; Mon, 29 Dec 2003 16:05:22 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: text/plain Organization: Message-Id: <1072710114.4582.57.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Subject: [Aeditor-talk] transition from 2003 into 2004 X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 29 Dec 2003 15:05:24 -0000 X-Original-Date: 29 Dec 2003 16:01:55 +0100 X-List-Received-Date: Mon, 29 Dec 2003 15:05:24 -0000 Here is a brief summary of Aeditor events in year 2003. Also wishes for whats going to happen next year. in 2002 Aeditor were written in C++. I had long thought about making the program scriptable in Ruby. In the beginning of 2003 I started studying how to let C++ and Ruby play together. Finally I wrote a long tutorial about the subject, inclusive a skeleton c++/ruby project. SWIG really surprised me. http://aeditor.rubyforge.org/ruby_cplusplus/index.html While studying how to embed Ruby into C++, I began thinking about rewriting the whole editor in Ruby, and just ignore about the eventual slowdown. This were my first encounter with test-first development. After a 1 month period I had the editor reimplemented in Ruby, it were more stable and I could not feel any slowdown. All the problems I have been struggling with in C++ were gone. I decided to use only Ruby from now on. After 3 months Aeditor had these features: * folding. * undo/redo/macros. * selections. The plans always changes. My gained knowledge about embedding Ruby could be used for making a graphical Aeditor frontend. I have played around with Qt, Gtk, Fox, Wx, fltk. But I cannot decide what to use. Qt are limited by its license, gtk could have a better api, fox+fltk has i18n and looknfeel limits. Opinions are needed. This experiment has taken me 2 months. Still Aeditor lacks syntax-hiliting, which depends on having a regexp engine. I could not use Ruby's internal regexp engine, because I want to use a complex data structure (complex because of folding). Thus I needed an engine which could take input as an iterator. Shortly after initiating the regexp project, Mark Sparshatt joined the regexp-project. Mark are working on a perl6 regexp parser. I had written a perl5/ruby compatible parser. I want to use perl6 regexp to describe syntax hiliting in Aeditor. I want to help Mark with perl6, when I am done implementing the scanner (when the number of passed rubicon tests cannot get improved any longer). The regexp project has been going on for 3 months now, the first 2 months went quickly and lots of things happened. Through the last month 'december' I have been rethinking the scanner algorithm (last night I had a breaktrhough with a new algorithm). Other editor projects which wants to implement everything in Ruby are beginning to show up. I got the idea first, they stole it from me, but thats all right, no hard feelings. I am against patents. VI clone written entirely in Ruby. RVSH has syntax hiliting! http://raa.ruby-lang.org/list.rhtml?name=rvsh NED. no code yet, but looks interesting. http://ned.rubyforge.org/ An exciting year. What will happen in year 2004 ? I expect the regexp engine to be completed soon (max 2 months from now). Then it will be possible to implement syntax hiliting. A new data structure which are less memory consuming, which can deal with folding+syntaxhiliting. I will probably need to do this in C++. Hopefully a nice GUI frontend will be added. Opinions needed to which GUI-toolkit I should choose? Maybe embed the Aeditor widget into FreeRIDE ? -- Simon Strandgaard From msparshatt@yahoo.co.uk Sun Jan 4 06:38:08 2004 Received: from smtp100.mail.sc5.yahoo.com (smtp100.mail.sc5.yahoo.com [216.136.174.138]) by rubyforge.org (8.12.8/8.12.5) with SMTP id i04Bc7Pf008283 for ; Sun, 4 Jan 2004 06:38:08 -0500 Received: from unknown (HELO desktop.localdomain) (msparshatt@212.56.105.204 with plain) by smtp100.mail.sc5.yahoo.com with SMTP; 4 Jan 2004 11:38:06 -0000 From: Mark To: programmers editor written entirely in Ruby Subject: Re: [Aeditor-talk] transition from 2003 into 2004 Date: Sun, 4 Jan 2004 12:34:18 +0000 User-Agent: KMail/1.5.3 References: <1072710114.4582.57.camel@server.neoneye.home> In-Reply-To: <1072710114.4582.57.camel@server.neoneye.home> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401041234.18676.msparshatt@yahoo.co.uk> X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2004 11:38:08 -0000 On Monday 29 Dec 2003 3:01 pm, Simon Strandgaard wrote: > > Hopefully a nice GUI frontend will be added. Opinions needed to which > GUI-toolkit I should choose? > I would recommend using a toolkit which available along with Ruby. Which means either TK, which is part of the standard library, or Fox, which at least is part of the windows installer. I don't do much GUI programming but having experimented with both of them I think that Fox has a cleaner API. Also AFAIK FreeRide uses Fox, so that would make your next point easier. > Maybe embed the Aeditor widget into FreeRIDE ? > > Best Regards Mark Sparshatt From neoneye@adslhome.dk Sun Jan 4 07:12:57 2004 Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i04CCuPf009053 for ; Sun, 4 Jan 2004 07:12:57 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepb.post.tele.dk (Postfix) with ESMTP id EEBF75EE2CB for ; Sun, 4 Jan 2004 13:12:56 +0100 (CET) Subject: Re: [Aeditor-talk] transition from 2003 into 2004 From: Simon Strandgaard To: programmers editor written entirely in Ruby In-Reply-To: <200401041234.18676.msparshatt@yahoo.co.uk> References: <1072710114.4582.57.camel@server.neoneye.home> <200401041234.18676.msparshatt@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1073218169.27699.24.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 04 Jan 2004 12:12:57 -0000 X-Original-Date: 04 Jan 2004 13:09:29 +0100 X-List-Received-Date: Sun, 04 Jan 2004 12:12:57 -0000 On Sun, 2004-01-04 at 13:34, Mark wrote: > On Monday 29 Dec 2003 3:01 pm, Simon Strandgaard wrote: > > > > > > Hopefully a nice GUI frontend will be added. Opinions needed to which > > GUI-toolkit I should choose? > > > > I would recommend using a toolkit which available along with Ruby. Which means > either TK, which is part of the standard library, or Fox, which at least is > part of the windows installer. Did not know that fxruby are shipped with the windows installer? Thats cool, that will affect the outcome of this question. > I don't do much GUI programming but having experimented with both of them I > think that Fox has a cleaner API. > > Also AFAIK FreeRide uses Fox, so that would make your next point easier. > > > Maybe embed the Aeditor widget into FreeRIDE ? > > Yes Fox has a much cleaner api than TK. Actually its cleaner than many other gui toolkits. Making custom widgets are less complex than elsewhere. Yes FreeRIDE uses fxruby. Though I see a few problems with fox: * no unicode, no i18n. Will have to wait until version2. * fox doesn't use font rendering done by the X11-server, so no anti aliasing. A solution could be to render the widget myself, by using freetype and operate with unicode inside the widget. This is a thought which keeps coming back.. I guess this will become the future. OTOH Gnome/Qt has unicode and antialiasing. But gnome api are nasty and qt license sux. BTW: The new regexp-scanner routine are almost done. The only problem remaining are nested repeats /x((.)*)*x/, which I hope to solve soon. Its deals much more efficient with repeats than the previous routine. The previous routine had a conceptualy broken backtracking routine, in the new routine it of cause works. I will let you know about its progress. -- Simon Strandgaard From neoneye@adslhome.dk Mon Jan 26 09:32:28 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0QEWRPf031194 for ; Mon, 26 Jan 2004 09:32:28 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id A088F262D71 for ; Mon, 26 Jan 2004 15:32:26 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: multipart/mixed; boundary="=-79GG8yXR0hEY7dwCarRo" Organization: Message-Id: <1075127337.16043.4.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Subject: [Aeditor-talk] [Fwd: docbook problem] X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 26 Jan 2004 14:32:28 -0000 X-Original-Date: 26 Jan 2004 15:28:57 +0100 X-List-Received-Date: Mon, 26 Jan 2004 14:32:28 -0000 --=-79GG8yXR0hEY7dwCarRo Content-Type: text/plain Content-Transfer-Encoding: 7bit --=-79GG8yXR0hEY7dwCarRo Content-Disposition: inline Content-Description: Forwarded message - docbook problem Content-Type: message/rfc822 Return-Path: Received: from rubyforge.org ([66.92.167.78]) by fepD.post.tele.dk (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with ESMTP id <20040125225402.YMGJ9988.fepD.post.tele.dk@rubyforge.org> for ; Sun, 25 Jan 2004 23:54:02 +0100 Received: from rubyforge.org (localhost.localdomain [127.0.0.1]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0PMs1Pf029272 for ; Sun, 25 Jan 2004 17:54:01 -0500 Received: (from webuser@localhost) by rubyforge.org (8.12.8/8.12.8/Submit) id i0PMs0Bw029270; Sun, 25 Jan 2004 17:54:00 -0500 Date: Sun, 25 Jan 2004 17:54:00 -0500 Message-Id: <200401252254.i0PMs0Bw029270@rubyforge.org> X-Authentication-Warning: rubyforge.org: webuser set sender to pierre42d@9online.fr using -f To: neoneye@adslhome.dk From: Pierre Subject: docbook problem Content-type: text/plain; charset=ISO-8859-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Hi, I'm wrting you about your dobbook page : http://aeditor.rubyforge.org/mini_docbook.html I try to make it as you tell, but I got the "Failed to load external entity "xhtml_onechunk"" problem. My variable seems ok : $ env | grep XML_CATALOG_FILES XML_CATALOG_FILES=catalog.xml:/usr/local/share/sgml/docbook/catalog.xml:/usr/local/share/xml/docbook/4.2/catalog.xml:/etc/xml/catalog and the catalog is valid xml... Any help would be great ! Regards, Pierre. --=-79GG8yXR0hEY7dwCarRo-- From neoneye@adslhome.dk Mon Jan 26 09:41:55 2004 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0QEfsPf031219 for ; Mon, 26 Jan 2004 09:41:55 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id 4F0834800E2; Mon, 26 Jan 2004 15:41:53 +0100 (CET) From: Simon Strandgaard To: Pierre , AEditor In-Reply-To: <200401252254.i0PMs0Bw029270@rubyforge.org> References: <200401252254.i0PMs0Bw029270@rubyforge.org> Content-Type: text/plain Organization: Message-Id: <1075127903.16043.15.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: docbook problem X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 26 Jan 2004 14:41:55 -0000 X-Original-Date: 26 Jan 2004 15:38:24 +0100 X-List-Received-Date: Mon, 26 Jan 2004 14:41:55 -0000 On Sun, 2004-01-25 at 23:54, Pierre wrote: > Hi, > > I'm wrting you about your dobbook page : http://aeditor.rubyforge.org/mini_docbook.html > > I try to make it as you tell, but I got the "Failed to load external entity "xhtml_onechunk"" problem. > My variable seems ok : > > $ env | grep XML_CATALOG_FILES > XML_CATALOG_FILES=catalog.xml:/usr/local/share/sgml/docbook/catalog.xml:/usr/local/share/xml/docbook/4.2/catalog.xml:/etc/xml/catalog yes its ok. > and the catalog is valid xml... > > Any help would be great ! Ok, I need to know a little more about your setup. Can you attach these 3 files: Makefile, catalog.xml, main.xml. Also if you can copy/paste the commandline output when you invoke 'make'. -- Simon Strandgaard From neoneye@adslhome.dk Mon Jan 26 16:24:39 2004 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0QLOcPf007837 for ; Mon, 26 Jan 2004 16:24:38 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id A66B347FF5B for ; Mon, 26 Jan 2004 22:24:34 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: multipart/mixed; boundary="=-3LB9yoFbcpmL0IHDDf7Y" Organization: Message-Id: <1075152064.17056.0.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Subject: [Aeditor-talk] [Fwd: Re: docbook problem] X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 26 Jan 2004 21:24:39 -0000 X-Original-Date: 26 Jan 2004 22:21:05 +0100 X-List-Received-Date: Mon, 26 Jan 2004 21:24:39 -0000 --=-3LB9yoFbcpmL0IHDDf7Y Content-Type: text/plain Content-Transfer-Encoding: 7bit --=-3LB9yoFbcpmL0IHDDf7Y Content-Disposition: inline Content-Description: Forwarded message - Re: docbook problem Content-Type: message/rfc822 Return-Path: Received: from ns1.epinetworx.com ([62.212.113.216]) by fepY.post.tele.dk (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with ESMTP id <20040126185704.QHTT3141.fepY.post.tele.dk@ns1.epinetworx.com> for ; Mon, 26 Jan 2004 19:57:04 +0100 Received: from [172.16.3.24] (helo=9online.fr) by ns1.epinetworx.com with esmtp (Exim 3.33 #1 ) id 1AlC0j-000GDe-00 for ; Mon, 26 Jan 2004 20:03:01 +0100 Message-ID: <4015631A.1030304@9online.fr> Date: Mon, 26 Jan 2004 19:57:30 +0100 From: Pierre User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: fr-fr, fr, en, en-us MIME-Version: 1.0 To: neoneye@adslhome.dk Subject: Re: docbook problem References: <200401252254.i0PMs0Bw029270@rubyforge.org> <1075127903.16043.15.camel@server.neoneye.home> In-Reply-To: <1075127903.16043.15.camel@server.neoneye.home> Content-Type: multipart/mixed; boundary="------------050703080000070405090406" This is a multi-part message in MIME format. --------------050703080000070405090406 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Simon Strandgaard wrote: > On Sun, 2004-01-25 at 23:54, Pierre wrote: > >>Hi, >> >>I'm wrting you about your dobbook page : http://aeditor.rubyforge.org/mini_docbook.html >> >>I try to make it as you tell, but I got the "Failed to load external entity "xhtml_onechunk"" problem. >>My variable seems ok : >> >>$ env | grep XML_CATALOG_FILES >>XML_CATALOG_FILES=catalog.xml:/usr/local/share/sgml/docbook/catalog.xml:/usr/local/share/xml/docbook/4.2/catalog.xml:/etc/xml/catalog > > > yes its ok. > > > >>and the catalog is valid xml... >> >>Any help would be great ! > > > Ok, I need to know a little more about your setup. > > Can you attach these 3 files: Makefile, catalog.xml, main.xml. Done. > Also if you can copy/paste the commandline output when you invoke > 'make'. # gmake xsltproc \ --output index.html \ xhtml_onechunk \ main.xml warning: failed to load external entity "xhtml_onechunk" cannot parse xhtml_onechunk gmake: *** [onechunk] Error 4 -- Pierre. --------------050703080000070405090406 Content-Type: text/plain; name="Makefile" Content-Disposition: inline; filename="Makefile" Content-Transfer-Encoding: 7bit onechunk: xsltproc \ --output index.html \ xhtml_onechunk \ main.xml chunks: xsltproc \ --output index.html \ xhtml_chunks \ main.xml catalog: xmllint --valid --noout catalog.xml main: xmllint --valid --noout main.xml --------------050703080000070405090406 Content-Type: text/xml; name="catalog.xml" Content-Disposition: inline; filename="catalog.xml" Content-Transfer-Encoding: 7bit --------------050703080000070405090406 Content-Type: text/xml; name="main.xml" Content-Disposition: inline; filename="main.xml" Content-Transfer-Encoding: 7bit
Title placeholder
--------------050703080000070405090406-- --=-3LB9yoFbcpmL0IHDDf7Y-- --=-3LB9yoFbcpmL0IHDDf7Y-- From neoneye@adslhome.dk Mon Jan 26 16:31:36 2004 Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0QLVXPf007856 for ; Mon, 26 Jan 2004 16:31:36 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepb.post.tele.dk (Postfix) with ESMTP id 8E9035EE2BC; Mon, 26 Jan 2004 22:31:32 +0100 (CET) From: Simon Strandgaard To: Pierre , AEditor In-Reply-To: <4015631A.1030304@9online.fr> References: <200401252254.i0PMs0Bw029270@rubyforge.org> <1075127903.16043.15.camel@server.neoneye.home> <4015631A.1030304@9online.fr> Content-Type: text/plain Organization: Message-Id: <1075152482.17056.8.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: docbook problem X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 26 Jan 2004 21:31:37 -0000 X-Original-Date: 26 Jan 2004 22:28:03 +0100 X-List-Received-Date: Mon, 26 Jan 2004 21:31:37 -0000 On Mon, 2004-01-26 at 19:57, Pierre wrote: > Simon Strandgaard wrote: > > On Sun, 2004-01-25 at 23:54, Pierre wrote: > > > >>Hi, > >> > >>I'm wrting you about your dobbook page : http://aeditor.rubyforge.org/mini_docbook.html > >> > >>I try to make it as you tell, but I got the "Failed to load external entity "xhtml_onechunk"" problem. > >>My variable seems ok : > >> > >>$ env | grep XML_CATALOG_FILES > >>XML_CATALOG_FILES=catalog.xml:/usr/local/share/sgml/docbook/catalog.xml:/usr/local/share/xml/docbook/4.2/catalog.xml:/etc/xml/catalog > > > > > > yes its ok. > > > > > > > >>and the catalog is valid xml... > >> > >>Any help would be great ! > > > > > > Ok, I need to know a little more about your setup. > > > > Can you attach these 3 files: Makefile, catalog.xml, main.xml. > > Done. > > > Also if you can copy/paste the commandline output when you invoke > > 'make'. > > # gmake > xsltproc \ > --output index.html \ > xhtml_onechunk \ > main.xml > warning: failed to load external entity "xhtml_onechunk" > cannot parse xhtml_onechunk > gmake: *** [onechunk] Error 4 > I guess its a version problem. In your 'main.xml' file you require the version 4.2. But in your 'catalog.xml' you refer to version 4.3. You can try 2 things: A) let 'main.xml' require "http://www.docbook.org/xml/4.3CR3/" B) download the version 4.2 and install it in your homedir. Tell me if that works for you? ;-) -- Simon Strandgaard From neoneye@adslhome.dk Tue Jan 27 10:14:48 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0RFElPf012659 for ; Tue, 27 Jan 2004 10:14:48 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 278A9262A80; Tue, 27 Jan 2004 16:14:46 +0100 (CET) From: Simon Strandgaard To: Pierre , AEditor In-Reply-To: <4015976A.4080705@9online.fr> References: <200401252254.i0PMs0Bw029270@rubyforge.org> <1075127903.16043.15.camel@server.neoneye.home> <4015631A.1030304@9online.fr> <1075152482.17056.8.camel@server.neoneye.home> <4015976A.4080705@9online.fr> Content-Type: text/plain Organization: Message-Id: <1075216276.19868.7.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: docbook problem X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 27 Jan 2004 15:14:49 -0000 X-Original-Date: 27 Jan 2004 16:11:16 +0100 X-List-Received-Date: Tue, 27 Jan 2004 15:14:49 -0000 On Mon, 2004-01-26 at 23:40, Pierre wrote: > Simon Strandgaard wrote: > > On Mon, 2004-01-26 at 19:57, Pierre wrote: > > > >>Simon Strandgaard wrote: > >> > >>>On Sun, 2004-01-25 at 23:54, Pierre wrote: > >>> > >>> > >>>>Hi, > >>>> > >>>>I'm wrting you about your dobbook page : http://aeditor.rubyforge.org/mini_docbook.html > >>>> > >>>>I try to make it as you tell, but I got the "Failed to load external entity "xhtml_onechunk"" problem. > >>>>My variable seems ok : > >>>> > >>>>$ env | grep XML_CATALOG_FILES > >>>>XML_CATALOG_FILES=catalog.xml:/usr/local/share/sgml/docbook/catalog.xml:/usr/local/share/xml/docbook/4.2/catalog.xml:/etc/xml/catalog > >>> > >>> > >>>yes its ok. > >>> > >>> > >>> > >>> > >>>>and the catalog is valid xml... > >>>> > >>>>Any help would be great ! > >>> > >>> > >>>Ok, I need to know a little more about your setup. > >>> > >>>Can you attach these 3 files: Makefile, catalog.xml, main.xml. > >> > >>Done. > >> > >> > >>>Also if you can copy/paste the commandline output when you invoke > >>>'make'. > >> > >># gmake > >>xsltproc \ > >>--output index.html \ > >>xhtml_onechunk \ > >>main.xml > >>warning: failed to load external entity "xhtml_onechunk" > >>cannot parse xhtml_onechunk > >>gmake: *** [onechunk] Error 4 > >> > > > > > > I guess its a version problem. > > In your 'main.xml' file you require the version 4.2. > > But in your 'catalog.xml' you refer to version 4.3. > > > > > > You can try 2 things: > > > > A) let 'main.xml' require "http://www.docbook.org/xml/4.3CR3/" > > > > B) download the version 4.2 and install it in your homedir. > > I try A). I have attached you my new main.xml file. > (Btw it couldn't be bad to have the 4.2 too, but I don't know if it's > possible). > > But I got always the same error : > > # gmake > xsltproc \ > --output index.html \ > xhtml_onechunk \ > main.xml > warning: failed to load external entity "xhtml_onechunk" > cannot parse xhtml_onechunk > gmake: *** [onechunk] Error 4 > > The reason could also be that the DTD and the stylesheet is incompatible? maybe dtd is 4.3, but stylesheet may be some other version. I have no clue why (A) doesn't work. I have not yet tried the 4.3 preview... don't know if there is any obstacles. Try (B) download both files I mention in the tutorial, to see if it makes a difference. http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.61.3.tar.gz?download -- Simon Strandgaard From neoneye@adslhome.dk Wed Jan 28 01:22:34 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0S6MX0Z022720 for ; Wed, 28 Jan 2004 01:22:34 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 7279826295C; Wed, 28 Jan 2004 07:22:29 +0100 (CET) From: Simon Strandgaard To: Pierre , AEditor In-Reply-To: <40172EDD.8020700@9online.fr> References: <200401252254.i0PMs0Bw029270@rubyforge.org> <1075127903.16043.15.camel@server.neoneye.home> <4015631A.1030304@9online.fr> <1075152482.17056.8.camel@server.neoneye.home> <4015976A.4080705@9online.fr> <1075216276.19868.7.camel@server.neoneye.home> <40172EDD.8020700@9online.fr> Content-Type: text/plain Organization: Message-Id: <1075270739.22404.2.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: docbook problem X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 28 Jan 2004 06:22:35 -0000 X-Original-Date: 28 Jan 2004 07:19:00 +0100 X-List-Received-Date: Wed, 28 Jan 2004 06:22:35 -0000 On Wed, 2004-01-28 at 04:39, Pierre wrote: > Simon Strandgaard wrote: > > On Mon, 2004-01-26 at 23:40, Pierre wrote: > > > > > > The reason could also be that the DTD and the stylesheet is > > incompatible? maybe dtd is 4.3, but stylesheet may be some other > > version. > > > > I have no clue why (A) doesn't work. I have not yet tried the 4.3 > > preview... don't know if there is any obstacles. > > > > Try (B) download both files I mention in the tutorial, to see if it > > makes a difference. > > > > http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip > > http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.61.3.tar.gz?download > > I have docbook-xsl-1.64.1. > But I have tried different things, and I think I have found the problem. > It is the XML_CATALOG_FILES variable. I will add some more text to the section about that variable :-) > When it is set to "catalog.xml" or to > "/usr/local/share/sgml/docbook/catalog.xml" only, then it compiles > without error. > When it is set to > "catalog.xml:/usr/local/share/sgml/docbook/catalog.xml" it makes an > error (and the same with other paths). > But I will set it to "/usr/local/share/sgml/docbook/catalog.xml", so it > should work anywhere. > Btw, is it possible to move this catalog file ? I suppose that it is, > there seems to be only absolute paths inside of it. IIRC its possible to move 'catalog.xml' around. So that if you have many DocBook projects its sufficient to have only a central catalog. -- Simon Strandgaard From neoneye@adslhome.dk Thu Jan 29 11:13:14 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i0TGDD0Z012538 for ; Thu, 29 Jan 2004 11:13:14 -0500 Received: from [10.0.0.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id E92962629E5; Thu, 29 Jan 2004 17:12:40 +0100 (CET) From: Simon Strandgaard To: Pierre , AEditor In-Reply-To: <401860E0.605@9online.fr> References: <200401252254.i0PMs0Bw029270@rubyforge.org> <1075127903.16043.15.camel@server.neoneye.home> <4015631A.1030304@9online.fr> <1075152482.17056.8.camel@server.neoneye.home> <4015976A.4080705@9online.fr> <1075216276.19868.7.camel@server.neoneye.home> <40172EDD.8020700@9online.fr> <1075270739.22404.2.camel@server.neoneye.home> <401860E0.605@9online.fr> Content-Type: text/plain Organization: Message-Id: <1075392551.27826.9.camel@server.neoneye.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Cc: Subject: [Aeditor-talk] Re: docbook problem X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Thu, 29 Jan 2004 16:13:14 -0000 X-Original-Date: 29 Jan 2004 17:09:11 +0100 X-List-Received-Date: Thu, 29 Jan 2004 16:13:14 -0000 On Thu, 2004-01-29 at 02:24, Pierre wrote: > Simon Strandgaard wrote: > > On Wed, 2004-01-28 at 04:39, Pierre wrote: > > > >>When it is set to "catalog.xml" or to > >>"/usr/local/share/sgml/docbook/catalog.xml" only, then it compiles > >>without error. > >>When it is set to > >>"catalog.xml:/usr/local/share/sgml/docbook/catalog.xml" it makes an > >>error (and the same with other paths). > >>But I will set it to "/usr/local/share/sgml/docbook/catalog.xml", so it > >>should work anywhere. > >>Btw, is it possible to move this catalog file ? I suppose that it is, > >>there seems to be only absolute paths inside of it. > > > > > > IIRC its possible to move 'catalog.xml' around. So that if you have many > > DocBook projects its sufficient to have only a central catalog. > > Yes that's what I plan to do, I'll replace my /etc/xml/catalog file that > I never succeed to make work... Watch out.. before 'catalog.xml' got invented there were 'catalog' which is used by sgml docbook. If its such file (non-xml format), then you may break the systemwide setup. Before overwriting it, check that it really is xml file. > Btw, is it possible to declare multiple docbook dtd ? I currently have > the docbook DTD 4.3CR3 (the latest) declared, but some applications > require the 4.2, and some previous releases... So I would add them to > the catalog, and maybe other DTD too... I guess its possible to make a 'my-docbook-current' catalog which points at the latest DocBook installation location. When you upgrade DocBook to a newer version, then all your documents will use the new specification. > I hope I don't bother you too much :) Your questions is Ok.. I learn what needs to be improved on my document. -- Simon Strandgaard From neoneye@adslhome.dk Wed Feb 18 08:45:31 2004 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i1IDjU0Z024048 for ; Wed, 18 Feb 2004 08:45:30 -0500 Received: from [192.168.1.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id B265748006D for ; Wed, 18 Feb 2004 14:39:04 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: text/plain Organization: Message-Id: <1077111308.70497.28.camel@neoneye.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Subject: [Aeditor-talk] regexp, yet another redesign X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 18 Feb 2004 13:45:31 -0000 X-Original-Date: 18 Feb 2004 14:35:09 +0100 X-List-Received-Date: Wed, 18 Feb 2004 13:45:31 -0000 Want to know about current status of AEditor, then read on. During January I have made a more correct working engine (yet not working fully correct). There is still lots of problems with nested quantifiers. For instance /(a.*b){3}/ has both an outer expression ( ... ){3} and an inner expression a.*b Such kind of expressions requires a smart data structure. Earlier my problems were that the data structures was too simple. My current problem is that its too complex, and I cannot conceptually overview it (I wish an upgrade of my puny brain for my birthday). The current implementation (see 'repeat_nested' branch in CVS) cuts pieces off the timeline, and reinstall them later. This removal/install operations on the timeline doesn't fit with the metafor I know from nature. I need something more natual, which I can cope with and easy understand. Ok, something in between is needed. Last night, while drawing and analysing, I got a new refined idea for a new data structure, which I hope will do better. At least I have become better at unittesting and upgraded my debugging skills with +2.7 levels. When nested quantifiers is working (correct), then I will finish the implementation of perl6 regexp, where Mark Sparshatt already have done some work. Don't know what condition the perl6 implementation is in though. Then we kick ass... but its some units more out on the timeline. -- Simon Strandgaard From msparshatt@yahoo.co.uk Wed Feb 18 15:54:05 2004 Received: from smtp003.mail.ukl.yahoo.com (smtp003.mail.ukl.yahoo.com [217.12.11.34]) by rubyforge.org (8.12.8/8.12.5) with SMTP id i1IKs50Z001071 for ; Wed, 18 Feb 2004 15:54:05 -0500 Received: from unknown (HELO yahoo.co.uk) (msparshatt@212.56.105.204 with plain) by smtp003.mail.ukl.yahoo.com with SMTP; 18 Feb 2004 20:47:34 -0000 Message-ID: <4033CF31.80608@yahoo.co.uk> Date: Wed, 18 Feb 2004 20:46:41 +0000 From: Mark User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: programmers editor written entirely in Ruby Subject: Re: [Aeditor-talk] regexp, yet another redesign References: <1077111308.70497.28.camel@neoneye.dk> In-Reply-To: <1077111308.70497.28.camel@neoneye.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 20:54:05 -0000 Simon Strandgaard wrote: >When nested quantifiers is working (correct), then I will finish the >implementation of perl6 regexp, where Mark Sparshatt already have done >some work. Don't know what condition the perl6 implementation is in >though. > > > I haven't had time to work on the perl6 regexp lately so it's still at a very basic stage. Over the weekend I'll work on cleaning the code up to make it easier to extend and on documenting what's been done so far and what needs to be done. -- Mark Sparshatt From neoneye@adslhome.dk Wed Feb 18 16:55:34 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i1ILtW0Z002298 for ; Wed, 18 Feb 2004 16:55:33 -0500 Received: from [192.168.1.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 158CC26297C for ; Wed, 18 Feb 2004 22:49:00 +0100 (CET) Subject: Re: [Aeditor-talk] regexp, yet another redesign From: Simon Strandgaard To: programmers editor written entirely in Ruby In-Reply-To: <4033CF31.80608@yahoo.co.uk> References: <1077111308.70497.28.camel@neoneye.dk> <4033CF31.80608@yahoo.co.uk> Content-Type: text/plain Organization: Message-Id: <1077140703.71905.11.camel@neoneye.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 18 Feb 2004 21:55:34 -0000 X-Original-Date: 18 Feb 2004 22:45:04 +0100 X-List-Received-Date: Wed, 18 Feb 2004 21:55:34 -0000 On Wed, 2004-02-18 at 21:46, Mark wrote: > Simon Strandgaard wrote: > > >When nested quantifiers is working (correct), then I will finish the > >implementation of perl6 regexp, where Mark Sparshatt already have done > >some work. Don't know what condition the perl6 implementation is in > >though. > > > > > > > I haven't had time to work on the perl6 regexp lately so it's still at a > very basic stage. Over the weekend I'll work on cleaning the code up to > make it easier to extend and on documenting what's been done so far and > what needs to be done. > Ok, great. :-) BTW: Some time ago I made a small demosite where regexp can be tried out online. I think of extending it, so that you can see how different engine deals with the regexp-string a visitor may have entered. http://neoneye.dk/regexp.rbx At the moment its just agains Rubys native regexp engine. Suggestions for improvement is welcome :-) BTW#2: I think perl has a package named 'explain'? where you can see how your regexp has been interpreted, and what the meaning is. I think of doing the same. I already have some pretty printing routines, for instance /(a.*b){3}/.match("0abababab1"), outputs: regexp="(a.*b){3}" +-Repeat greedy{3,3} +-Group register=1 +-Sequence +-Literal "a" +-Repeat greedy{0,-1} | +-Wildcard NOT["\n"] +-Literal "b" input="0abababab1" -- Simon Strandgaard From neoneye@adslhome.dk Sun Feb 22 20:03:30 2004 Received: from pfepa.post.tele.dk (pfepa.post.tele.dk [195.41.46.235]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i1N13T0Z006578 for ; Sun, 22 Feb 2004 20:03:30 -0500 Received: from [192.168.1.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepa.post.tele.dk (Postfix) with ESMTP id D017E47FFCB for ; Mon, 23 Feb 2004 01:55:43 +0100 (CET) From: Simon Strandgaard To: AEditor Content-Type: text/plain Organization: Message-Id: <1077497512.89107.60.camel@neoneye.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Content-Transfer-Encoding: 7bit Subject: [Aeditor-talk] regexp ala perl6 X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 23 Feb 2004 01:03:30 -0000 X-Original-Date: 23 Feb 2004 01:51:54 +0100 X-List-Received-Date: Mon, 23 Feb 2004 01:03:30 -0000 ATT, Mark Sparshatt: I see you is back in action ;-) My guess is that these 2 documents is the definition of perl6-regexp. Is there other resources about the subject? http://www.perl.com/pub/a/2002/06/04/apo5.html http://www.perl.com/pub/a/2002/08/22/exegesis5.html?page=1 There is some really delicious regexp constructions, I have tried to make a summary (there is corresponding perl5 regexp's in comments). ... | ... # alternation [...]: # grab (any atom) [ cond :: yes | no ] # conditional if then else [ <(defined $1)> :: yes | no ] # conditional+register#1 ...* # quantifier, 0 or more, greedy ...*? # quantifier, 0 or more, non-greedy ...+ # quantifier, 1 or more, greedy ...+? # quantifier, 1 or more, non-greedy ...? # quantifier, 0 or 1 times, greedy ...?? # quantifier, 0 or 1 times, non-greedy ... # quantifier, n..m times, greedy ...? # quantifier, n..m times, non-greedy ... # quantifier, 0 or more, exclude n..m, greedy ...? # quantifier, 0 or more, exclude n..m, non-greedy (...) # capturing (:i ...) # capturing ignorecase, same as ((?i) ...) [...] # non-capturing brackets (?: ...) [:i ...] # non-capturing ignorecase, same as (?i: ...) $1 # backref, same as \1 { code } # call Ruby code, ignore result <( code )> # call code as boolean assertion <$rule> # call regex in variable # the regexp itself.. for nesting the expression. <('...')> # in-line comment # positive lookbehind (?<= ...) # negative lookbehind (? # positive lookahead (?= ...) # negative lookahead (?! ...) # match nothing (epsilon transition) # posix charclass [[:alpha:]] <-alpha> # negated charclass [^[:alpha:]] <> # more charclasses [[:alpha:][:digit]] <[a-z]> # custom charclass [a-z] # match space <'...'> # match against literal string . # match anything (also newline) \N # match non-newline $ # anchor, begin of string $$ # anchor, begin of line ^ # anchor, end of string ^^ # anchor, end of line Is there any constructions I have overseen? There is some more syntax described here: http://www.perl.com/pub/a/2002/06/04/apo5.html?page=6 It has become really easy to refer to standard charclasses.. i like that I think I saw and .. I guess those are charclasses which contains the letters in the specific languages? -- Simon Strandgaard From neoneye@adslhome.dk Sun Feb 22 20:40:45 2004 Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237]) by rubyforge.org (8.12.8/8.12.5) with ESMTP id i1N1ei0Z007001 for ; Sun, 22 Feb 2004 20:40:45 -0500 Received: from [192.168.1.10] (0x50c4101e.boanxx9.adsl-dhcp.tele.dk [80.196.16.30]) by pfepc.post.tele.dk (Postfix) with ESMTP id 4EDCE2629BB for ; Mon, 23 Feb 2004 02:32:57 +0100 (CET) Subject: Re: [Aeditor-talk] regexp, yet another redesign From: Simon Strandgaard To: programmers editor written entirely in Ruby In-Reply-To: <1077140703.71905.11.camel@neoneye.dk> References: <1077111308.70497.28.camel@neoneye.dk> <4033CF31.80608@yahoo.co.uk> <1077140703.71905.11.camel@neoneye.dk> Content-Type: multipart/mixed; boundary="=-Yt7RSZ28ggJ2QQGYleOH" Organization: Message-Id: <1077499747.89107.81.camel@neoneye.dk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 X-BeenThere: aeditor-talk@rubyforge.org X-Mailman-Version: 2.1.2 Precedence: list Reply-To: programmers editor written entirely in Ruby List-Id: programmers editor written entirely in Ruby List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 23 Feb 2004 01:40:46 -0000 X-Original-Date: 23 Feb 2004 02:29:07 +0100 X-List-Received-Date: Mon, 23 Feb 2004 01:40:46 -0000 --=-Yt7RSZ28ggJ2QQGYleOH Content-Type: text/plain Content-Transfer-Encoding: 7bit Some status for the last few days.. This week I have been implementing the new design (I decided to change the design radicaly, monday, 7 days ago). I have almost reached the same point where the last design(s) have given up, so I am very cuorious to if the new design will cut it. A word of warning for people which think of writing their own regexp engine: nested quantifiers is complex! Right now I have a minor problem with activation of the third quantifier... the testcase which provokes the problem is here def test_verbose_repeat3 data =<data ) end I have attached the error output where above testcase fails, it generates huge amounts of output! Its easy to see where it goes wrong, but its not that obvious what the exact cause of failure seems to be (maybe im too tired today). I have just tried out Rake (ruby replacement for Make), which is really nice. For instance these rules validates against docbook dtd. task :valid_catalog do sh "xmllint --valid --noout catalog.xml" end task :valid_main do sh "xmllint --valid --noout main.xml" end task :validall => [:valid_catalog, :valid_main] rakefiles is much more consistent than makefiles. -- Simon Strandgaard --=-Yt7RSZ28ggJ2QQGYleOH Content-Disposition: attachment; filename=res Content-Type: text/plain; name=res; charset=ISO8859-1 Content-Transfer-Encoding: 7bit Loaded suite TestScanner Started test_alternation1(TestScanner): . test_alternation10(TestScanner): . test_alternation11(TestScanner): . test_alternation12(TestScanner): . test_alternation13(TestScanner): . test_alternation14(TestScanner): . test_alternation15(TestScanner): . test_alternation16(TestScanner): . test_alternation2(TestScanner): . test_alternation3(TestScanner): . test_alternation4(TestScanner): . test_alternation5(TestScanner): . test_alternation6(TestScanner): . test_alternation7(TestScanner): . test_alternation8(TestScanner): . test_alternation9(TestScanner): . test_repeat1(TestScanner): . test_repeat2(TestScanner): . test_repeat3(TestScanner): . test_repeat4(TestScanner): . test_repeat5(TestScanner): . test_repeat6(TestScanner): . test_repeat7(TestScanner): . test_repeat8(TestScanner): . test_repeat_lazy1(TestScanner): . test_repeat_lazy2(TestScanner): . test_repeat_lazy3(TestScanner): . test_repeat_lazy4(TestScanner): . test_repeat_lazy5(TestScanner): . test_repeat_lazy6(TestScanner): . test_repeat_lazy7(TestScanner): . test_repeat_lazy8(TestScanner): . test_repeat_min1_1(TestScanner): . test_repeat_min1_2(TestScanner): . test_repeat_min1_3(TestScanner): . test_repeat_min1_4(TestScanner): . test_repeat_min1_5(TestScanner): . test_repeat_min1_6(TestScanner): . test_repeat_min2_1(TestScanner): . test_repeat_min2_2(TestScanner): . test_repeat_min2_3(TestScanner): . test_repeat_min2_4(TestScanner): . test_repeat_min2_5(TestScanner): . test_repeat_min2_6(TestScanner): . test_repeat_range1(TestScanner): . test_repeat_range10(TestScanner): . test_repeat_range11(TestScanner): . test_repeat_range12(TestScanner): . test_repeat_range13(TestScanner): . test_repeat_range14(TestScanner): . test_repeat_range15(TestScanner): . test_repeat_range16(TestScanner): . test_repeat_range17(TestScanner): . test_repeat_range18(TestScanner): . test_repeat_range19(TestScanner): . test_repeat_range2(TestScanner): . test_repeat_range20(TestScanner): . test_repeat_range21(TestScanner): . test_repeat_range22(TestScanner): . test_repeat_range3(TestScanner): . test_repeat_range4(TestScanner): . test_repeat_range5(TestScanner): . test_repeat_range6(TestScanner): . test_repeat_range7(TestScanner): . test_repeat_range8(TestScanner): . test_repeat_range9(TestScanner): . test_repeat_range_ignore1(TestScanner): . test_repeat_range_ignore2(TestScanner): . test_repeat_range_special1(TestScanner): . test_repeat_range_special2(TestScanner): . test_repeat_range_special3(TestScanner): . test_repeat_range_special4(TestScanner): . test_repeat_range_special5(TestScanner): . test_repeat_range_special6(TestScanner): . test_repeat_range_special7(TestScanner): . test_sequence1(TestScanner): . test_sequence2(TestScanner): . test_sequence3(TestScanner): . test_sequence4(TestScanner): . test_sequence5(TestScanner): . test_sequence6(TestScanner): . test_verbose_alt_rep1(TestScanner): . test_verbose_alt_rep2(TestScanner): . test_verbose_repeat1(TestScanner): . test_verbose_repeat2(TestScanner): . test_verbose_repeat3(TestScanner): before #test_verbose_repeat3 regexp="a(.*)b(.*)c(.*)d" +-Sequence +-Literal "a" +-Group register=1 | +-Repeat greedy{0,-1} | +-Wildcard NOT["\n"] +-Literal "b" +-Group register=2 | +-Repeat greedy{0,-1} | +-Wildcard NOT["\n"] +-Literal "c" +-Group register=3 | +-Repeat greedy{0,-1} | +-Wildcard NOT["\n"] +-Literal "d" input="xaaxxbcdx" ---------------------------------------- execute at position 0 match "a" at position 0 path end = expected "a" but got "x" check_integrity history.size=0 index-stack=[] integrity "a b c d" (line 0) execute at position 1 match "a" at position 1 group_open register=1 repeat 0 visitor#set_state from active into inactive group_close register=1 match "b" at position 2 path end = expected "b" but got "a" check_integrity history.size=1 index-stack=[0] integrity "a b c d" (line 1) next_path zero. found=false lazy=false state=active index=0 has_match=false clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 2 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 3 path end = expected "b" but got "x" check_integrity history.size=2 index-stack=[1] integrity "a . b c d" (line 2) next_path zero. found=false lazy=false state=active index=1 has_match=false clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 3 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 4 path end = expected "b" but got "x" check_integrity history.size=3 index-stack=[2] integrity "a . . b c d" (line 3) next_path zero. found=false lazy=false state=active index=2 has_match=false clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 4 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 5 group_open register=2 repeat 0 visitor#set_state from inactive into inactive group_close register=2 match "c" at position 6 group_open register=3 repeat 0 visitor#set_state from inactive into inactive group_close register=3 match "d" at position 7 last path end = reached last node check_integrity history.size=6 index-stack=[3, 0, 0] integrity "a . . . b c d" (line 4) next_path zero. found=true lazy=false state=inactive index=0 has_match=false skip, path end = not active next_path zero. found=true lazy=false state=inactive index=0 has_match=false skip, path end = not active next_path zero. found=true lazy=false state=active index=3 has_match=false remember zero and clear replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 5 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 6 path end = expected "b" but got "c" check_integrity history.size=5 index-stack=[4] integrity "a . . . . b c d" (line 5) next_path zero. found=false lazy=false state=active index=4 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 6 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 7 path end = expected "b" but got "d" check_integrity history.size=6 index-stack=[5] integrity "a . . . . . b c d" (line 6) next_path zero. found=false lazy=false state=active index=5 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 7 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 8 path end = expected "b" but got "x" check_integrity history.size=7 index-stack=[6] integrity "a . . . . . . b c d" (line 7) next_path zero. found=false lazy=false state=active index=6 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 8 visitor#set_state from active into inactive one-end group_close register=1 match "b" at position 9 path end = expected "b" but got check_integrity history.size=8 index-stack=[7] integrity "a . . . . . . . b c d" (line 8) next_path zero. found=false lazy=false state=active index=7 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 9 path end = expected NOT["\n"] but got check_integrity history.size=8 index-stack=[8] integrity "a . . . . . . . . b c d" (line 9) next_path one. found=false lazy=false state=active index=7 has_match=true clear history install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=6 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=5 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=4 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=3 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=2 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=1 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=0 has_match=true remember one and clear install match visitor#set_memento ----- BEGIN before activate ----- content of history stack 0: ONE_0 quantifier_id=0 1: ONE_1 quantifier_id=0 2: ONE_2 quantifier_id=0 3: ZERO_3 quantifier_id=0 4: ZERO_0 quantifier_id=1 5: ZERO_0 quantifier_id=2 quantifier information 0: active found=no 1: inactive found=no 2: inactive found=no ----- END before activate ----- activate_next found zero/one found zero/one found zero/one activate_inactive ----- BEGIN after activate ----- content of history stack 0: ONE_0 quantifier_id=0 1: ONE_1 quantifier_id=0 2: ONE_2 quantifier_id=0 3: ZERO_3 quantifier_id=0 4: ZERO_0 quantifier_id=1 5: ZERO_0 quantifier_id=2 quantifier information 0: done found=no 1: active found=yes 2: inactive found=no ----- END after activate ----- skip, path end = is done next_path zero. found=true lazy=false state=inactive index=0 has_match=false skip, path end = not active next_path zero. found=true lazy=false state=active index=0 has_match=true remember zero and clear replace zero with one visitor#set_state from active into active visitor#set_memento match NOT["\n"] at position 6 visitor#set_state from active into inactive one-end group_close register=2 match "c" at position 7 path end = expected "c" but got "d" check_integrity history.size=6 index-stack=[3, 1] integrity "a . . . b . c d" (line 10) next_path zero. found=false lazy=false state=active index=1 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 7 visitor#set_state from active into inactive one-end group_close register=2 match "c" at position 8 path end = expected "c" but got "x" check_integrity history.size=7 index-stack=[3, 2] integrity "a . . . b . . c d" (line 11) next_path zero. found=false lazy=false state=active index=2 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 8 visitor#set_state from active into inactive one-end group_close register=2 match "c" at position 9 path end = expected "c" but got check_integrity history.size=8 index-stack=[3, 3] integrity "a . . . b . . . c d" (line 12) next_path zero. found=false lazy=false state=active index=3 has_match=true clear history replace zero with one visitor#set_state from inactive into active visitor#set_memento match NOT["\n"] at position 9 path end = expected NOT["\n"] but got check_integrity history.size=8 index-stack=[3, 4] integrity "a . . . b . . . . c d" (line 13) next_path one. found=false lazy=false state=active index=3 has_match=true clear history install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=2 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=1 has_match=true remember one and clear install match visitor#set_memento skip, path end = is done next_path one. found=true lazy=false state=active index=0 has_match=true remember one and clear install match visitor#set_memento ----- BEGIN before activate ----- content of history stack 0: ONE_0 quantifier_id=0 1: ONE_1 quantifier_id=0 2: ONE_2 quantifier_id=0 3: ZERO_3 quantifier_id=0 4: ZERO_0 quantifier_id=1 5: ZERO_0 quantifier_id=2 quantifier information 0: active found=no 1: inactive found=no 2: inactive found=no ----- END before activate ----- activate_next found zero/one found zero/one found zero/one activate_inactive ----- BEGIN after activate ----- content of history stack 0: ONE_0 quantifier_id=0 1: ONE_1 quantifier_id=0 2: ONE_2 quantifier_id=0 3: ZERO_3 quantifier_id=0 4: ZERO_0 quantifier_id=1 5: ZERO_0 quantifier_id=2 quantifier information 0: done found=no 1: active found=yes 2: inactive found=no ----- END after activate ----- skip, path end = is done next_path zero. found=true lazy=false state=inactive index=0 has_match=false skip, path end = not active next_path zero. found=true lazy=false state=active index=0 has_match=true remember zero and clear replace zero with one visitor#set_state from active into active visitor#set_memento match NOT["\n"] at position 6 visitor#set_state from active into inactive one-end group_close register=2 match "c" at position 7 path end = expected "c" but got "d" check_integrity history.size=6 index-stack=[3, 1] integrity "a . . . b . c d", but expected "a . . . b c . d" at line 14. ERROR! E Finished in 0.896336 seconds. 1) Error: test_verbose_repeat3(TestScanner): RuntimeError: integrity: expected "a . . . b c . d", got "a . . . b . c d" at line 14 /home/neoneye/kode/editor/projects/regexp_engine/regexp/scanner.rb:41:in `check_integrity' /home/neoneye/kode/editor/projects/regexp_engine/regexp/scanner_helpers.rb:533:in `path_end' /home/n