Appendix F. MKS lex and yacc

Mortice Kern Systems has a lex and yacc package that runs under MS-DOS and OS/2. It includes an excellent 450 page manual, so in this discussion concentrates on the differences between MKS and other implementations. It is available from:

         Mortice Kern Systems          35 King Street North          Waterloo, ON N2J2W9          Canada          Phone: +1 519 884 2251          or in the U.S. (800) 265-2797 E-mail:        

Differences

Most of the differences are due to running under MS-DOS or OS/2 rather than UNIX.

  • The output files have different names: lex_yy.c, ytab.c, ytab.h, and y.out. rather than lex.yy.c, y.tab.c, y.tab.h, and y.output.

  • MKS lex has its own method for handling nested include files. See "Include Operations" in Chapter 6 for details.

  • MKS lex has its own method for resetting a lexer into its initial state. See "Returning Values from yylex()" in Chapter 6.

  • MKS lex uses the macro yygetc() to read input. You can redefine it to change the input source. See "Input from Strings" in Chapter 6.

  • The standard lex token buffer is only 100 characters. You can enlarge it by redefining some macros. See "yytext" in Chapter 6.

  • The internal yacc tables are generated differently. This makes error recovery slightly different; in general MKS yacc will perform fewer reductions than will UNIX yacc before noticing an error on a lookahead token.

New Features

  • MKS lex and yacc can generate scanners and parsers in C++ and Pascal as well as in C.

  • MKS ...

Get lex & yacc, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.