First
First
AIM:
Write a python program to find the first of non-terminals from the given
productions/grammar.
PROGRAM:
def first(grammar, non_terminal, visited=None):
if visited is None:
visited = set()
first_set = set()
visited.add(non_terminal)
def main():
grammar = {}
non_terminals = set()
if _name_ == "_main_":
main()
RESULT:
Program to find the first of the non-terminals from the given grammar/productions have
been executed successfully.