Specifically in a case like this:
私が迷っているうちに、次第に登校する生徒の数は少なくなり、予鈴が鳴った。
Does 次第に modify 登校する or 少なくなり? I thought that maybe 登校する生徒の数 is considered as one unit and thus 次第に modifies 少なくなり. Is that impossible?
Specifically in a case like this:
私が迷っているうちに、次第に登校する生徒の数は少なくなり、予鈴が鳴った。
Does 次第に modify 登校する or 少なくなり? I thought that maybe 登校する生徒の数 is considered as one unit and thus 次第に modifies 少なくなり. Is that impossible?
Yes, 次第に modifies 少なくなり in that sentence, nothing else.
One cannot say 次第に登校する in the first place anyway because "going to school = 登校する" is not something one can do "little by little = 次第に". 次第に少なくなる, however, is a natural-sounding phrase because the number of something (students in this case) CAN decrease little by little.
You are also correct in considering 登校する生徒の数 as one unit because it is one noun phrase.