I know that C is not a context-free language, a famous example is:
int foo;
typedef int foo;
foo x;
In this case the lexer doesn't know, whether foo
in the 3rd line, is an identifier, or typedef
.
My question is, is this the only reason that makes C a Context-Sensitive Language?
I mean, if we get rid of typedef
, would it become context-free language? Or there are other reasons (examples) that prevent it from being so?