What are the advantages and disadvantages of defining the keyword and symbol tables in the scanner or the parser?
Ans. Advantages and disadvantages of defining symbol table in the scanner or parser:
Advantages:
1. The symbol table makes it easier to quickly search the identifier record and retrieve it.
2. The symbol table used to verify that used identifiers have been defined .
3. The symbol table is used to implement type checking by verifying expressions and assignments are semantically correct .
4. It is used to store the name of all entities in a structural form at one place.
Disadvantages:
1. It doesn't perform the processing of the assembler directives.
2. Hashing is complicated to implement in symbol table.
Advantages and disadvantages of defining keyword ìn scanner and parser:
keyword uses as a token, the pattern is a sequence of characters used in the scanner or parser.
Get Answers For Free
Most questions answered within 1 hours.