> Thanks for your attention, but I know that. I just want to see the
> "source text" variables names separately to know better
> the logic portion about, inside the program modules.
>
> Roberto
I guess the algo would be something like this:
open file
while it's not in EOF,
read in a statement (*)
if ths statement contains required var
print it, along with line number for reference
close file
Function to read in a statement:
empty buffer
repeat
read in a character
if the character is a semi-colon,
terminate buffer
return
if the character is an open-brace '{'
search for keywords in buffer so far to indicate that this
is a statement and not a function (if, while, etc.)
if it is a statement
terminate buffer,
return
if it's a function
empty buffer,
continue searching
if the character is a close-brace '}'
ignore it,
continue searching
add character to buffer
-----------------------------------------------------
Try coding it, I dunno how well it'll work.
|