Smacc C Project
Last published: July 29, 2019 by 'dwallen'
April 5, 2016 Using VisualWorks 8.2, this bundle only works with the prerequisite package versions from the Public Repository
SmaCC Runtime (1.06)
SmaCC Example Parsers (7.7 - 1.06)
This bundle embodies some experimental research done at Cincom to examine the idea of using SmaCC to replace the DLLCC parser. The new parser targets compliance with the ansii C '99 spec. The effort was inspired largely after seeing Bob Westergaard's remarkable C source to Smalltalk translator system, which leverages SmaCC. The VisualWorks VM team, including John, Pete and Andres generously shared their vision for such an experiment, and answered all requests for their advice. Without their helpful knowledge and patience, the project would not even have been possible.
The focus was on getting the parser to work, so there has been very little effort at refactoring, cleanup and speed enhancements. Likewise, the builder tool isn't fully integrated with the VisualWorks compiler system. The existing system runs its own final compilation pass over the new methods before incorporating them. That final pass still uses the original C parsers, and if a new external method contains C constructs not understood by the old parsers, they will fail to parse that method. There hasn't been much work done examining this area because the project was focused on preliminary basic research.
Be sure to back up your work before loading or experimenting with this bundle. Then you might try:
and a builder should open, and be able to parse files after entering the header filename and search directories.
To parse windows.h, certain macros need to be predefined. It is easier to parse the following file, which itself pulls in windows.h. The values below are not necessarily correct. Milage may vary.
=== begin smacc_win.h ===
#define _MSC_VER 1000
#define _WIN32_WINNT 0x0400
#define _INTEGRAL_MAX_BITS 64
#define _WIN32_WCE 0x400
#define __int64 long long
#define __w64 unsigned long long
#define _M_IX86 300
=== end smacc_win.h ===