i want to perform analysis on SQL code. In this i would like to separate the blocks in SQL code. for example, in the code below
for condition1 loop stmt1; for condition2 loop stmt2; end loop; end loop;
i want to separate these two blocks and create a data structure which will contain outer loop block and will also have inner loop block.
which is the best way to do so? is there any parser available which can handle the nested loops in the best possible way?
I would suggest composit pattern for this kind of blocks (and also for SELECT, CASE, WITH and similar).
and somewhere in the program:
see related links:
CodeProject: Illustrated GOF Design Patterns in C#
data&object factory: Composite pattern