Sep 26, 2024
α → βType 0 Grammar (Unrestricted Grammar)
α and β can be any combination of terminal and non-terminal symbols.S → AAB, A → BType 1 Grammar (Context Sensitive Grammar)
α and β can be any combination of terminals and non-terminals.α <= Length of β.S → AAB, AA → BType 2 Grammar (Context-Free Grammar)
α must be a non-terminal symbol.β can be any combination of terminal and non-terminal symbols.S → AAB, A → AA | BType 3 Grammar (Regular Grammar)
α must be a non-terminal symbol.β can either be a terminal followed by a non-terminal or just a terminal.A → aB | aS → ASB | εS → AS | BS | ε | A | BA, B, AA, ABBA.AAB, the derivation could be shown as:
S → ASA → AAB