Compiler Design

CYK Algorithm

Cocke Younger Kasami ( CYK ) algorithm is a parsing algorithm for context-free grammar. CYK algorithm only operates on context-free grammar which is in CNF ( Chomsky Normal Form ). We must convert the context-free grammar to CNF before applying CYK algorithm. CYK algorithm is a bottom-up parsing approach. It is based on the dynamic …

CYK Algorithm Read More »

FIRST FOLLOW

FIRST(A) is defined as a set of terminals that begin the strings defined by A. If A derives ‘Є’ then ‘Є’ is in FIRST(A).FOLLOW(A) for a non-terminal A is defined as a set of terminals that can appear on the right side of A in the sentential form. FOLLOW is only applied for non-terminals. The FOLLOW of start symbol always contain the end marks ‘$’.