COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
YACC builds up the
A
SLR parsing table
B
canonical parsing table
C
LALR parsing table
D
none of these
Explanation: 

Detailed explanation-1: -Bottom-up parsing is a more general parsing technique when compared with top-down parsing. The widely used method in practice is bottom-up parsing. Examples of bottom-up parsers are YACC and Bison, which are automatic parser generators.

Detailed explanation-2: -The input to yacc describes the rules of a grammar. yacc uses these rules to produce the source code for a program that parses the grammar. You can then compile this source code to obtain a program that reads input, parses it according to the grammar, and takes action based on the result.

Detailed explanation-3: -Yacc (yet another compiler compiler) is a grammar parser and parser generator. That is, it is a program that reads a grammar specification and generates code that is able to organize input tokens in a syntactic tree in accordance with the grammar.

Detailed explanation-4: -yacc converts a context-free LALR(1) grammar found in the input file gram. y into a set of tables that together with additional C code constitute a parser to recognize that grammar. If you specify an input file named-, yacc reads the grammar from the standard input.

There is 1 question to complete.