|Alternatives to Syntax Trees firstname.lastname@example.org (Seima Rao) (2017-01-15)|
|Re: Alternatives to Syntax Trees email@example.com (Kaz Kylheku) (2017-01-15)|
|Re: Alternatives to Syntax Trees firstname.lastname@example.org (George Neuner) (2017-01-16)|
|Re: Alternatives to Syntax Trees email@example.com (2017-01-16)|
|Alternatives to Syntax Trees firstname.lastname@example.org (Seima Rao) (2017-01-17)|
|Re: Alternatives to Syntax Trees email@example.com (Kaz Kylheku) (2017-01-17)|
|Re: Alternatives to Syntax Trees firstname.lastname@example.org (George Neuner) (2017-01-17)|
|From:||George Neuner <email@example.com>|
|Date:||Mon, 16 Jan 2017 06:11:27 -0500|
|Organization:||A noiseless patient Spider|
|Injection-Info:||miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="32746"; mail-complaints-to="firstname.lastname@example.org"|
|Posted-Date:||16 Jan 2017 09:22:14 EST|
On Sun, 15 Jan 2017 16:52:15 -0500 (EST), Seima Rao
> Are there alternatives to syntax trees(i.e. the tree data structure)
> when compiling via yacc or yacc like tools ?
Parser tools don't limit the structure of the intermediate
>[There's quadruples, doubly linked lists of data structures. They
>make it easier to rearrange code, but harder to do just about anything
>else. There's also DAGs, which are trees that can have shared subtrees,
>useful when you're doing common subexpressions or tail merging. -John]
To add a bit to John's excellent response:
You can use a combined representation: e.g., a graph to represent
control - function defintions, loops, conditionals, etc. - and within
the graph use 3-address form to represent basic blocks (straight line
Some analyses, e.g., determining dominance for EBB def/kill chains,
require both the basic blocks and the graph of their connectivity.
Also, "quadruples" are one form of 3-address representation. There
are other forms of 3-address and you can implement them using either
lists or arrays. Quadruples are the most commonly used because - as
John mentioned - they are the easiest to rearrange.
Return to the
Search the comp.compilers archives again.