I need to take hunreds of pl/sql files which contain stored procedures, views and functions and split them all into individual files.
example:
create or replace function practice_function(hello in table.hello%type) return varchar2 as
hello2 varchar2(6);
begin
if hello is not null then
hello2 := "hi";
end if;
return hello2;
end practice_function
/
This is just an example of a stored function. The file could contain 10 or 20 of these with comments and block comments etc. Could somebody give me advice on a high or low level of how I should go about it and how I should go about writing a parser.
At the moment I'm using Java to read in a file line by line and parse each line as they come in. This for instance has caused problems when I need to ignore code which has a block comment.
Any advice would be great