getting AST from yacc

iwlnx <larry@rockridgefarm.com>
Sat, 25 Mar 2023 09:45:06 -0400

          From comp.compilers

Related articles
getting AST from yacc larry@rockridgefarm.com (iwlnx) (2023-03-25)
| List of all articles for this month |
From: iwlnx <larry@rockridgefarm.com>
Newsgroups: comp.compilers
Date: Sat, 25 Mar 2023 09:45:06 -0400
Organization: Compilers Central
References: <sympa.1679707581.2255.930@lists.iecc.com>
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="36785"; mail-complaints-to="abuse@iecc.com"
Keywords: yacc, AST
Posted-Date: 30 Mar 2023 20:33:18 EDT
Content-Language: en-US
In-Reply-To: <sympa.1679707581.2255.930@lists.iecc.com>

I am a bit old and do not learn as well as in the past. I have a very
large yacc file that works fine.


What I want is to produce an AST tree from the yacc .y file. I have read
many things on the net


about this but they all start at too high a level for me to grasp.


Any help for an old slow old man (related to this problem)?


Larry
[The short answer is that yacc doesn't do that, but it's not hard to write action
code that builds a AST as it does the rule reductions. If you can find a copy of
my "flex & bison" it has some examples that build AST. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.