Received: from mail-wi0-f184.google.com ([209.85.212.184]:34521) by stodi.digitalkingdom.org with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.80.1) (envelope-from ) id 1YfOsC-0003fd-Hc; Tue, 07 Apr 2015 01:28:47 -0700 Received: by wivr20 with SMTP id r20sf2139006wiv.1; Tue, 07 Apr 2015 01:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:date:message-id:subject:to:content-type :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=mt0gDKt0T+UWzfLsPAQtb1mwrvgdDvh4v3aY40H6ysc=; b=wlQfGrTRG7pjDs7ApazedVRruiccboYBph8sgK2F+zOXv5bEm8Ca02xxmfrJ1dCEeX yvuo1xdslkf6x/+vdYV8dnbu5Fi0HDokTlOnDQFPfzVpBX1rC+QqONJOCAcPyl6VrpoN BwuVxf6wEvr0OBXpJ8VPPOgokzjffWByulh1e4U8/WdfXBgnvOgk0j1+CuHKHVhqWvaH yoPrsdR/H75Kte0klruL3C+k/HByc855eVeqeFP+3pEHrRjqmm0bUsL4jX2iDBUsH7fj McwufXUqoyqrW67YeA4Zrab/3CmeK7EQOgawrJ4OFw6lH7hYoO1bsfQG0MQttmSfRcgp iqOQ== X-Received: by 10.152.234.228 with SMTP id uh4mr190793lac.18.1428395313847; Tue, 07 Apr 2015 01:28:33 -0700 (PDT) X-BeenThere: bpfk-list@googlegroups.com Received: by 10.152.7.226 with SMTP id m2ls12483laa.71.gmail; Tue, 07 Apr 2015 01:28:33 -0700 (PDT) X-Received: by 10.112.201.232 with SMTP id kd8mr3949665lbc.16.1428395313078; Tue, 07 Apr 2015 01:28:33 -0700 (PDT) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com. [2a00:1450:400c:c05::234]) by gmr-mx.google.com with ESMTPS id ec7si378519wib.3.2015.04.07.01.28.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 01:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gleki.is.my.name@gmail.com designates 2a00:1450:400c:c05::234 as permitted sender) client-ip=2a00:1450:400c:c05::234; Received: by mail-wi0-x234.google.com with SMTP id k4so8196209wiz.1 for ; Tue, 07 Apr 2015 01:28:33 -0700 (PDT) X-Received: by 10.194.158.234 with SMTP id wx10mr38306719wjb.23.1428395312951; Tue, 07 Apr 2015 01:28:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.240.197 with HTTP; Tue, 7 Apr 2015 01:28:12 -0700 (PDT) From: Gleki Arxokuna Date: Tue, 7 Apr 2015 11:28:12 +0300 Message-ID: Subject: [bpfk] One cannot refer to inner nodes in Lojban PEG To: bpfk-list@googlegroups.com Content-Type: multipart/alternative; boundary=089e013c625c3a368105131e33e3 X-Original-Sender: gleki.is.my.name@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gleki.is.my.name@gmail.com designates 2a00:1450:400c:c05::234 as permitted sender) smtp.mail=gleki.is.my.name@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Reply-To: bpfk-list@googlegroups.com Precedence: list Mailing-list: list bpfk-list@googlegroups.com; contact bpfk-list+owners@googlegroups.com List-ID: X-Google-Group-Id: 972099695765 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -1.7 (-) X-Spam_score: -1.7 X-Spam_score_int: -16 X-Spam_bar: - Content-Length: 4700 --089e013c625c3a368105131e33e3 Content-Type: text/plain; charset=UTF-8 Consider the following: string_1 = string_2 / string_6 string_3 string_3 = string_7 / string_8 string_4 = !string_1 string_5 Now we need !string_1 to work only if string_8 matches, not when string_7 matches. Why we might need that? E.g. for terms that can have either FA or BAI inside. Depending on whether we have FA or BAI inside a term our actions may differ. How can we implement that? We can just create duplicates of two strings like this: string_1 = string_2 / string_6 string_3 string_1_2 = string_2 / string_6 string_3_2 string_3 = string_7 / string_8 string_3_2 = string_8 string_4 = !string_1_2 string_5 Now string_1_2 is the same as string_1 but it is matched only if string_8 matches (unlike string_1, otherwise they are the same). Now the question is how do we avoid such duplication? The answer from peg.js developers: Sorry, but there is currently no clean way to avoid the duplication. In the future I'm thinking about adding support for rule templates/parametrizable rules, which would help here: string_1 = string_2 / string_6 T string_3 = string_7 / string_8 string_3_2 = string_8 string_4 = !string_1 string_5 And I think it'd be nice So for now our only chance is to copy paster parts of Lojban PEG if we want such things. I.e. one would need to split terms into "terms_for_BAI", "terms_for_FA" etc. with all their inner variables copied. -- You received this message because you are subscribed to the Google Groups "BPFK" group. To unsubscribe from this group and stop receiving emails from it, send an email to bpfk-list+unsubscribe@googlegroups.com. To post to this group, send email to bpfk-list@googlegroups.com. Visit this group at http://groups.google.com/group/bpfk-list. For more options, visit https://groups.google.com/d/optout. --089e013c625c3a368105131e33e3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Consider the following:
string_1 =3D string= _2 / string_6 string_3
string_3 =3D string_7 / string_8
string_4 =3D !string_1 string_5=C2=A0

Now we need= !string_1 to work only if string_8 matches, not when string_7 matches.
Why we might need that? E.g. for terms that can have either FA or BA= I inside. Depending on whether we have FA or BAI inside a term our actions = may differ.

How can we implement that?
W= e can just create duplicates of two strings like this:

=
string_1 =3D string_2 / string_6 string_3
string_1_2 =3D str= ing_2 / string_6 string_3_2
string_3 =3D string_7 / string_8
string_3_2 =3D string_8
string_4 =3D !string_1_2 string_5= =C2=A0

Now string_1_2 is the same as string_1 but = it is matched only if string_8 matches (unlike string_1, otherwise they are= the same).

Now the question is how do we avoid su= ch duplication?

The answer from peg.js developers:=
<quote>
Sorry, but there is currently no clean w= ay to avoid the duplication.

In the future I'm= thinking about adding support for rule templates/parametrizable rules, whi= ch would help here:

string_1<T> =3D string_2= / string_6 T
string_3 =3D string_7 / string_8
string_3= _2 =3D string_8
string_4 =3D !string_1<string_3_2> string_5= =C2=A0

And I think it'd be nice=C2=A0
</quote>

So for now our only chance is= to copy paster parts of Lojban PEG if we want such things. I.e. one would = need to split terms into "terms_for_BAI", "terms_for_FA"= ; etc. with all their inner variables copied.

--
You received this message because you are subscribed to the Google Groups &= quot;BPFK" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bpfk-list= +unsubscribe@googlegroups.com.
To post to this group, send email to bpfk-list@googlegroups.com.
Visit this group at ht= tp://groups.google.com/group/bpfk-list.
For more options, visit http= s://groups.google.com/d/optout.
--089e013c625c3a368105131e33e3--