Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Larry Martell Newsgroups: comp.lang.python Subject: Re: Regular expressions Date: Fri, 6 Nov 2015 15:42:47 -0500 Lines: 26 Message-ID: References: <56397a18$0$11094$c3e8da3@news.astraweb.com> <56397FC6.9040700@gmail.com> <3f3l3bpm478nbnsec6c9tr6rre0aontkq1@4ax.com> <5e15df62-00b1-4746-83f8-c0821514d20b@googlegroups.com> <563abdda$0$1614$c3e8da3$5496439d@news.astraweb.com> <2fd7d161-b1cb-4274-b8dc-0157916413f1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de U7Sa3rfB9q1M+C7WRLOpWgZu3+OnZovnP7PO0zhsLrNw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'compiler': 0.05; '(actually': 0.09; 'python': 0.10; 'syntax': 0.13; '80s': 0.16; 'ah,': 0.16; 'calculator': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Regular': 0.16; 'subject:expressions': 0.16; 'wrote:': 0.16; 'language': 0.19; '>>>': 0.20; '2015': 0.20; 'to:name:python-list@python.org': 0.20; 'parser': 0.22; 'parsing': 0.22; 'wrote': 0.23; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'example': 0.26; 'rest': 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'tcl': 0.29; 'weak': 0.29; 'url:wiki': 0.30; 'rules': 0.31; 'another': 0.32; 'problem': 0.33; 'received:google.com': 0.35; 'nov': 0.35; 'express': 0.35; 'url:org': 0.36; 'lines': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'thought': 0.37; 'received:209': 0.38; 'christian': 0.38; 'from:': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'real': 0.62; 'back': 0.62; 'spot': 0.63; 'here:': 0.63; 'saw': 0.77; 'gollwitzer': 0.84; 'suffer': 0.93; 'url:tk': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=0D3VHe+Tzwn/lj88dxbeazGM4JM6KWYUycfjnZAJYKQ=; b=DKNXhdwja+1RTpuEsGBdhBkQMv4fMOPz7v3DEThyvq8aOkm5KD2MgY3uCO/XE+o5Yj svmyZbWrgX2uSONg1A+Wh3sgLE3+oySCUxaZA1vhNyfxYlqzSJLjKx4xZzaYZluKhZtg 713sJSqHinkh7zWDQmeDIYPfiq3q2Ha0NN8PiMo/8i6o6H/68Y3Ao1WZ4KO0S5TRtZKs KSGp8sGxhvTWnk0SMbtV6pzKDMMbAmJxLrnuYh4zqextkg7PzvgIAHGzjzwOW88BGuSR kfWC5PkHghOOGIeW/js8t0po+iq1EWI3lgRXEX+drqlj3VcFY5NWmAeSd5Z2m+sBpuoM aYkQ== X-Received: by 10.50.46.36 with SMTP id s4mr11308736igm.84.1446842607562; Fri, 06 Nov 2015 12:43:27 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98370 On Fri, Nov 6, 2015 at 3:36 PM, Christian Gollwitzer wrote: > Am 06.11.15 um 20:52 schrieb rurpy@yahoo.com: >> >> I have always thought lexing >> and parsing solutions for Python were a weak spot in the Python eco- >> system and I was about to write that I would love to see a PEG parser >> for python when I saw this: >> >> http://fdik.org/pyPEG/ >> >> Unfortunately it suffers from the same problem that Pyparsing, Ply >> and the rest suffer from: they use Python syntax to express the >> parsing rules rather than using a dedicated problem-specific syntax >> such as you used to illustrate peg parsing: >> >>> pattern <- phone_number name phone_number > >>> phone_number <- '+' [0-9]+ ( '-' [0-9]+ )* >>> name <- [[:alpha:]]+ > > That is actually real syntax of a parser generator used by me for another > language (Tcl). A calculator example using this package can be found here: > http://wiki.tcl.tk/39011 > (actually it is a retargetable compiler in a few lines - very impressive) Ah, Tcl - I wrote many a Tcl script back in the 80s to login to BBSs.