+++ /dev/null
-\r
- Microsoft Visual C Stuff\r
-\r
-\r
-[Tom Moog 2-Oct-98\r
-\r
- Users of Microsoft Visual C++ should download a separate\r
- ready-to-run zip file from my web site. It contains \r
- binaries, static library, and a sample project.\r
-]\r
-\r
-[\r
- Two notes added by Tom Moog 23-Sep-97. I believe the *.dsp and\r
- *.mak files that were once at the end of this file are now obsolete.\r
- \r
- The following MSVC .dsp and .mak files for pccts and sorcerer\r
- were contributed by Stanislaw Bochnak (S.Bochnak@microtool.com.pl)\r
- and Jeff Vincent (jvincent@novell.com)\r
-\r
- PCCTS Distribution Kit\r
- ----------------------\r
- pccts/antlr/AntlrMSVC50.dsp\r
- pccts/antlr/AntlrMSVC50.mak\r
-\r
- pccts/dlg/DlgMSVC50.dsp\r
- pccts/dlg/DlgMSVC50.mak\r
-\r
- pccts/support/genmk/watgenmk.mak\r
- pccts/support/msvc.dsp\r
-\r
- Sorcerer Distribution Kit\r
- -------------------------\r
- pccts/sorcerer/SorcererMSVC50.dsp\r
- pccts/sorcerer/SorcererMSVC50.mak\r
-\r
- pccts/sorcerer/lib/msvc.dsp\r
-\r
- I do not have an MS based computer. If you discover problems\r
- please report them so as to save trouble for others in the future.\r
-]\r
-\r
-[\r
- Modified by Terence Parr (September 1995) to change .C to .cpp\r
-]\r
-\r
-[\r
- This file contains notes on MSVC for Windows NT console execs by Dave\r
- Seidel and an explanation of flags etc.. by John Hall; good luck,\r
- Terence\r
-]\r
-\r
-===============================================================================\r
-Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST)\r
-From: David Seidel <75342.2034@compuserve.com>\r
-\r
-I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows \r
-NT. The only (minor) problem I had was that GNU make (version 3.71, in the \r
-djgpp port) complained about "multiple targets" in both the antlr and dlg \r
-makefiles. I got around the error by, in each makefile, commenting out the \r
-$(SRC) dependency, for example:\r
-\r
- antlr: $(OBJ) #$(SRC)\r
-\r
-I don't know why this is happenning, since you haven't changed that part of \r
-the makefile at all, and I think this used to work ok...\r
-\r
-Here are the makefiles I built from within the MSVC 2.0 environment for antlr \r
-and dlg and Windows NT console executables. Please feel free to pass them \r
-on. Of course, as soon as 1.31 "goes gold", I will send you nice new \r
-binaries. I'm not going to bother to keep doing both Borland and djgpp for \r
-DOS however. Instead, I'll just keep the djgpp version up to date and also \r
-provide WinNT binaries.\r
-\r
-Dave\r
-===============================================================================\r
-\r
- How to port PCCTS 1.10 (and 1.32 hopefully) to Visual C++\r
-\r
- By\r
-\r
- John Hall <jhall@ivy.wpi.edu>\r
-\r
-Here is how to compile an ANTLR grammar in Visual C++. These steps\r
-describe how to have your ANTLR grammar parse the input file the user\r
-selects when they choose File Open in your Windows application. (Even\r
-if you aren't using Visual C++, the steps should be portable enough to\r
-other compilers.)\r
-\r
- * Make sure that ANTLR and DLG generate ANSI code (use the -ga\r
- switch).\r
-\r
- * Set the following compiler flags in Visual C++ (these are in the\r
- Memory Model category of the compiler options in the Project\r
- Options menu):\r
-\r
- FLAG MEANING\r
- ==== ==============================================================\r
- /AL Large memory model (multiple data segments; data items must be\r
- smaller than 64K).\r
-\r
- /Gtn Allocates all items whose size is greater than or equal to n\r
- in a new data segment. (I let n be 256: /Gt256.)\r
-\r
- /Gx- All references to data items are done with far addressing in\r
- case they are placed in a far segment.\r
-\r
- * Add the following member variable to the attributes section of your\r
- derived CDocument class (you will need to make sure you also\r
- include stdio.h):\r
-\r
- FILE *fp;\r
-\r
- * Add the following method to your derived CDocument class:\r
-\r
- BOOL CAppDoc::OnOpenDocument(const char* pszPathName)\r
- {\r
- // Call CDocument's OnOpenDocument to do housekeeping for us\r
- // DON'T add anything to the loading section of Serialize\r
- if (!CDocument::OnOpenDocument(pszPathName))\r
- return FALSE;\r
- \r
- // Open input file\r
- if ((fp = fopen(pszPathName, "r")) == NULL)\r
- return FALSE;\r
- \r
- // Parse input file\r
- ANTLR(start(), fp);\r
- \r
- // Close input file\r
- fclose(fp);\r
- return TRUE;\r
- }\r
-\r
- (Note: additional code may be necessary, depending on your parser.\r
- For example, if your parser uses PCCTS's symbol table library, you\r
- will need to insert calls to zzs_init and zzs_done.)\r
-\r
- * Compile the generated C files as C++ files. (I renamed the files\r
- to have a .CPP extension to fool Visual C++ into thinking they were\r
- C++ files. One might also use the /Tp switch, but that switch\r
- requires you separately include the filename.) [I used this step\r
- as an easy out for all the external linking errors I was getting\r
- that I couldn't fix by declaring things extern "C".]\r
-\r
- * Make sure the __STDC__ portion of the generated files gets\r
- compiled. (Either define __STDC__ yourself or else change all\r
- occurrences of __STDC__ to __cplusplus in the generated files. You\r
- can define __STDC__ in the Preprocessor category of the compiler\r
- options.)\r
-\r
- ================================================================\r
- = Note 23-Sep-97: This is probably not necessary any more. =\r
- = With 1.33MRxxx the use of __STDC__ was replaced with the =\r
- = macro __USE_PROTOS to control the compilation of prototypes. =\r
- ================================================================\r
- \r
-That last step is important for Visual C++, but may not apply to other\r
-compilers. For C++ compilers, whether __STDC__ is defined is\r
-implementation dependent (ARM, page 379). Apparently, Visual C++ does\r
-not to define it; it also does not support "old style" C function\r
-definitions (which is okay, according to page 404 of the ARM). Those\r
-two things together caused problems when trying to port the code.\r
-When it saw this:\r
-\r
-#ifdef __STDC__\r
-void\r
-globals(AST **_root)\r
-#else\r
-globals(_root)\r
-AST **_root;\r
-#endif\r
-\r
-it skipped the __STDC__ section and tried to process the "old style"\r
-function definition, where it choked.\r
-\r
-When you finally get your parser to compile and link without error,\r
-you may get General Protection Fault errors at run time. The problem\r
-I had was that a NULL was passed to a variable argument function\r
-without an explicit cast. The function grabbed a pointer (32-bits)\r
-off the stack using va_arg, but the NULL was passed silently as the\r
-integer 0 (16 bits), making the resulting pointer was invalid. (This\r
-was in PCCTS's sample C parser.)\r
-\r
-There is one other thing I might suggest to help you avoid a run-time\r
-error. Make sure you redefine the default error reporting function,\r
-zzsyn. To do this, put "#define USER_ZZSYN" in your #header section\r
-and put your own zzsyn somewhere. You can then pop up a MessageBox or\r
-print the error to some output window.\r
-===============================================================================\r