Implementing data flow analysis in single pass parser



Hi all,

I am new to compiler writing and need some help in implementing some
of the classical algorithms for data flow analysis given in the Dragon
book. I am trying to come up with a method to synthesize pointers in
the C program to VHDL or Verilog so that it can be translated into
hardware circuits. For this I should be able to first identify
pointers in the C program. I read the chapter 10.8 in dragon book
"Dealing with aliases" which vaguely gives a method to determine
pointers in each basic block of the program. It looks to me like it
can be implemented only by multiple parses of the source to achieve
the desired convergence.

I have written a parser to parse the CFG version of the C code dumped
by the gcc option "gcc -fdump-tree-cfg <filename.c>". Its a single
pass parser. I am stuck at this point of how to implement the pointer
identification further. I previously implemented algorithm for finding
the reaching definitions (algorithm 10.2) as a post parse one and it
was a success.

Can someone look into the compiler book and let me know if I can
implement this using a single parse or do I need to change the
implementation method ?.

Thanks a lot!

K7...

.



Relevant Pages

  • Re: Code for finding the 1000th prime
    ... Also I am not a mathematician. ... Can some one give me pointers for ... all that's left to do is write a prime number generator (a random ... That reminds me of the only algorithm I really invented myself: ...
    (comp.lang.python)
  • Re: Unique Elements in a List
    ... of the algorithm increases exponentially relative to the ... the computing time would be 100*p. ... list.countmust iterate through the list each time, ... Wikipedia has good resources and pointers to related things, ...
    (comp.lang.python)
  • Re: Whats the position of pointers
    ... people to write a program to sort some data, where the intent is for them ... understand the *importance* of pointers (remember it is the importance ... he will come up with an algorithm which probably can be any of the ... algorithm with complexity Osuch as merge sort, ...
    (comp.lang.c)
  • Re: Pointer equality and dereferencing
    ... int main{ ... there is no semantic meaning to the struct twoptrs. ... The pointers have meaningless names and serve no useful purpose in this particular program other than to illustrate my point; but that's because any real-life example would be a lot bigger and more complicated and nobody would bother to read it. ... That's how a lot of compression or encryption algorithm works. ...
    (comp.std.c)
  • Re: [SOLUTION][QUIZ] FizzBuzz (#126) [solution #2]
    ... On 6/7/07, MenTaLguY wrote: ... > Perhapps you are doing it but I was unable to parse the ... > whole algorithm out and figure out exactly what all the lambdas ...
    (comp.lang.ruby)

Loading