In compilers, the syntax analysis is done by
In compilers, the syntax analysis is done by parser.
parser:-
A syntax analyzer or parser takes the input from a lexical analyzer in the form of token streams. The parser analyzes the source code (token stream) against the production rules to detect any errors in the code. The output of this phase is a parse tree.
Syntax analysis:-
Syntax analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar.