Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #1123
| From | Momchil Velikov <momchil.velikov@gmail.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Having trouble converting composite variables to intermediate form |
| Date | 2014-02-28 08:27 -0800 |
| Organization | Compilers Central |
| Message-ID | <14-03-001@comp.compilers> (permalink) |
| References | <14-02-029@comp.compilers> |
On Saturday, February 22, 2014 7:32:01 PM UTC+2, noitalmost wrote: > > x := r.a[2] + 5; > > After parsing, the Wirl AST fragment looks like: > > Assign > Ident x > Op + > RecAccess > Ident r > ArrAccess > Ident a > Num 2 You have currently RecAccess(r, ArrAccess(Ident(a), Num(2))) Note, however, that the array is not `a`, it's `r.a`. The subtree `ArrAccess(Ident(a), Num(2)) `is incorrect, because you don't have in fact a variable named `a` of an array type. Here the record access should take precedence over array access, i.e. the AST should look like: ArrAccess(RecAccess(r, Ident(a)), Num(2))
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Having trouble converting composite variables to intermediate form noitalmost <noitalmost@cox.net> - 2014-02-22 12:32 -0500 Re: Having trouble converting composite variables to intermediate form Momchil Velikov <momchil.velikov@gmail.com> - 2014-02-28 08:27 -0800 Re: Having trouble converting composite variables to intermediate form noitalmost <noitalmost@cox.net> - 2014-03-10 15:18 -0400
csiph-web