Path: csiph.com!xmission!usenet.csail.mit.edu!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Thomas Koenig Newsgroups: comp.compilers Subject: Re: A simpler way to tokenize and parse? Date: Mon, 27 Mar 2023 05:08:43 -0000 (UTC) Organization: news.netcologne.de Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <23-03-027@comp.compilers> References: <23-03-025@comp.compilers> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="92280"; mail-complaints-to="abuse@iecc.com" Keywords: Lisp, syntax Posted-Date: 27 Mar 2023 09:12:08 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3429 Christopher F Clark schrieb: > If I recall correctly, at one time, PCCTS and it’s related tool > Sorcerer used an S-expression-like representation for ASTs, including an > equivelnt to CAR and CDR, whose names I don’t recall but they were > something like “down” and “right”. S-expressions are a fairly natural representation of using trees, at least for expressions. An example: If you use gfortran's -fdump-fortran-original option, you will get its internal expression after parsing on standard output. For example, the code of real function foo(x,y) foo = 2.3 + 5.0*x*y end function foo is represented as ASSIGN foo:foo (+ 2.29999995 (* (* 5.00000000 foo:x) foo:y)) where the internal representation is a tree.