CFG- Context-Free Grammar
CFG- Context-free grammar is semantic free grammar. CFG has the following terms.
- Non Terminals
- Production ǀ Rule
By using the terminals we can terminate our language.
Through which language cannot be terminated.
We produce the language by applying the proper rule.
Tree Representation form:
A parse tree is a binary tree that graphically represents the semantic information a string derived from a context-free grammar.
- Root − Must be labeled by the start symbol.
- Vertex− Labeled by a non-terminal symbol.
- Leaves− Labeled by a terminal symbol or ε. Advertisement
Z → x1x2 …… xn have the following tree representation.
There are two types of derivation approaches are used:
- Top-Down approach.
- Bottom-Up Approach.
- Starts from tree root.
- Goes down to tree leaves using productions.
- Starts from tree leaves.
- Proceeds upward to the root which is the starting symbol S.