What does the term context mean in context-free and context-sensitive languages? Can a variable have multiple contexts? If I need to store a particular value in a particular memory address how does does affect the context of the memory address? And if I want to update a variable how does the context of the variable change?
What does the term context mean in context-free and context-sensitive languages? Can a variable
Share
A context-sensitive grammar, productions have the general form
where upper-case symbols are non-terminals and lower-case symbols are sequences of terminals and non-terminals.
In the above example,
aandbwould be the context of the non-terminalBand indicate thatBmay “expand” tob'only when surrounded byaandc.In a context free grammar, the production might look like
i.e.
B“expands” tob'regardless of whatever is around it, in other words, regardless of context.