Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1809

Re: Alternatives to Syntax Trees

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!enother.net!enother.net!enother.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Kaz Kylheku <221-501-9011@kylheku.com>
Newsgroups comp.compilers
Subject Re: Alternatives to Syntax Trees
Date Sun, 15 Jan 2017 22:31:45 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 24
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <17-01-003@comp.compilers> (permalink)
References <17-01-002@comp.compilers>
Injection-Info miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="32457"; mail-complaints-to="abuse@iecc.com"
Keywords parse, optimize
Posted-Date 16 Jan 2017 09:21:28 EST
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:1809

Show key headers only | View raw


On 2017-01-15, Seima Rao <seimarao@gmail.com> wrote:
> Hi,
>
>     Are there alternatives to syntax trees(i.e. the tree data structure)
>     when compiling via yacc or yacc like  tools ?

If the language you are parsing has a context-free grammar suitable for
Yacc, then the parse corresponds to a tree. More precisely, a real-world
parse corresponds to a DAG: a tree in which some nodes are shared. For
instance if you're parsing Lisp, an input like (a a a) is converted to
DAG in which all three occurences of "a" point to the same symbol
object. This is because the symbols are "interned" as scanning takes
place.

Compilers do not use the tree data structure in all passes. Syntax
trees represent only the raw syntax. An intermediate representation
may be quite different: a graph containing chunks of instruction
sequences.

--
TXR Programming Lanuage: http://nongnu.org/txr
Music DIY Mailing List:  http://www.kylheku.com/diy
ADA MP-1 Mailing List:   http://www.kylheku.com/mp1

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Alternatives to Syntax Trees Seima Rao <seimarao@gmail.com> - 2017-01-15 16:52 -0500
  Re: Alternatives to Syntax Trees Kaz Kylheku <221-501-9011@kylheku.com> - 2017-01-15 22:31 +0000
  Re: Alternatives to Syntax Trees George Neuner <gneuner2@comcast.net> - 2017-01-16 06:11 -0500
  Re: Alternatives to Syntax Trees rpw3@rpw3.org (Rob Warnock) - 2017-01-16 12:12 +0000
    Alternatives to Syntax Trees Seima Rao <seimarao@gmail.com> - 2017-01-17 14:16 +0530
      Re: Alternatives to Syntax Trees Kaz Kylheku <221-501-9011@kylheku.com> - 2017-01-17 22:39 +0000
      Re: Alternatives to Syntax Trees George Neuner <gneuner2@comcast.net> - 2017-01-17 22:08 -0500

csiph-web