PTC MKS Toolkit Knowledge Base

Section:IO
Product:MKS Lex and Yacc (None)
Version:
OS:All
Keywords:custom, build, command, automate
Category:General/Knowledge Base


How can I run Lex & Yacc from within Developer Studio instead of from the command line?


Use the following steps to run Lex and Yacc from Developer Studio as part of your build process.

  1. Add the scanner and parser definitions to your project. These files usually have extensions of “.l” and “.y”.
  2. Goto the project menu and select settings or press ALT+F7. For both the scanner and parser definition files, select the “Custom Build” tab from the right of the dialog and add a new build command. This will be the same command as you usually run from the command line, in a build script or in a makefile.

    Add the names of all output files generated by this command. This is required to establish dependencies of files within your project.

    Example

      Build Command: lex -LC -D scanner.hpp -o scanner.cpp scanner.l
      Output Files: scanner.cpp scanner.hpp

Note:
As of version 3.3 MKS Lex & Yacc now includes a Microsoft Visual Studio v6.0 Add-in.