From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: Q on (language spec) Date: Thu, 22 Oct 2015 17:20:57 -0700 Message-ID: <040AE36A-A8DC-4E37-BB91-EF83C1ADBBDB@verizon.net> References: <02BEFF46-4DA9-4222-989C-6AAA4FABDCE0@verizon.net> <1445226782.11524.38.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_E1D55C28-41BE-404B-B9C9-A5EBE7B941A1" X-Trace: ger.gmane.org 1445559736 27824 80.91.229.3 (23 Oct 2015 00:22:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Oct 2015 00:22:16 +0000 (UTC) Cc: guile-user@gnu.org To: Nala Ginrut Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Oct 23 02:22:01 2015 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZpQ75-0002vf-Iu for guile-user@m.gmane.org; Fri, 23 Oct 2015 02:21:43 +0200 Original-Received: from localhost ([::1]:35145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpQ74-0002Ol-MC for guile-user@m.gmane.org; Thu, 22 Oct 2015 20:21:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpQ6v-0002Oa-Pf for guile-user@gnu.org; Thu, 22 Oct 2015 20:21:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpQ6s-0002Hv-KR for guile-user@gnu.org; Thu, 22 Oct 2015 20:21:33 -0400 Original-Received: from vms173025pub.verizon.net ([206.46.173.25]:53472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpQ6s-0002GH-Dp for guile-user@gnu.org; Thu, 22 Oct 2015 20:21:30 -0400 Original-Received: from [192.168.2.127] ([72.87.204.128]) by vms173025.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NWN00MTKCYXQF01@vms173025.mailsrvcs.net> for guile-user@gnu.org; Thu, 22 Oct 2015 19:21:01 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Nc0brD34 c=1 sm=1 tr=0 a=Jf1g6iwM2K3MHzQE8uPn/Q==:117 a=o1OHuDzbAAAA:8 a=oR5dmqMzAAAA:8 a=5lJygRwiOn0A:10 a=pGLkceISAAAA:8 a=hNGRVRyWiyf1kkKOp2MA:9 a=QEXdDO2ut3YA:10 a=nOF3nYIthIAA:10 a=d08ApyXsyXlfNIrqdDUA:9 a=mJY79UJoMMvvviU0:21 a=_W_S_7VecoQA:10 In-reply-to: <1445226782.11524.38.camel@Renee-desktop.suse> X-Mailer: Apple Mail (2.2104) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.25 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12098 Archived-At: --Apple-Mail=_E1D55C28-41BE-404B-B9C9-A5EBE7B941A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 18, 2015, at 8:53 PM, Nala Ginrut wrote: > And I'm grad that you write a new lexer generator (before it I only = know > silex), it's great! Would you like to make the generated tokens > compatible with scm-lalr? If so, people may rewrite their lexer module > with your lexer generator, and no need to rewrite the parser. I saw = the > token name is string rather than symbol, so I guess it's not = compatible > with scm-lalr. Actually, the lexer-generator uses convention of internally turning = certain lexemes, like strings, into symbols like =E2=80=98$string, or = integers into =E2=80=98$fixed. The argument to the lexer-generator is a = =E2=80=9Cmatch-table=E2=80=9D which says how to map the read items = quoted items are identifiers (e.g., =E2=80=9Cwhile=E2=80=9D) or = character sequences (e.g., =E2=80=9C+=3D=E2=80=9C) to something the = parser wants to see. For example, if you use the symbol WHILE to denote = the source text =E2=80=9Cwhile=E2=80=9D then you would have an entry = (=E2=80=9Cwhile=E2=80=9D . =E2=80=98WHILE) in the match table. So I = think the lexer-generator should be adaptable to other parsers. As as side note, the nyacc parser generator can be =E2=80=9Chashified=E2=80= =9D which means the lexer should return integers. In that case the = match table has entries that look like (=E2=80=9Cwhile=E2=80=9D . 45). Matt --Apple-Mail=_E1D55C28-41BE-404B-B9C9-A5EBE7B941A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Oct 18, 2015, at 8:53 PM, Nala Ginrut <nalaginrut@gmail.com> wrote:
And I'm grad that you write a new lexer = generator (before it I only know
silex), it's great! Would you like to make the = generated tokens
compatible with scm-lalr? = If so, people may rewrite their lexer module
with your lexer generator, and no need to = rewrite the parser. I saw the
token name is string = rather than symbol, so I guess it's not compatible
with scm-lalr.

Actually, the lexer-generator uses convention = of internally turning certain lexemes, like strings, into symbols like = =E2=80=98$string, or integers into =E2=80=98$fixed.  The argument = to the lexer-generator is a =E2=80=9Cmatch-table=E2=80=9D which says how = to map the read items quoted items are identifiers (e.g., =E2=80=9Cwhile=E2= =80=9D) or character sequences (e.g., =E2=80=9C+=3D=E2=80=9C) to = something the parser wants to see.  For example, if you use the = symbol WHILE to denote the source text =E2=80=9Cwhile=E2=80=9D then you = would have an entry (=E2=80=9Cwhile=E2=80=9D . =E2=80=98WHILE) in the = match table.   So I think the lexer-generator should be adaptable = to other parsers.

As as side note, the nyacc parser generator can be = =E2=80=9Chashified=E2=80=9D which means the lexer should return = integers.   In that case the match table has entries that look like = (=E2=80=9Cwhile=E2=80=9D . 45).

Matt

= --Apple-Mail=_E1D55C28-41BE-404B-B9C9-A5EBE7B941A1--