YACC & LEX

 

·         Readability

 

Lex and Yacc programming languages has a smaller number of resources to find and learn from. Also, Understanding the program structure was an easy task but understanding the connectivity and the flow of the program was a challenging task. Furthermore, lex and Yacc had a format for the programs (definitions, rules, subroutines) and it was separated using “%%”. Therefore, the readability of lex and Yacc is questionable.

 

·         Writability

 

The factors affecting readability also affects writability as a result, the writability of lex and Yacc is also questionable. Also, lex used “[0-9] +” to accept inputs from 0 to 9. Yacc used “%token” to accept the returned value from lex. Codes similar to C programming language was implemented while printing and declarations. Usage of pointers was also possible. Furthermore, lex and Yacc used “%%/ %{%}” for separating (block structure) the code. Lex and Yacc also had data types such as INT, FLOAT,CHAR,DOUBLE. Yacc and lex is a compiler language, since it’s a compiler language learning and writing a program is a rigid task.

 

·         Reliability

 

        The factors affecting readability and writability also affects reliability as a result, the reliability of lex and Yacc is also questionable. Lex and Yacc has its type checking in its compile time. Also, lex and Yacc has exception handling. When a Yacc discovers a parser error it calls to yyerror and return the value ”1” from yylex. The reliability of lex and Yacc is improved up to certain extend using these features.

Comments