├── .gitignore ├── README.md ├── bug_reports ├── prn10.html ├── prn11.html ├── prn12.html ├── prn8.html └── prn9.html ├── build_posixgcc.sh ├── build_w32bcc.PIF ├── build_w32bcc.bat ├── build_w32vc.PIF ├── build_w32vc.bat ├── build_w32vct2003.bat ├── cccc ├── CCCC User Guide.html ├── COPYING ├── Cccc.dsp ├── ada.g ├── cccc.g ├── cccc.h ├── cccc_db.cc ├── cccc_db.h ├── cccc_ext.cc ├── cccc_ext.h ├── cccc_htm.cc ├── cccc_htm.h ├── cccc_itm.cc ├── cccc_itm.h ├── cccc_mem.cc ├── cccc_mem.h ├── cccc_met.cc ├── cccc_met.h ├── cccc_mod.cc ├── cccc_mod.h ├── cccc_new.cc ├── cccc_opt.cc ├── cccc_opt.h ├── cccc_prj.cc ├── cccc_prj.h ├── cccc_rec.cc ├── cccc_rec.h ├── cccc_tbl.cc ├── cccc_tbl.h ├── cccc_tok.cc ├── cccc_tok.h ├── cccc_tpl.cc ├── cccc_use.cc ├── cccc_use.h ├── cccc_utl.cc ├── cccc_utl.h ├── cccc_ver.h ├── cccc_xml.cc ├── cccc_xml.h ├── ccccmain.cc ├── java.g ├── posixgcc.mak ├── rules.mak ├── w32bcb.mak ├── w32bcc.mak ├── w32bcc55.mak ├── w32cygnus.mak ├── w32cygnus_gmake.mak ├── w32cygnus_nmake.mak └── w32vc.mak ├── ccccdist.dsw ├── changes.txt ├── debian ├── cccc.1 ├── changelog ├── clean ├── compat ├── control ├── copyright ├── docs ├── install ├── lintian-overrides ├── manpages ├── patches │ ├── better-clean.patch │ ├── no-dependent-base-lookup.patch │ ├── series │ └── tests-unified-diff.patch ├── rules └── source │ └── format ├── documentation.dsp ├── install ├── install.dsp └── install.mak ├── makefile ├── pccts ├── CHANGES_FROM_131.txt ├── CHANGES_FROM_133.txt ├── CHANGES_FROM_133_BEFORE_MR13.txt ├── IBM_VISUAL_AGE_PROJECTS │ ├── antlr.icc │ ├── dlg.icc │ └── sorcerer.icc ├── KNOWN_PROBLEMS.txt ├── MPW_Read_Me ├── NOTES.OS2 ├── NOTES.bcc ├── NOTES.msvc ├── NOTES.watcom ├── README ├── RIGHTS ├── antlr │ ├── Antlr.SUP │ ├── AntlrMS.mak │ ├── AntlrMSVC50.dsp │ ├── AntlrMSVC50.dsw │ ├── AntlrMSVC50.mak │ ├── AntlrMSVC60.dsp │ ├── AntlrMSVC60.dsw │ ├── README │ ├── antlr.1 │ ├── antlr.c │ ├── antlr.g │ ├── antlr.r │ ├── antlr1.txt │ ├── antlr68K.make │ ├── antlrPPC.make │ ├── bits.c │ ├── build.c │ ├── dumpcycles.c │ ├── dumpnode.c │ ├── egman.c │ ├── err.c │ ├── fcache.c │ ├── fset.c │ ├── fset2.c │ ├── gen.c │ ├── generic.h │ ├── globals.c │ ├── hash.c │ ├── hash.h │ ├── lex.c │ ├── main.c │ ├── makefile │ ├── makefile.VMS │ ├── makefile1 │ ├── misc.c │ ├── mode.h │ ├── mrhoist.c │ ├── parser.dlg │ ├── pred.c │ ├── proto.h │ ├── scan.c │ ├── stdpccts.h │ ├── syn.h │ ├── tokens.h │ └── watantlr.mak ├── dlg │ ├── DlgMS.mak │ ├── DlgMSVC50.dsp │ ├── DlgMSVC50.dsw │ ├── DlgMSVC60.dsp │ ├── DlgMSVC60.dsw │ ├── automata.c │ ├── dlg.1 │ ├── dlg.h │ ├── dlg.r │ ├── dlg1.txt │ ├── dlg68K.make │ ├── dlgPPC.make │ ├── dlg_a.c │ ├── dlg_p.c │ ├── dlg_p.g │ ├── err.c │ ├── main.c │ ├── makefile │ ├── makefile.VMS │ ├── makefile1 │ ├── mode.h │ ├── output.c │ ├── parser.dlg │ ├── relabel.c │ ├── stdpccts.h │ ├── support.c │ ├── tokens.h │ └── watdlg.mak ├── h │ ├── AParser.cpp │ ├── AParser.h │ ├── ASTBase.cpp │ ├── ASTBase.h │ ├── ATokPtr.cpp │ ├── ATokPtr.h │ ├── AToken.h │ ├── ATokenBuffer.cpp │ ├── ATokenBuffer.h │ ├── ATokenStream.h │ ├── AToken_traditional.h │ ├── BufFileInput.cpp │ ├── BufFileInput.h │ ├── DLG_stream_input.h │ ├── DLexer.cpp │ ├── DLexerBase.cpp │ ├── DLexerBase.h │ ├── PBlackBox.h │ ├── PCCTSAST.cpp │ ├── PCCTSAST.h │ ├── SList.h │ ├── antlr.h │ ├── ast.c │ ├── ast.h │ ├── charbuf.h │ ├── charptr.c │ ├── charptr.h │ ├── config.h │ ├── dlgauto.h │ ├── dlgdef.h │ ├── err.h │ ├── int.h │ ├── pccts_assert.h │ ├── pccts_iostream.h │ ├── pccts_istream.h │ ├── pccts_setjmp.h │ ├── pccts_stdarg.h │ ├── pccts_stdio.h │ ├── pccts_stdlib.h │ ├── pccts_string.h │ ├── pcctscfg.h │ ├── pcctslib50.dsp │ ├── pcctslib50.dsw │ ├── pcctslib60.dsp │ ├── pcctslib60.dsw │ ├── pcnames.bat │ └── slist.cpp ├── history.ps ├── history.txt ├── install68K.mpw ├── installPPC.mpw ├── makefile ├── old_README └── support │ ├── DECmms │ ├── genmms.c │ └── makefile.VMS │ ├── genmk │ ├── genmk.c │ ├── makefile │ └── watgenmk.mak │ ├── msvc.dsp │ ├── rexpr │ ├── makefile │ ├── rexpr.c │ ├── rexpr.h │ └── test.c │ ├── set │ ├── set.c │ └── set.h │ └── sym │ ├── sym.c │ └── template.h ├── test ├── diff.bat ├── posix.mak ├── prn1.cc ├── prn1.dbref ├── prn1.htmlref ├── prn1.xmlref ├── prn10.cc ├── prn10.dbref ├── prn10.htmlref ├── prn10.xmlref ├── prn11.cc ├── prn11.dbref ├── prn11.htmlref ├── prn11.xmlref ├── prn12.cc ├── prn12.dbref ├── prn12.htmlref ├── prn12.xmlref ├── prn13.dbref ├── prn13.htmlref ├── prn13.java ├── prn13.xmlref ├── prn14.dbref ├── prn14.htmlref ├── prn14.java ├── prn14.xmlref ├── prn15.dbref ├── prn15.htmlref ├── prn15.java ├── prn15.xmlref ├── prn16.dbref ├── prn16.htmlref ├── prn16.java ├── prn16.xmlref ├── prn2.cc ├── prn2.dbref ├── prn2.htmlref ├── prn2.xmlref ├── prn3.cc ├── prn3.dbref ├── prn3.htmlref ├── prn3.xmlref ├── prn4.cc ├── prn4.dbref ├── prn4.htmlref ├── prn4.xmlref ├── prn5.cc ├── prn5.dbref ├── prn5.htmlref ├── prn5.xmlref ├── prn6.cc ├── prn6.dbref ├── prn6.htmlref ├── prn6.xmlref ├── prn7.c ├── prn7.dbref ├── prn7.htmlref ├── prn7.xmlref ├── prn8.dbref ├── prn8.htmlref ├── prn8.java ├── prn8.out ├── prn8.xmlref ├── prn9.cc ├── prn9.dbref ├── prn9.htmlref ├── prn9.xmlref ├── rules.mak ├── run_test.bat ├── run_test_c.bat ├── run_test_cc.bat ├── run_test_java.bat ├── run_test_test4.bat ├── test.dsp ├── test1.cc ├── test1.dbref ├── test1.htmlref ├── test1.xmlref ├── test2.cc ├── test2.dbref ├── test2.htmlref ├── test2.xmlref ├── test3.cc ├── test3.dbref ├── test3.htmlref ├── test3.xmlref ├── test4.cc ├── test4.dbref ├── test4.htmlref ├── test4.opt ├── test4.xmlref ├── vanilla.opt ├── w32bcc.mak ├── w32vc.mak └── win32_nmake.mak ├── vcaddin ├── CcccDevStudioAddIn.cpp ├── CcccDevStudioAddIn.def ├── CcccDevStudioAddIn.dsp ├── CcccDevStudioAddIn.h ├── CcccDevStudioAddIn.mak ├── CcccDevStudioAddIn.odl ├── CcccDevStudioAddIn.rc ├── CommandForm.cpp ├── CommandForm.h ├── Commands.cpp ├── Commands.h ├── DSAddIn.cpp ├── DSAddIn.h ├── DevStudioFileStore.cpp ├── DevStudioFileStore.h ├── FileList.cpp ├── FileList.h ├── ReadMe.txt ├── StdAfx.cpp ├── StdAfx.h ├── WorkspaceInfo.cpp ├── WorkspaceInfo.h ├── res │ ├── CcccDevStudioAddIn.rc2 │ ├── TBarLrge.bmp │ └── TBarMedm.bmp └── resource.h ├── w32installer ├── cccc.iss.nover ├── ccccwrap.bat ├── ccccwrap_build.bat └── make_cccc_env.bat └── zip_src.bat /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /bug_reports/prn8.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/bug_reports/prn8.html -------------------------------------------------------------------------------- /build_posixgcc.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # build_posixgcc.sh 3 | 4 | # This file builds and tests CCCC on a POSIX platform using the 5 | # GNU C++ compiler. 6 | 7 | cd pccts 8 | make clean 9 | make 10 | cd .. 11 | 12 | cd cccc 13 | make -f posixgcc.mak clean 14 | make -f posixgcc.mak 15 | cd .. 16 | 17 | cd test 18 | make -f posix.mak 19 | cd .. 20 | 21 | 22 | -------------------------------------------------------------------------------- /build_w32bcc.PIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/build_w32bcc.PIF -------------------------------------------------------------------------------- /build_w32bcc.bat: -------------------------------------------------------------------------------- 1 | @rem build_w32bcc.bat 2 | @echo off 3 | 4 | rem This file builds and tests CCCC under the Borland Command line 5 | rem C++ compiler. 6 | rem Path to Microsoft Visual Studio standard edition release 6.0 7 | set BCDIR=c:\Program Files\Borland\bcc55 8 | if not exist "%BCDIR%\bin\bcc32.exe" goto no_bcc 9 | 10 | PATH "%BCDIR%\bin";%PATH% 11 | 12 | rem One day there I will do Borland Makefiles for ANTLR and DLG. 13 | rem For the moment I will rely on versions precompiled under MSVC. 14 | if not exist pccts\bin\antlr.exe goto no_pccts 15 | if not exist pccts\bin\dlg.exe goto no_pccts 16 | 17 | cd cccc 18 | if exist *.obj del *.obj 19 | if exist *.cpp del *.cpp 20 | make -f w32bcc.mak 21 | cd .. 22 | 23 | cd test 24 | make -f w32bcc.mak 25 | cd .. 26 | 27 | goto end 28 | 29 | :no_bcc 30 | echo This script expects Borland C++ command line compiler to be in 31 | echo %VCDIR%\bin\bcc32.exe. 32 | echo Please modify the script if the location is different. 33 | goto end 34 | 35 | :no_pccts 36 | echo This script expects precompiled versions of PCCTS binaries 37 | echo DLG and ANTLR to be in pccts\bin. 38 | echo The CCCC package contains makefiles to build these under 39 | echo MSVC, otherwise you can write and contribute makefiles for 40 | echo BCC32. 41 | 42 | :end 43 | 44 | -------------------------------------------------------------------------------- /build_w32vc.PIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/build_w32vc.PIF -------------------------------------------------------------------------------- /build_w32vc.bat: -------------------------------------------------------------------------------- 1 | @rem build_w32vc.bat 2 | @echo off 3 | 4 | rem This file builds and tests CCCC under Microsoft Visual Studio. 5 | rem Path to Microsoft Visual Studio standard edition release 6.0 6 | set VCDIR=c:\Program Files\Microsoft Visual Studio\vc98 7 | if not exist "%VCDIR%\bin\vcvars32.bat" goto no_vc 8 | 9 | call "%VCDIR%\bin\vcvars32.bat" 10 | if not exist pccts\bin mkdir pccts\bin 11 | 12 | cd pccts\dlg 13 | if exist *.obj del *.obj 14 | nmake -f DlgMS.mak 15 | copy dlg.exe ..\bin 16 | cd ..\.. 17 | 18 | cd pccts\antlr 19 | if exist *.obj del *.obj 20 | nmake -f AntlrMS.mak 21 | copy antlr.exe ..\bin 22 | cd ..\.. 23 | 24 | cd cccc 25 | if exist *.obj del *.obj 26 | if exist *.cpp del *.cpp 27 | nmake -f w32vc.mak 28 | cd .. 29 | 30 | cd test 31 | nmake -f w32vc.mak 32 | cd .. 33 | 34 | cd vcaddin 35 | nmake -f CcccDevStudioAddIn.mak CFG="CcccDevStudioAddIn - Win32 Release" 36 | cd .. 37 | 38 | 39 | goto end 40 | 41 | :no_vc 42 | echo This script expects MS Visual C++ to be in %VCDIR% 43 | echo Please modify the script if the location is different. 44 | 45 | 46 | 47 | :end 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /cccc/cccc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cccc.h 3 | * diagnostic and portability facilities for the cccc project 4 | */ 5 | 6 | #ifndef _CCCC_H__ 7 | #define _CCCC_H__ 8 | 9 | #ifdef _WIN32 10 | #pragma warning (disable:4786 4503) 11 | #endif 12 | 13 | // I am trying to standardise on using the ANSI C++ names 14 | // for the ANSI C header files, and bringing all of 15 | // the includes of these libraries into this file. 16 | // I have not yet attempted to purge includes for these 17 | // files from the other source files. 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | using std::string; 27 | #include 28 | #include 29 | #include 30 | using std::ostream; 31 | using std::istream; 32 | using std::ifstream; 33 | using std::ofstream; 34 | using std::istringstream; 35 | using std::ostringstream; 36 | using std::stringstream; 37 | using std::endl; 38 | using std::cout; 39 | using std::cerr; 40 | 41 | // debugging facilities 42 | extern int DebugMask; 43 | enum DebugFlags { 44 | LEXER=0x01, 45 | PARSER=0x02, 46 | COUNTER=0x04, 47 | MEMORY=0x08, 48 | EXTENT=0x10, 49 | DATABASE=0x20 50 | }; 51 | #define DbgMsg(DF,OS,X) if(DebugMask&DF) { OS << X ; } 52 | 53 | // the global database to which stuff is added... 54 | class CCCC_Project; 55 | extern CCCC_Project *prj; 56 | 57 | // a nasty global array of identifiers we want the lexer to ignore 58 | #define SKIP_IDENTIFIERS_ARRAY_SIZE 256 59 | extern char *skip_identifiers[SKIP_IDENTIFIERS_ARRAY_SIZE]; 60 | #if 0 61 | #include "DLGLexer.h" 62 | #endif 63 | 64 | // These macros were used to cover differences between the way the 65 | // old strstream classes were used in Win32 and GNU builds. 66 | // The differences are no longer necessary. 67 | #define MAKE_STRSTREAM(X) stringstream X; 68 | #define CONVERT_STRSTREAM(X) (X) 69 | #define RELEASE_STRSTREAM(X) 70 | 71 | 72 | // The -gd option generates uncompilable code with a missing 73 | // variable called zzTracePrevRuleName if the generated 74 | // files cccc.cpp, java.cpp, ada.cpp don't include a version 75 | // of AParser.h seen with zzTRACE_RULES defined. 76 | // I'm not sure how this is supposed to work, but for the moment 77 | // I am including it here which should make all three files OK. 78 | // Note that this could break again if the header files shift around 79 | // and AParser.h gets read before zzTRACE_RULES is defined. 80 | // Another option is turning -gd off, but its the way we do the 81 | // cccc -dp debug output which is very useful. 82 | #include "cccc_tok.h" 83 | #define zzTRACE_RULES 84 | #include "AParser.h" 85 | 86 | #endif 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /cccc/cccc_ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_ext.h 21 | */ 22 | #ifndef CCCC_EXT_H 23 | #define CCCC_EXT_H 24 | 25 | #include 26 | using std::string; 27 | 28 | #include "cccc_utl.h" 29 | 30 | class CCCC_Item; 31 | 32 | enum ExtentNameLevel { nlFILENAME=-1, nlLINENUMBER=-2, nlDESCRIPTION=-3}; 33 | class CCCC_Extent 34 | { 35 | friend class CCCC_Record; 36 | friend class CCCC_Project; 37 | 38 | string filename; 39 | string linenumber; 40 | string description; 41 | string flags; 42 | string count_buffer; 43 | UseType ut; 44 | Visibility v; 45 | static unsigned int nextkey; 46 | unsigned int extkey; 47 | public: 48 | CCCC_Extent(); 49 | CCCC_Extent(CCCC_Item& is); 50 | 51 | string name( int index ) const; 52 | string key() const; 53 | int GetFromItem(CCCC_Item& item); 54 | int AddToItem(CCCC_Item& item); 55 | Visibility get_visibility() const { return v; } 56 | int get_count(const char *count_tag); 57 | UseType get_usetype() const { return ut; } 58 | const char* get_description() const { return description.c_str(); } 59 | }; 60 | 61 | #endif // CCCC_EXT_H 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /cccc/cccc_itm.cc: -------------------------------------------------------------------------------- 1 | // cccc_itm.cc 2 | 3 | #include "cccc.h" 4 | #include 5 | 6 | #include "cccc_itm.h" 7 | #include 8 | #include 9 | 10 | CCCC_Item::CCCC_Item(const string& s, char c) 11 | { 12 | buffer=s; 13 | delimiter=c; 14 | good=true; 15 | } 16 | 17 | CCCC_Item::CCCC_Item(const string& s) 18 | { 19 | buffer=s; 20 | delimiter='@'; 21 | good=true; 22 | } 23 | 24 | CCCC_Item::CCCC_Item() 25 | { 26 | buffer=""; 27 | delimiter='@'; 28 | good=true; 29 | } 30 | 31 | bool CCCC_Item::Insert(const string& s) 32 | { 33 | buffer+=s; 34 | buffer+=delimiter; 35 | #if 0 36 | cerr << buffer << endl; 37 | #endif 38 | return good; 39 | } 40 | 41 | bool CCCC_Item::Insert(const char* cptr) 42 | { 43 | string s(cptr); 44 | return Insert(s); 45 | } 46 | 47 | bool CCCC_Item::Extract(string& s) 48 | { 49 | size_t delimiter_position=buffer.find(delimiter); 50 | if(delimiter_position!=string::npos) 51 | { 52 | good=true; 53 | s=buffer.substr(0,delimiter_position); 54 | string tempBuffer=buffer.substr(delimiter_position+1); 55 | buffer=tempBuffer; 56 | } 57 | else 58 | { 59 | good=false; 60 | } 61 | return good; 62 | } 63 | 64 | bool CCCC_Item::Insert(int n) 65 | { 66 | char numbuf[64]; 67 | sprintf(numbuf,"%d",n); 68 | return Insert(numbuf); 69 | } 70 | 71 | bool CCCC_Item::Extract(int& n) 72 | { 73 | string numstr; 74 | bool retval=Extract(numstr); 75 | n=atoi(numstr.c_str()); 76 | return retval; 77 | } 78 | 79 | bool CCCC_Item::Insert(char c) 80 | { 81 | char charbuf[2]; 82 | sprintf(charbuf,"%c",c); 83 | return Insert(charbuf); 84 | } 85 | 86 | bool CCCC_Item::Extract(char& c) 87 | { 88 | string charstr; 89 | bool retval=Extract(charstr); 90 | if(charstr.size()==1) 91 | { 92 | c=charstr[0]; 93 | } 94 | return retval; 95 | } 96 | 97 | bool CCCC_Item::Insert(float f) 98 | { 99 | char numbuf[64]; 100 | sprintf(numbuf,"%f",f); 101 | return Insert(numbuf); 102 | } 103 | 104 | bool CCCC_Item::Extract(float& f) 105 | { 106 | string numstr; 107 | bool retval=Extract(numstr); 108 | f=atof(numstr.c_str()); 109 | return retval; 110 | } 111 | 112 | bool CCCC_Item::ToFile(ofstream& ofstr) 113 | { 114 | ofstr << buffer << endl; 115 | good=ofstr.good(); 116 | return good; 117 | } 118 | 119 | bool CCCC_Item::FromFile(ifstream& ifstr) 120 | { 121 | good=false; 122 | char line_buffer[1024]; 123 | ifstr.getline(line_buffer,1023); 124 | buffer=line_buffer; 125 | if(ifstr.good() && buffer.size()>0 && buffer.size()<1023) 126 | { 127 | delimiter=buffer[buffer.size()-1]; 128 | good=true; 129 | #if 0 130 | cerr << "Delimiter is " << delimiter << endl; 131 | #endif 132 | } 133 | return good; 134 | } 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /cccc/cccc_itm.h: -------------------------------------------------------------------------------- 1 | // cccc_itm.h 2 | #ifndef __CCCC_ITM_H 3 | #define __CCCC_ITM_H 4 | 5 | #include "cccc.h" 6 | 7 | // Class CCCC_Item is a wrapper for a C++ standard string which allows 8 | // insertion and extraction of fields using a standard delimiter. 9 | // It is intended for use in the following contexts: 10 | // 1. for transmission of extent information from the parser to the database 11 | // 2. for transmission of option information from the main line to the database 12 | // 3. for storage from the database to a flat file 13 | // 4. for reloading from a flat file to the database. 14 | 15 | class CCCC_Item 16 | { 17 | private: 18 | char delimiter; 19 | string buffer; 20 | bool good; 21 | 22 | public: 23 | CCCC_Item(const string& s, char c); 24 | CCCC_Item(const string& s); 25 | CCCC_Item(); 26 | 27 | bool Insert(const string& s); 28 | bool Insert(const char* cptr); 29 | bool Extract(string& s); 30 | bool Insert(int n); 31 | bool Extract(int& n); 32 | bool Insert(char c); 33 | bool Extract(char& c); 34 | bool Insert(float f); 35 | bool Extract(float& f); 36 | 37 | bool ToFile(ofstream& ofstr); 38 | bool FromFile(ifstream& ifstr); 39 | }; 40 | 41 | #endif 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /cccc/cccc_mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_mem.h 21 | */ 22 | #ifndef CCCC_MEM_H 23 | #define CCCC_MEM_H 24 | 25 | #include "cccc_rec.h" 26 | 27 | static const string MEMBER_PREFIX="CCCC_Member"; 28 | static const string MEMEXT_PREFIX="CCCC_MemExt"; 29 | 30 | enum MemberNameLevel { nlMEMBER_NAME=-1, nlMEMBER_TYPE=-2, nlMEMBER_PARAMS=-3 }; 31 | 32 | class CCCC_Module; 33 | 34 | class CCCC_Member : public CCCC_Record 35 | { 36 | friend class CCCC_Project; 37 | friend class CCCC_Module; 38 | string member_type, member_name, param_list; 39 | Visibility visibility; 40 | CCCC_Module *parent; 41 | CCCC_Member(); 42 | public: 43 | string name( int index ) const; 44 | CCCC_Member(CCCC_Item& member_data_line, CCCC_Module* parent_ptr=NULL); 45 | int FromFile(ifstream& infile); 46 | int ToFile(ofstream& outfile); 47 | void generate_report(ostream&); 48 | int get_count(const char *count_tag); 49 | Visibility get_visibility(); 50 | }; 51 | 52 | #endif // CCCC_MEM_H 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /cccc/cccc_mod.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_mod.h 21 | */ 22 | #ifndef CCCC_MOD_H 23 | #define CCCC_MOD_H 24 | 25 | #include "cccc.h" 26 | 27 | #include "cccc_rec.h" 28 | 29 | class CCCC_Item; 30 | class CCCC_Project; 31 | class CCCC_UseRelationship; 32 | class CCCC_Member; 33 | 34 | 35 | static const string MODULE_PREFIX="CCCC_Module"; 36 | static const string MODEXT_PREFIX="CCCC_ModExt"; 37 | 38 | 39 | enum ModuleNameLevel 40 | { nlMODULE_TYPE=-1, nlMODULE_NAME=-2, nlMODULE_TYPE_AND_NAME=-3 }; 41 | 42 | class CCCC_Module : public CCCC_Record 43 | { 44 | friend class CCCC_Project; 45 | friend class CCCC_Html_Stream; 46 | friend class CCCC_Xml_Stream; 47 | CCCC_Project *project; 48 | string module_name, module_type; 49 | 50 | typedef std::map member_map_t; 51 | member_map_t member_map; 52 | 53 | typedef std::map relationship_map_t; 54 | relationship_map_t client_map; 55 | relationship_map_t supplier_map; 56 | 57 | CCCC_Module(); 58 | 59 | public: 60 | 61 | string name(int name_level) const; 62 | 63 | int FromFile(ifstream& infile); 64 | int ToFile(ofstream& outfile); 65 | 66 | virtual int get_count(const char *count_tag); 67 | int is_trivial(); 68 | }; 69 | 70 | #endif // CCCC_MOD_H 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /cccc/cccc_new.cc: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | // cccc_new.cc 20 | 21 | // we are having some problems with heap corruption, so I am making sure that 22 | // all class news and deletes are done by the malloc subsystem, and adding 23 | // logging and deletion suppression 24 | 25 | #include "cccc.h" 26 | 27 | #include 28 | #include 29 | #ifdef CCCC_CONF_W32VC 30 | #include 31 | #else 32 | #ifdef CCCC_CONF_W32BC 33 | #include 34 | #else 35 | #include 36 | #endif 37 | #endif 38 | 39 | #define USE_SYSTEM_NEW 40 | #ifndef USE_SYSTEM_NEW 41 | extern int dont_free; 42 | 43 | ofstream str("cccc_new.log"); 44 | 45 | void * 46 | operator new(size_t n) 47 | { 48 | void *retval=malloc(n); 49 | memset(retval,0xFA,n); 50 | str << hex << retval << "@" << time(NULL) << "+" << n << endl; 51 | return retval; 52 | } 53 | 54 | void * 55 | operator new[](size_t n) 56 | { 57 | void *retval=malloc(n); 58 | memset(retval,0xFB,n); 59 | str << hex << retval << "@" << time(NULL) << "*" << n << endl; 60 | return retval; 61 | } 62 | 63 | void 64 | operator delete(void * cp) 65 | { 66 | str << hex << cp << "@" << time(NULL) << "-" << endl; 67 | memset(cp,0xFC,1); 68 | if(dont_free==0) 69 | { 70 | free(cp); 71 | } 72 | } 73 | 74 | void 75 | operator delete[](void * cp) 76 | { 77 | str << hex << cp << "@" << time(NULL) << "/" << endl; 78 | memset(cp,0xFD,1); 79 | if(dont_free==0) 80 | { 81 | free(cp); 82 | } 83 | } 84 | 85 | 86 | #endif 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /cccc/cccc_opt.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | // cccc_opt.h 20 | #ifndef _CCCC_OPT_H 21 | #define _CCCC_OPT_H 22 | 23 | // This file defines the object which holds the major configuration 24 | // options for the CCCC program including: 25 | // - the default language associated with each file name extension; 26 | // - the treatment of specific values of each metric; and 27 | // - the application of dialect specific parsing rule (e.g. rule to 28 | // ignore MSVC++-specific pseudo-keywords when parsing the 29 | // MS C++ dialect. 30 | 31 | // This is a natural singleton class, hence all member functions are static 32 | // and all data will be declared with static file scope in the implementation 33 | // file. 34 | 35 | #include "cccc.h" 36 | #include "cccc_itm.h" 37 | 38 | class Metric_Treatment; 39 | 40 | class CCCC_Options 41 | { 42 | public: 43 | // initialise using a file 44 | static void Load_Options(const string& filename); 45 | 46 | // initialise using hard-coded defaults 47 | static void Load_Options(); 48 | 49 | // save the current set of options to a file 50 | static void Save_Options(const string& filename); 51 | 52 | // add a new option into the current option set 53 | static void Add_Option(CCCC_Item& option_line); 54 | 55 | // map a filename to a language 56 | static string getFileLanguage(const string& filename); 57 | 58 | // map a metric name to a Metric_Treatment object 59 | static Metric_Treatment *getMetricTreatment(const string& metric_tag); 60 | 61 | // the following function allows the parser to use special 62 | // handling rules for identifiers in particular situations 63 | // (especially pseudo-keywords like BEGIN_MESSAGE_MAP) 64 | static string dialectKeywordPolicy(const string& lang, const string& kw); 65 | }; 66 | 67 | #endif 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /cccc/cccc_rec.cc: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_rec.cc 21 | */ 22 | 23 | #include "cccc_itm.h" 24 | #include "cccc_rec.h" 25 | #include "cccc_db.h" 26 | 27 | CCCC_Project* CCCC_Record::active_project=NULL; 28 | CCCC_Project* CCCC_Record::get_active_project() { return active_project; } 29 | void CCCC_Record::set_active_project(CCCC_Project* prj) { active_project=prj; } 30 | 31 | void CCCC_Record::merge_flags(string& new_flags) 32 | { 33 | const char *new_flag_array=new_flags.c_str(); 34 | const char *flag_array=flags.c_str(); 35 | unsigned int len=strlen(flag_array); 36 | if(strlen(new_flag_array)==len) 37 | { 38 | char buf[100]; 39 | unsigned int i; 40 | for(i=0; iGetFromItem(is); 67 | CCCC_Extent *inserted_extent=extent_table.find_or_insert(new_extent); 68 | if(new_extent != inserted_extent) 69 | { 70 | delete new_extent; 71 | } 72 | } 73 | 74 | 75 | string CCCC_Record::name(int /* level */) const { return ""; } 76 | string CCCC_Record::key() const { return name(nlRANK); } 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /cccc/cccc_rec.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_rec.h 21 | * 22 | * defines the database used by CCCC to generate a report 23 | */ 24 | #ifndef CCCC_REC_H 25 | #define CCCC_REC_H 26 | 27 | #include "cccc_tbl.h" 28 | #include "cccc_ext.h" 29 | #include "cccc_utl.h" 30 | 31 | // The entities held within the database need to be able to return a variety 32 | // of kinds of name including a simple name (typically one word), a fully 33 | // qualified local name (i.e as used within a class), and a fully 34 | // qualified global name. 35 | // Subclasses may also have particular other names, which should be defined 36 | // using negative indexes. 37 | enum NameLevel { nlRANK, nlSEARCH, nlSIMPLE, nlLOCAL, nlGLOBAL }; 38 | class CCCC_Record 39 | { 40 | friend class CCCC_Html_Stream; 41 | friend class CCCC_Xml_Stream; 42 | static CCCC_Project *active_project; 43 | protected: 44 | typedef CCCC_Table Extent_Table; 45 | Extent_Table extent_table; 46 | string flags; 47 | virtual void merge_flags(string& new_flags); 48 | public: 49 | virtual ~CCCC_Record() {} 50 | virtual string name(int level) const; 51 | virtual string key() const; 52 | AugmentedBool get_flag(PSFlag psf) { return (AugmentedBool) flags[psf]; } 53 | 54 | virtual void add_extent(CCCC_Item&); 55 | virtual void sort() { extent_table.sort(); } 56 | virtual int get_count(const char *count_tag)=0; 57 | friend int rank_by_string(const void *p1, const void *p2); 58 | static CCCC_Project* get_active_project(); 59 | static void set_active_project(CCCC_Project* prj); 60 | }; 61 | 62 | 63 | 64 | #endif // CCCC_REC_H 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /cccc/cccc_tbl.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_tbl.h 21 | * 22 | * defines the database used by CCCC to generate a report 23 | */ 24 | #ifndef CCCC_TBL_H 25 | #define CCCC_TBL_H 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | using std::string; 33 | 34 | // CCCC_Table started its life as an array of pointers to CCCC_Records. 35 | // It will ultimately become identical to a std::map from string to T*. 36 | // In the mean time we are supporting a legacy API. 37 | template class CCCC_Table 38 | : public std::map 39 | { 40 | typedef std::map map_t; 41 | typename map_t::iterator iter_; 42 | bool sorted; 43 | 44 | public: 45 | CCCC_Table(); 46 | virtual ~CCCC_Table(); 47 | int records(); 48 | T* find(string name); 49 | T* find_or_insert(T* new_item_ptr); 50 | bool remove(T* old_item_ptr); 51 | void reset_iterator(); 52 | T* first_item(); 53 | T* next_item(); 54 | virtual int get_count(const char *count_tag); 55 | void sort(); 56 | }; 57 | 58 | #include "cccc_tbl.cc" 59 | 60 | #endif // CCCC_DB_H 61 | 62 | -------------------------------------------------------------------------------- /cccc/cccc_tok.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_tok.h 21 | * definition of the token class interface for the cccc project 22 | * 23 | */ 24 | 25 | #ifndef __CCCC_TOK_H 26 | #define __CCCC_TOK_H 27 | 28 | #include "cccc.h" 29 | 30 | // before we go into the token header file, the compiler must have seen 31 | // a definition for enum ANTLRTokenType 32 | // there are three conflicting 'real' definitions, one in use by each parser 33 | // if we have seen one of these, we do not need to worry, otherwise we 34 | // must create a dummy one 35 | // the three definitions are in the files Ctokens.h Jtokens.h and Atokens.h 36 | #if !defined(Ctokens_h) && !defined(Jtokens_h) && !defined(Atokens_h) 37 | enum ANTLRTokenType { DUMMY,DEFINITION }; 38 | #endif 39 | 40 | #include "AToken.h" 41 | #include "cccc.h" 42 | 43 | 44 | /* 45 | ** the class definition for ANTLRToken 46 | ** Note that the name ANTLRToken is required to be either a class or a typedef 47 | ** by the PCCTS support code 48 | */ 49 | class ANTLRToken : public ANTLRCommonToken { 50 | 51 | // Lexical counting is done by attaching running counts of each of the 52 | // interesting features to every token produced by the lexer 53 | // the parser calculates the counts for a particular region by taking 54 | // taking the differences of the counts for the first and last tokens 55 | // in the region's extent. 56 | 57 | // nesting levels are used to control resynchronisation 58 | static int RunningNesting; 59 | 60 | static int numAllocated; 61 | int CurrentNesting; 62 | friend ostream& operator << (ostream&,ANTLRToken&); 63 | friend class DLGLexer; 64 | public: 65 | static int bCodeLine; 66 | 67 | ANTLRToken(ANTLRTokenType t, ANTLRChar *s); 68 | ANTLRToken(ANTLRToken& copyTok); 69 | ANTLRToken(); 70 | ANTLRToken& operator=(ANTLRToken& copyTok); 71 | 72 | virtual ~ANTLRToken(); 73 | 74 | virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt, 75 | ANTLRChar *txt, 76 | int line); 77 | 78 | static void IncrementNesting() { RunningNesting++; } 79 | static void DecrementNesting() { RunningNesting--; } 80 | 81 | int getNestingLevel() { return CurrentNesting; } 82 | void CountToken(); 83 | char *getTokenTypeName(); 84 | }; 85 | 86 | #define MY_TOK(t) ((ANTLRToken*)(t)) 87 | ostream& operator << (ostream&, ANTLRToken&); 88 | 89 | extern ANTLRToken currentLexerToken; 90 | 91 | 92 | #endif 93 | 94 | 95 | -------------------------------------------------------------------------------- /cccc/cccc_tpl.cc: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | // cccc_tpl.cc 20 | 21 | // all explicit template instantiations for the project are collected here 22 | 23 | // the assumption is that this file will be stable, so the expensive 24 | // recompilation of the templates will be infrequent 25 | 26 | #include "cccc_itm.h" 27 | #include "cccc_tbl.h" 28 | #include "cccc_db.h" 29 | #include "cccc_htm.h" 30 | #include "cccc_met.h" 31 | 32 | #include "cccc_tbl.cc" 33 | 34 | template class std::map; 35 | template class CCCC_Table; 36 | template class CCCC_Table; 37 | template class CCCC_Table; 38 | template class CCCC_Table; 39 | -------------------------------------------------------------------------------- /cccc/cccc_use.h: -------------------------------------------------------------------------------- 1 | /* 2 | CCCC - C and C++ Code Counter 3 | Copyright (C) 1994-2005 Tim Littlefair (tim_littlefair@hotmail.com) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | /* 20 | * cccc_use.h 21 | */ 22 | #ifndef CCCC_USE_H 23 | #define CCCC_USE_H 24 | 25 | #include "cccc_rec.h" 26 | 27 | class CCCC_Module; 28 | 29 | static const string USEREL_PREFIX="CCCC_UseRel"; 30 | static const string USEEXT_PREFIX="CCCC_UseExt"; 31 | 32 | enum UserelNameLevel { nlSUPPLIER=-1, nlCLIENT=-2, nlMEMBER=-3 }; 33 | 34 | class CCCC_UseRelationship : public CCCC_Record 35 | { 36 | friend class CCCC_Project; 37 | string supplier, client, member; 38 | UseType ut; 39 | AugmentedBool visible, concrete; 40 | CCCC_UseRelationship() { ut=utDONTKNOW; } 41 | 42 | public: 43 | string name( int index ) const; 44 | CCCC_UseRelationship(CCCC_Item& is); 45 | int FromFile(ifstream& infile); 46 | int ToFile(ofstream& outfile); 47 | void add_extent(CCCC_Item&); 48 | int get_count(const char *count_tag); 49 | UseType get_usetype() const { return ut; } 50 | AugmentedBool is_visible () const { return visible; } 51 | AugmentedBool is_concrete () const { return concrete; } 52 | void generate_report(ostream& os); 53 | CCCC_Module* supplier_module_ptr(CCCC_Project *prj); 54 | CCCC_Module* client_module_ptr(CCCC_Project *prj); 55 | }; 56 | 57 | 58 | #endif // CCCC_USE_H 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /cccc/cccc_ver.h: -------------------------------------------------------------------------------- 1 | #define CCCC_VERSION_STRING "3.1.5-alert" 2 | -------------------------------------------------------------------------------- /cccc/posixgcc.mak: -------------------------------------------------------------------------------- 1 | # posixgcc.mak 2 | ## GNUMakefile to build the CCCC project on the POSIX compliant 3 | ## platforms using the GNU C Compiler. 4 | ## Tested with: 5 | 6 | ## GCC 2.95.3 on Mandrake Linux v7.2 (reported by Tim Littlefair) 7 | ## EGCS 2.91.66 (aka kgcc) on Mandrake Linux v7.2 (reported by Tim Littlefair) 8 | ## GCC 2.96 on Red Hat 7.2 (reported by Tim Littlefair) 9 | ## GCC 3.2 on Mandrake Linux 9.0 (reported by Tim Littlefair) 10 | 11 | ## The '-static' link argument was removed as a result of problems 12 | ## encountered on GCC 3.2 - as we don't prebuild binaries at present 13 | ## dynamic linking shouldn't be a killer problem. 14 | 15 | ## (More reports welcome) 16 | ## See rules.mak for discussion of the meaning of the make variables 17 | ## which this file defines 18 | 19 | # support for debugging 20 | ifeq "$(DEBUG)" "true" 21 | CFLAGS_DEBUG=-g 22 | LDFLAGS_DEBUG=-g 23 | endif 24 | 25 | PATHSEP=/ 26 | 27 | CCC=g++ 28 | LD=g++ 29 | CFLAGS=-c -I../pccts/h $(CFLAGS_DEBUG) -x c++ 30 | C_OFLAG=-o 31 | LDFLAGS=$(LDFLAGS_DEBUG) 32 | LD_OFLAG=-o 33 | OBJEXT=o 34 | CCCC_EXE=cccc 35 | 36 | COPY=cp 37 | RM=rm 38 | 39 | 40 | include rules.mak 41 | 42 | -------------------------------------------------------------------------------- /cccc/w32bcb.mak: -------------------------------------------------------------------------------- 1 | # w32bcc55.mak 2 | 3 | ## Makefile to build the CCCC project on the Borland C++ Command Line 4 | ## Compiler. 5 | ## (tested with a free copy which was shipped on a magazine CD, May 2001) 6 | ## See rules.mak for discussion of the meaning of the make variables 7 | ## which this file defines 8 | 9 | # support for debugging (note that debug building is on by default) 10 | !IF "$(DEBUG)"=="true" 11 | CFLAGS_DEBUG=-v 12 | LDFLAGS_DEBUG=-v 13 | !ENDIF 14 | 15 | PATHSEP=\\ 16 | CCC=bcc32.exe 17 | LD=bcc32.exe -L"$(BCDIR)\lib" 18 | CFLAGS= -c -P -D_NO_VCL -DCCCC_CONF_W32BC-I$(PCCTS_H) 19 | CFLAGS+= -w-aus -w-par -w-hid -w-inl 20 | CFLAGS+= -I"$(BCDIR)\include" -tWC $(CFLAGS_DEBUG) 21 | C_OFLAG=-o 22 | LDFLAGS=$(LDFLAGS_DEBUG) -ap -v 23 | LD_OFLAG=-o 24 | OBJEXT=obj 25 | CCCC_EXE=cccc.exe 26 | 27 | COPY=copy 28 | RM=del 29 | 30 | !INCLUDE rules.mak 31 | 32 | -------------------------------------------------------------------------------- /cccc/w32bcc.mak: -------------------------------------------------------------------------------- 1 | # w32bcc55.mak 2 | 3 | ## Makefile to build the CCCC project on the Borland C++ Command Line 4 | ## Compiler. 5 | ## (tested with a free copy which was shipped on a magazine CD, May 2001) 6 | ## See rules.mak for discussion of the meaning of the make variables 7 | ## which this file defines 8 | 9 | # support for debugging (note that debug building is on by default) 10 | !IF "$(DEBUG)"=="true" 11 | # It would be nice to turn the CodeGuard feature on but this 12 | # appears to depend on a library called CG32.lib which doesn't 13 | # appear to be present in my free command line version. 14 | CFLAGS_DEBUG=-v 15 | LDFLAGS_DEBUG=-v 16 | !ENDIF 17 | 18 | PATHSEP=\\ 19 | CCC=bcc32.exe 20 | #LD=ilink32.exe -L"$(BCDIR)\lib" C0D32.OBJ CW32.LIB IMPORT32.LIB 21 | LD=bcc32.exe -v -L"$(BCDIR)\lib" 22 | CFLAGS= \ 23 | $(CFLAGS_DEBUG) -c -P -D_NO_VCL -DCCCC_CONF_W32BC -I$(PCCTS_H) \ 24 | -w-aus -w-par -w-hid -w-inl \ 25 | -I"$(BCDIR)\include" -tWC 26 | C_OFLAG=-o 27 | LDFLAGS=$(LDFLAGS_DEBUG) 28 | LD_OFLAG=-o 29 | OBJEXT=obj 30 | CCCC_EXE=cccc.exe 31 | 32 | COPY=copy 33 | RM=del 34 | 35 | !INCLUDE rules.mak 36 | 37 | -------------------------------------------------------------------------------- /cccc/w32bcc55.mak: -------------------------------------------------------------------------------- 1 | # w32bcc55.mak 2 | 3 | ## Makefile to build the CCCC project on the Borland C++ Command Line 4 | ## Compiler. 5 | ## (tested with a free copy which was shipped on a magazine CD, May 2001) 6 | ## See rules.mak for discussion of the meaning of the make variables 7 | ## which this file defines 8 | 9 | # support for debugging (note that debug building is on by default) 10 | !IF "$(DEBUG)"=="true" 11 | CFLAGS_DEBUG=-v -y 12 | LDFLAGS_DEBUG=-v 13 | !ENDIF 14 | 15 | PATHSEP=\\ 16 | CCC=bcc32.exe -v 17 | #LD=ilink32.exe -L"$(BCDIR)\lib" C0D32.OBJ CW32.LIB IMPORT32.LIB 18 | LD=bcc32.exe -v -L"$(BCDIR)\lib" 19 | CFLAGS= \ 20 | -c -P -D_NO_VCL -DCCCC_CONF_W32BC -I$(PCCTS_H) \ 21 | -w-aus -w-par -w-hid -w-inl \ 22 | -I"$(BCDIR)\include" -tWC $(CFLAGS_DEBUG) 23 | C_OFLAG=-o 24 | LDFLAGS=$(LDFLAGS_DEBUG) 25 | LD_OFLAG=-o 26 | OBJEXT=obj 27 | CCCC_EXE=cccc.exe 28 | 29 | COPY=copy 30 | RM=del 31 | 32 | !INCLUDE rules.mak 33 | 34 | -------------------------------------------------------------------------------- /cccc/w32cygnus.mak: -------------------------------------------------------------------------------- 1 | # w32cygnus_nmake.mak 2 | 3 | ## NMakefile to build the CCCC project on the Win32/CygWinB20 platform. 4 | ## See rules.mak for discussion of the meaning of the make variables 5 | ## which this file defines 6 | 7 | # support for debugging (note that debug building is on by default) 8 | !IF "$(DEBUG)"=="true" 9 | CFLAGS_DEBUG=-g 10 | LDFLAGS_DEBUG=-g 11 | !ENDIF 12 | 13 | PATHSEP=\\ 14 | CCC=cl.exe -nologo 15 | LD=cl.exe -nologo 16 | CFLAGS=-c -I$(PCCTS_H) $(CFLAGS_DEBUG) -GX -TP -DCCCC_CONF_W32VC 17 | C_OFLAG=-Fo 18 | LDFLAGS=$(LDFLAGS_DEBUG) 19 | LD_OFLAG=-Fe 20 | OBJEXT=obj 21 | CCCC_EXE=cccc.exe 22 | 23 | COPY=copy 24 | RM=del 25 | 26 | 27 | !INCLUDE rules.mak 28 | 29 | -------------------------------------------------------------------------------- /cccc/w32cygnus_gmake.mak: -------------------------------------------------------------------------------- 1 | # w32cygnus_gmake.mak 2 | ## GNUMakefile to build the CCCC project on the Win32/CygWinB20 platform. 3 | ## See rules.mak for discussion of the meaning of the make variables 4 | ## which this file defines 5 | # support for debugging 6 | 7 | #if "$(DEBUG)"=="true" 8 | #CFLAGS_DEBUG=-g 9 | #LDFLAGS_DEBUG=-g 10 | #endif 11 | 12 | PATHSEP=/ 13 | CYGWIN=/cygnus/cygwin-b20/H-i586-cygwin32 14 | EGCS=$(CYGWIN)/lib/gcc-lib/i586-cygwin32/egcs-2.91.57 15 | PATH=$(CYGWIN)/bin;$(EGCS) 16 | export PATH 17 | 18 | CCC=/usr/bin/g++ 19 | LD=/usr/bin/g++ 20 | CFLAGS=-c -I../pccts/h -I$(CYGWIN)/../include/g++ -I$(CYGWIN)/i586-cygwin32/include -I$(EGCS)/include $(CFLAGS_DEBUG) -x c++ -DCCCC_CONF_W32VC 21 | C_OFLAG=-o 22 | LDFLAGS=-L$(EGCS)/../lib $(LDFLAGS_DEBUG) 23 | LD_OFLAG=-o 24 | OBJEXT=o 25 | CCCC_EXE=cccc.exe 26 | 27 | COPY=copy 28 | RM=del 29 | 30 | 31 | include rules.mak 32 | 33 | -------------------------------------------------------------------------------- /cccc/w32cygnus_nmake.mak: -------------------------------------------------------------------------------- 1 | # w32cygnus_nmake.mak 2 | 3 | ## NMakefile to build the CCCC project on the Win32/CygWinB20 platform. 4 | ## See rules.mak for discussion of the meaning of the make variables 5 | ## which this file defines 6 | 7 | # support for debugging (note that debug building is on by default) 8 | !IF "$(DEBUG)"=="true" 9 | CFLAGS_DEBUG=-g 10 | LDFLAGS_DEBUG=-g 11 | !ENDIF 12 | 13 | PATHSEP=\\ 14 | PATH=\cygwin\bin 15 | CCC=$(PATH)\gcc.exe 16 | LD=$(PATH)\gcc.exe 17 | CFLAGS=-c -I$(PCCTS_H) $(CFLAGS_DEBUG) -x c++ -DCCCC_CONF_W32VC 18 | C_OFLAG=-o 19 | LDFLAGS=$(LDFLAGS_DEBUG) 20 | LD_OFLAG=-o 21 | OBJEXT=o 22 | CCCC_EXE=cccc.exe 23 | 24 | COPY=copy 25 | RM=del 26 | 27 | 28 | !INCLUDE rules.mak 29 | 30 | -------------------------------------------------------------------------------- /cccc/w32vc.mak: -------------------------------------------------------------------------------- 1 | # w32vc.mak 2 | 3 | ## Makefile to build the CCCC project on the Win32/Visual Studio platform. 4 | ## See rules.mak for discussion of the meaning of the make variables 5 | ## which this file defines 6 | 7 | 8 | # support for debugging (note that debug building is on by default) 9 | !IF "$(DEBUG)"=="true" 10 | CFLAGS_DEBUG=-Zi 11 | LDFLAGS_DEBUG=-Zi 12 | !ENDIF 13 | 14 | PATHSEP=\\ 15 | CCC=cl.exe -nologo 16 | LD=cl.exe -nologo 17 | CFLAGS=-c -I$(PCCTS_H) $(CFLAGS_DEBUG) -GX -TP -DCCCC_CONF_W32VC 18 | C_OFLAG=-Fo 19 | LDFLAGS=$(LDFLAGS_DEBUG) 20 | LD_OFLAG=-Fe 21 | OBJEXT=obj 22 | CCCC_EXE=cccc.exe 23 | 24 | COPY=copy 25 | RM=del 26 | 27 | !INCLUDE rules.mak 28 | 29 | -------------------------------------------------------------------------------- /ccccdist.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ANTLR"=.\pccts\antlr\AntlrMSVC50.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "CcccDevStudioAddIn"=.\vcaddin\CcccDevStudioAddIn.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "DLG"=.\pccts\dlg\DlgMSVC50.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "cccc"=.\cccc\Cccc.dsp - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | Begin Project Dependency 51 | Project_Dep_Name ANTLR 52 | End Project Dependency 53 | Begin Project Dependency 54 | Project_Dep_Name DLG 55 | End Project Dependency 56 | }}} 57 | 58 | ############################################################################### 59 | 60 | Project: "documentation"=.\documentation.dsp - Package Owner=<4> 61 | 62 | Package=<5> 63 | {{{ 64 | }}} 65 | 66 | Package=<4> 67 | {{{ 68 | }}} 69 | 70 | ############################################################################### 71 | 72 | Project: "install"=.\install\install.dsp - Package Owner=<4> 73 | 74 | Package=<5> 75 | {{{ 76 | }}} 77 | 78 | Package=<4> 79 | {{{ 80 | Begin Project Dependency 81 | Project_Dep_Name CcccDevStudioAddIn 82 | End Project Dependency 83 | Begin Project Dependency 84 | Project_Dep_Name test 85 | End Project Dependency 86 | }}} 87 | 88 | ############################################################################### 89 | 90 | Project: "test"=.\test\test.dsp - Package Owner=<4> 91 | 92 | Package=<5> 93 | {{{ 94 | }}} 95 | 96 | Package=<4> 97 | {{{ 98 | Begin Project Dependency 99 | Project_Dep_Name cccc 100 | End Project Dependency 101 | }}} 102 | 103 | ############################################################################### 104 | 105 | Global: 106 | 107 | Package=<5> 108 | {{{ 109 | }}} 110 | 111 | Package=<3> 112 | {{{ 113 | }}} 114 | 115 | ############################################################################### 116 | 117 | -------------------------------------------------------------------------------- /debian/cccc.1: -------------------------------------------------------------------------------- 1 | .TH CCCC 1 2 | .SH NAME 3 | cccc \- C and C++ Code Counter, a software metrics tool 4 | .SH SYNOPSIS 5 | .B cccc 6 | .RB [ options ] 7 | .I file1.c 8 | \&... 9 | .SH DESCRIPTION 10 | CCCC analyses and reports measurements of source code in C, C++, and Java. 11 | It was developed to augment programmers' instinctive application of numeric 12 | rules of thumb about what constitutes high or low quality products with an 13 | automated analysis tool. 14 | .PP 15 | CCCC processes the files listed on its command line. 16 | If the filenames include \(oq-\(cq, read a list of files from standard input. 17 | .PP 18 | This program is work in progress and is not well documented. 19 | Please be prepared to refer to the source code for the 20 | meaning of some options. 21 | .SH OPTIONS 22 | .TP 23 | .B \-\-help 24 | Generate this help message. 25 | .TP 26 | \fB\-\-outdir\fP=\fIdname\fP 27 | Directory for generated files (default=.cccc). 28 | .TP 29 | \fB\-\-html_outfile\fP=\fIfname\fP 30 | Name of primary HTML report generated (default=\fIoutdir\fP/cccc.html). 31 | .TP 32 | \fB\-\-db_infile\fP=\fIfname\fP 33 | Preload internal database from named file (default=no initial content). 34 | .TP 35 | \fB\-\-db_outfile\fP=\fIfname\fP 36 | Save internal database to named file (default=\fIoutdir\fP/cccc.db). 37 | .TP 38 | \fB\-\-opt_infile\fP=\fIfname\fP 39 | Load options from named file (default=use compiled-in option values, 40 | refer to cccc_opt.cc for option information). 41 | .TP 42 | \fB\-\-opt_outfile\fP=\fIfname\fP 43 | Save options to named file (default=\fIoutdir\fP/cccc.opt). 44 | .TP 45 | \fB\-\-lang\fP=\fIstring\fP 46 | Use language specified for files specified after this option. 47 | Languages supported are c, c++, ada, and java (default=use language/extension 48 | mapping controlled by options). 49 | .TP 50 | \fB\-\-report_mask\fP=\fIhex\fP 51 | Control report content (refer to ccccmain.cc for mask values). 52 | .TP 53 | \fB\-\-debug_mask\fP=\fIhex\fP 54 | Control debug output content (refer to ccccmain.cc for mask values). 55 | .SH AUTHOR 56 | CCCC was written by Tim Littlefair . 57 | .PP 58 | This manual page was written by Colin Watson 59 | for the Debian system (but may be used by others). 60 | -------------------------------------------------------------------------------- /debian/clean: -------------------------------------------------------------------------------- 1 | test/*.db 2 | test/*.html 3 | test/*.xml 4 | test/.cccc/cccc.opt 5 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: cccc-alert 2 | Section: devel 3 | Priority: optional 4 | Maintainer: Roberto Andradas Izquierdo 5 | Standards-Version: 3.5.6 6 | Build-Depends: dpkg-dev (>= 1.15.7~), debhelper (>= 7.0.50~), pccts 7 | Homepage: http://github.com/AlertProject/CCCC 8 | 9 | Package: cccc-alert 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Conflicts: cccc 13 | Description: C and C++ Code Counter, a software metrics tool 14 | CCCC analyses and reports measurements of source code in C, C++, and Java. 15 | It was developed to augment programmers' instinctive application of numeric 16 | rules of thumb about what constitutes high or low quality products with an 17 | automated analysis tool. 18 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: CCCC-Alert 3 | Upstream-Contact: Santiago Dueñas 4 | Source: http://github.com/AlertProject/CCCC 5 | 6 | Files: * 7 | Copyright: 1994-2013, Tim Littlefair 8 | 2012-2013, Santiago Dueñas 9 | License: GPL-2+ 10 | 11 | Files: debian/* 12 | Copyright: 2002-2013, Colin Watson 13 | 2013, Roberto Andradas 14 | License: GPL-2+ 15 | 16 | License: GPL-2+ 17 | This program is free software; you can redistribute it and/or modify 18 | it under the terms of the GNU General Public License as published by 19 | the Free Software Foundation; either version 2 of the License, or 20 | (at your option) any later version. 21 | . 22 | This program is distributed in the hope that it will be useful, 23 | but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | GNU General Public License for more details. 26 | . 27 | You should have received a copy of the GNU General Public License 28 | along with this program; if not, write to the Free Software 29 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 30 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | cccc/cccc usr/bin 2 | -------------------------------------------------------------------------------- /debian/lintian-overrides: -------------------------------------------------------------------------------- 1 | cccc: copyright-should-refer-to-common-license-file-for-gpl 2 | -------------------------------------------------------------------------------- /debian/manpages: -------------------------------------------------------------------------------- 1 | debian/cccc.1 2 | -------------------------------------------------------------------------------- /debian/patches/better-clean.patch: -------------------------------------------------------------------------------- 1 | Description: Improve 'make clean' 2 | Author: Colin Watson 3 | Forwarded: no 4 | Last-Update: 2010-03-02 5 | 6 | Index: b/cccc/rules.mak 7 | =================================================================== 8 | --- a/cccc/rules.mak 9 | +++ b/cccc/rules.mak 10 | @@ -208,4 +208,5 @@ 11 | -$(RM) *.cpp 12 | -$(RM) *.$(OBJEXT) 13 | -$(RM) $(CCCC_EXE) 14 | + -$(RM) $(CCCC_SPAWN) $(JAVA_SPAWN) $(ADA_SPAWN) parser.dlg 15 | 16 | -------------------------------------------------------------------------------- /debian/patches/no-dependent-base-lookup.patch: -------------------------------------------------------------------------------- 1 | Description: Avoid dependent base class scope lookups 2 | These no longer work in G++ 4.7: http://gcc.gnu.org/gcc-4.7/porting_to.html 3 | Author: Colin Watson 4 | Bug-Debian: http://bugs.debian.org/667133 5 | Forwarded: no 6 | Last-Update: 2012-04-04 7 | 8 | Index: b/cccc/cccc_tbl.cc 9 | =================================================================== 10 | --- a/cccc/cccc_tbl.cc 11 | +++ b/cccc/cccc_tbl.cc 12 | @@ -96,7 +96,7 @@ 13 | typename map_t::iterator value_iterator=map_t::find(old_item_ptr->key()); 14 | if(value_iterator!=map_t::end()) 15 | { 16 | - erase(value_iterator); 17 | + this->erase(value_iterator); 18 | retval=true; 19 | } 20 | return retval; 21 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | better-clean.patch 2 | tests-unified-diff.patch 3 | no-dependent-base-lookup.patch 4 | -------------------------------------------------------------------------------- /debian/patches/tests-unified-diff.patch: -------------------------------------------------------------------------------- 1 | Description: Use 'diff -u' in tests to get more context 2 | Author: Colin Watson 3 | Forwarded: no 4 | Last-Update: 2010-03-02 5 | 6 | Index: b/test/posix.mak 7 | =================================================================== 8 | --- a/test/posix.mak 9 | +++ b/test/posix.mak 10 | @@ -5,7 +5,7 @@ 11 | RMDIR=rm -rf 12 | MV=mv 13 | ECHO=echo 14 | -DIFF=diff 15 | +DIFF=diff -u 16 | PATHSEP=/ 17 | CCCC=../cccc/cccc 18 | 19 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #! /usr/bin/make -f 2 | %: 3 | dh $@ 4 | 5 | DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 6 | DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 7 | 8 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) 9 | CROSS := 10 | else 11 | CROSS := CCC=$(DEB_HOST_GNU_TYPE)-g++ LD=$(DEB_HOST_GNU_TYPE)-g++ 12 | endif 13 | 14 | # We have to duplicate a little from the upstream build system. See 15 | # cccc/posixgcc.mak. 16 | CFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) 17 | CFLAGS += $(shell dpkg-buildflags --get CFLAGS) 18 | CFLAGS += -c -I/usr/include/pccts -Wno-deprecated -Wall -x c++ 19 | LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) 20 | buildflags := CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" 21 | 22 | override_dh_auto_build: 23 | $(MAKE) -C cccc -f posixgcc.mak $(buildflags) \ 24 | PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS) 25 | 26 | override_dh_auto_test: 27 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) 28 | $(MAKE) -C test -f posix.mak 29 | endif 30 | 31 | override_dh_auto_clean: 32 | $(MAKE) -C cccc -f posixgcc.mak clean 33 | -rmdir test/.cccc 34 | 35 | override_dh_auto_install: 36 | # The default 'make install' uses su! 37 | 38 | override_dh_installdocs: 39 | dh_installdocs 'cccc/CCCC User Guide.html' 40 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /documentation.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="documentation" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) External Target" 0x0106 6 | 7 | CFG=documentation - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "documentation.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "documentation.mak" CFG="documentation - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "documentation - Win32 Release" (based on "Win32 (x86) External Target") 21 | !MESSAGE "documentation - Win32 Debug" (based on "Win32 (x86) External Target") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | 29 | !IF "$(CFG)" == "documentation - Win32 Release" 30 | 31 | # PROP BASE Use_Debug_Libraries 0 32 | # PROP BASE Output_Dir "Release" 33 | # PROP BASE Intermediate_Dir "Release" 34 | # PROP BASE Cmd_Line "NMAKE /f documentation.mak" 35 | # PROP BASE Rebuild_Opt "/a" 36 | # PROP BASE Target_File "documentation.exe" 37 | # PROP BASE Bsc_Name "documentation.bsc" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Cmd_Line "NMAKE /f documentation.mak" 43 | # PROP Rebuild_Opt "/a" 44 | # PROP Target_File "documentation.exe" 45 | # PROP Bsc_Name "documentation.bsc" 46 | # PROP Target_Dir "" 47 | 48 | !ELSEIF "$(CFG)" == "documentation - Win32 Debug" 49 | 50 | # PROP BASE Use_Debug_Libraries 1 51 | # PROP BASE Output_Dir "Debug" 52 | # PROP BASE Intermediate_Dir "Debug" 53 | # PROP BASE Cmd_Line "NMAKE /f documentation.mak" 54 | # PROP BASE Rebuild_Opt "/a" 55 | # PROP BASE Target_File "documentation.exe" 56 | # PROP BASE Bsc_Name "documentation.bsc" 57 | # PROP BASE Target_Dir "" 58 | # PROP Use_Debug_Libraries 1 59 | # PROP Output_Dir "Debug" 60 | # PROP Intermediate_Dir "Debug" 61 | # PROP Cmd_Line "NMAKE /f documentation.mak" 62 | # PROP Rebuild_Opt "/a" 63 | # PROP Target_File "documentation.exe" 64 | # PROP Bsc_Name "documentation.bsc" 65 | # PROP Target_Dir "" 66 | 67 | !ENDIF 68 | 69 | # Begin Target 70 | 71 | # Name "documentation - Win32 Release" 72 | # Name "documentation - Win32 Debug" 73 | 74 | !IF "$(CFG)" == "documentation - Win32 Release" 75 | 76 | !ELSEIF "$(CFG)" == "documentation - Win32 Debug" 77 | 78 | !ENDIF 79 | 80 | # Begin Source File 81 | 82 | SOURCE=.\readme.txt 83 | # End Source File 84 | # End Target 85 | # End Project 86 | -------------------------------------------------------------------------------- /install/install.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="install" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) External Target" 0x0106 6 | 7 | CFG=install - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "install.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "install.mak" CFG="install - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "install - Win32 Release" (based on "Win32 (x86) External Target") 21 | !MESSAGE "install - Win32 Debug" (based on "Win32 (x86) External Target") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | 29 | !IF "$(CFG)" == "install - Win32 Release" 30 | 31 | # PROP BASE Use_Debug_Libraries 0 32 | # PROP BASE Output_Dir "Release" 33 | # PROP BASE Intermediate_Dir "Release" 34 | # PROP BASE Cmd_Line "NMAKE /f install.mak" 35 | # PROP BASE Rebuild_Opt "/a" 36 | # PROP BASE Target_File "install.exe" 37 | # PROP BASE Bsc_Name "install.bsc" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Cmd_Line "..\w32bin\gmake -f install.mak CONF=w32vc VARIANT=release" 43 | # PROP Rebuild_Opt "" 44 | # PROP Target_File "install.exe" 45 | # PROP Bsc_Name "" 46 | # PROP Target_Dir "" 47 | 48 | !ELSEIF "$(CFG)" == "install - Win32 Debug" 49 | 50 | # PROP BASE Use_Debug_Libraries 1 51 | # PROP BASE Output_Dir "Debug" 52 | # PROP BASE Intermediate_Dir "Debug" 53 | # PROP BASE Cmd_Line "NMAKE /f install.mak" 54 | # PROP BASE Rebuild_Opt "/a" 55 | # PROP BASE Target_File "install.exe" 56 | # PROP BASE Bsc_Name "install.bsc" 57 | # PROP BASE Target_Dir "" 58 | # PROP Use_Debug_Libraries 1 59 | # PROP Output_Dir "Debug" 60 | # PROP Intermediate_Dir "Debug" 61 | # PROP Cmd_Line "..\w32bin\gmake -f install.mak CONF=w32vc VARIANT=debug" 62 | # PROP Rebuild_Opt "" 63 | # PROP Target_File "install.exe" 64 | # PROP Bsc_Name "" 65 | # PROP Target_Dir "" 66 | 67 | !ENDIF 68 | 69 | # Begin Target 70 | 71 | # Name "install - Win32 Release" 72 | # Name "install - Win32 Debug" 73 | 74 | !IF "$(CFG)" == "install - Win32 Release" 75 | 76 | !ELSEIF "$(CFG)" == "install - Win32 Debug" 77 | 78 | !ENDIF 79 | 80 | # Begin Source File 81 | 82 | SOURCE=.\install.mak 83 | # End Source File 84 | # End Target 85 | # End Project 86 | -------------------------------------------------------------------------------- /install/install.mak: -------------------------------------------------------------------------------- 1 | # makefile to control installation of CCCC 2 | 3 | ifeq "$(CONF)" "w32vc" 4 | CD=cd 5 | CP=../w32bin/cp 6 | RM=../w32bin/rm -f 7 | RMDIR=../w32bin/rm -rf 8 | MV=../w32bin/mv 9 | ECHO=../w32bin/echo 10 | DIFF=../w32bin/diff 11 | MKDIR=../w32bin/mkdir 12 | INSTBIN1=cccc.exe 13 | INSTBIN2=CcccDevStudioAddIn.dll 14 | INSTDIR=C:/Program\ Files/CCCC 15 | else 16 | CD=cd 17 | CP=cp 18 | RM=rm -f 19 | RMDIR=rm -rf 20 | MV=mv 21 | ECHO=echo 22 | DIFF=diff 23 | MKDIR=mkdir 24 | INSTBIN1=cccc 25 | INSTBIN2= 26 | INSTDIR=/usr/local/bin 27 | endif 28 | 29 | # The installation is pretty crude 30 | # we just go to the target directory for the machine 31 | # we are on, delete old versions, copy new versions in 32 | # There are lots of nicer things we could do on either 33 | # platform, but this is the lowest common denominator which 34 | # works consistently on both. 35 | ifeq "$(CONF)" "w32vc" 36 | all : install_cccc install_addin report_success 37 | else 38 | all : install_cccc report_success 39 | endif 40 | 41 | install_cccc : 42 | -$(MKDIR) $(INSTDIR) 43 | -$(RM) $(INSTDIR)/$(INSTBIN1) 44 | $(CP) ../cccc/$(INSTBIN1) $(INSTDIR) 45 | 46 | install_addin : 47 | -$(RM) $(INSTDIR)/$(INSTBIN2) 48 | $(CP) ../vcaddin/$(VARIANT)/$(INSTBIN2) $(INSTDIR) 49 | 50 | # There are potential error messages relating to directories which 51 | # already existed, which will be ignored, because we are being conservative 52 | # and attempting creation unconditionally (so we don't have to ship Win32 53 | # bash and test). 54 | # So we finish the process with a message reassuring the user that all went well 55 | report_success : 56 | @$(ECHO) =========================== 57 | @$(ECHO) Installation succeeded! 58 | @$(ECHO) =========================== 59 | 60 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | # Top level makefile for CCCC 2 | 3 | # This distribution is a compilation of code, some of which comes from 4 | # different sources, some of which builds different (e.g. Win32 DLL) kinds 5 | # of targets. 6 | # I would like to make it less inconsistent, but the first stage is to make 7 | # it work... 8 | 9 | .PHONY : pccts cccc test install 10 | 11 | all : pccts cccc test install 12 | 13 | pccts : 14 | cd pccts ; make 15 | 16 | cccc : 17 | cd cccc ; make -f posixgcc.mak 18 | 19 | test : 20 | cd test ; make -f posix.mak 21 | 22 | install : 23 | cd install ; su root -c "make -f install.mak" 24 | 25 | -------------------------------------------------------------------------------- /pccts/CHANGES_FROM_133.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/CHANGES_FROM_133.txt -------------------------------------------------------------------------------- /pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc: -------------------------------------------------------------------------------- 1 | option ProjectOptions = 2 | define("USER_ZZSYN", ), 3 | define("__USE_PROTOS", ), 4 | incl(searchpath, "..\\h"), 5 | incl(searchpath, "..\\support\\set"), 6 | link(pmtype, vio) 7 | { 8 | target "..\\bin\\antlr.exe" 9 | { 10 | option incl(searchpath, "..\\antlr") { source type("c") 11 | "antlr.c","bits.c","build.c","dumpcycles.c", 12 | "dumpnode.c","egman.c","main.c","err.c", 13 | "fcache.c","fset.c","fset2.c","gen.c", 14 | "globals.c","hash.c","lex.c","main.c", 15 | "misc.c","mrhoist.c","pred.c","scan.c"} 16 | 17 | option incl(searchpath, "..\\support\\set") source type("c") 18 | "set.c" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc: -------------------------------------------------------------------------------- 1 | option ProjectOptions = 2 | define("USER_ZZSYN", ), 3 | define("__USE_PROTOS", ), 4 | incl(searchpath, "..\\h"), 5 | incl(searchpath, "..\\support\\set"), 6 | link(pmtype, vio) 7 | { 8 | target "..\\bin\\dlg.exe" 9 | { 10 | source type("c") 11 | "..\\dlg\\automata.c", 12 | "..\\dlg\\dlg_a.c", 13 | "..\\dlg\\dlg_p.c", 14 | "..\\dlg\\err.c", 15 | "..\\dlg\\main.c", 16 | "..\\dlg\\output.c", 17 | "..\\dlg\\relabel.c", 18 | "..\\dlg\\support.c", 19 | 20 | "..\\support\\set\\set.c" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pccts/IBM_VISUAL_AGE_PROJECTS/sorcerer.icc: -------------------------------------------------------------------------------- 1 | 0ption ProjectOptions = 2 | define("__USE_PROTOS", ), 3 | incl(searchpath, "..\\sorcerer\\h"), 4 | incl(searchpath, "..\\h"), 5 | incl(searchpath, "..\\support\\set"), 6 | link(pmtype, vio) 7 | { 8 | target "..\\bin\\sorcerer.exe" 9 | { 10 | option incl(searchpath, "..\\sorcerer") { 11 | source type("c") 12 | 13 | 'sor.c','scan.c','err.c','main.c','globals.c','gen.c','hash.c','look.c','cpp.c' 14 | } 15 | 16 | option incl(searchpath, "..\\support\\set") { 17 | source type("c") 18 | "set.c" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pccts/MPW_Read_Me: -------------------------------------------------------------------------------- 1 | 2 | 1. You can control the creator type of generated files by changing a value of 3 | #if control statement. 4 | 5 | 6 | pccts:h:pcctscfg.h 7 | 8 | line 225-231 9 | 10 | #if 0 11 | #define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */ 12 | #endif 13 | #if 0 14 | #define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */ 15 | #endif 16 | #if 0 17 | #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */ 18 | #endif 19 | 20 | 2. If you want to build 68K version. You must convert all source files to Macintosh 21 | format before compile. 22 | -------------------------------------------------------------------------------- /pccts/RIGHTS: -------------------------------------------------------------------------------- 1 | 2 | SOFTWARE RIGHTS 3 | 4 | We reserve no LEGAL rights to the Purdue Compiler Construction Tool 5 | Set (PCCTS) -- PCCTS is in the public domain. An individual or 6 | company may do whatever they wish with source code distributed with 7 | PCCTS or the code generated by PCCTS, including the incorporation of 8 | PCCTS, or its output, into commerical software. 9 | 10 | We encourage users to develop software with PCCTS. However, we do ask 11 | that credit is given to us for developing PCCTS. By "credit", we mean 12 | that if you incorporate our source code into one of your programs 13 | (commercial product, research project, or otherwise) that you 14 | acknowledge this fact somewhere in the documentation, research report, 15 | etc... If you like PCCTS and have developed a nice tool with the 16 | output, please mention that you developed it using PCCTS. In 17 | addition, we ask that this header remain intact in our source code. 18 | As long as these guidelines are kept, we expect to continue enhancing 19 | this system and expect to make other tools available as they are 20 | completed. 21 | 22 | ANTLR 1.33 23 | Terence Parr 24 | Parr Research Corporation 25 | with Purdue University and AHPCRC, University of Minnesota 26 | 1989-1995 27 | -------------------------------------------------------------------------------- /pccts/antlr/Antlr.SUP: -------------------------------------------------------------------------------- 1 | //SUPPRESSIONPROJ:Antlr 2 | //VERSION:5.00 3 | //ENABLE:Yes 4 | !include Rtl.sup 5 | ignore bad_address(20,23) in file EXE:"..\h\dlgauto.h" 6 | ignore bad_address(20,20) in file EXE:"..\h\dlgauto.h" 7 | ignore resource_leak(16,0) calloc in file EXE:"D:\pccts_now\pccts\support\set\set.c" 8 | ignore resource_leak(16,0) calloc in function EXE:"DefErrSetForC1" 9 | 10 | -------------------------------------------------------------------------------- /pccts/antlr/AntlrMSVC50.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 5.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ANTLR"=.\AntlrMSVC50.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/antlr/AntlrMSVC60.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "ANTLR"=.\AntlrMSVC60.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/antlr/README: -------------------------------------------------------------------------------- 1 | ANTLR 1.33 2 | 3 | This directory contains the files necessary to build ANTLR. 4 | 5 | If you do a "make scrub", ANTLR will have to run on antlr.g and DLG 6 | will have to run on parser.dlg. Either 7 | 8 | (1) ANTLR uses the previous antlr in that directory to rebuild itself 9 | (2) Needs to find antlr on the search path 10 | 11 | You will find that running "antlr -gh antlr.g" will result in about 12 | 10 ambiguity warnings. These are normal. Don't worry. 13 | 14 | If you do a "make clean" right after installation, ANTLR and DLG should 15 | not need to run; only the C files will compile. 16 | 17 | Don't forget to go into the makefile to uncomment the appropriate 18 | definitions for your OS/architecture/compiler or see the appropriate 19 | NOTES.?? file. 20 | -------------------------------------------------------------------------------- /pccts/antlr/antlr.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/antlr/antlr.r -------------------------------------------------------------------------------- /pccts/antlr/antlr68K.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/antlr/antlr68K.make -------------------------------------------------------------------------------- /pccts/antlr/antlrPPC.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/antlr/antlrPPC.make -------------------------------------------------------------------------------- /pccts/antlr/dumpcycles.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "set.h" 5 | #include "syn.h" 6 | #include "hash.h" 7 | #include "generic.h" 8 | 9 | void 10 | #ifdef __USE_PROTOS 11 | dumpcycles(void) 12 | #else 13 | dumpcycles() 14 | #endif 15 | { 16 | Cycle *c; 17 | CacheEntry *f; 18 | ListNode *p; 19 | int i=0; 20 | int k; 21 | int degree; 22 | 23 | for (k=1; k <= CLL_k; k++) { 24 | if (Cycles[k] == NULL) continue; 25 | 26 | for (p = Cycles[k]->next; p!=NULL; p=p->next) { 27 | c = (Cycle *) p->elem; 28 | degree=set_deg(c->cyclicDep); 29 | fprintf(stderr,"Cycle %d: (degree %d) %s -->\n", i++, degree, RulePtr[c->croot]->rname); 30 | fprintf(stderr," *self*\n"); 31 | MR_dumpRuleSet(c->cyclicDep); 32 | fprintf(stderr,"\n"); 33 | f = (CacheEntry *) 34 | hash_get(Fcache,Fkey(RulePtr[c->croot]->rname,'o',k)); 35 | if (f == NULL) { 36 | fprintf(stderr," *** FOLLOW(%s) must be in cache but isn't ***\n", 37 | RulePtr[c->croot]->rname); 38 | }; 39 | }; 40 | }; 41 | } 42 | 43 | void 44 | #ifdef __USE_PROTOS 45 | dumpfostack(int k) 46 | #else 47 | dumpfostack(k) 48 | int k; 49 | #endif 50 | { 51 | int i=0; 52 | int *pi; 53 | 54 | fprintf(stderr,"\n"); 55 | if (FoStack[k] == NULL) { 56 | fprintf(stderr,"FoStack[%d] is null\n",k); 57 | }; 58 | if (FoTOS[k] == NULL) { 59 | fprintf(stderr,"FoTOS[%d] is null\n",k); 60 | } 61 | if (FoTOS[k] != NULL && FoStack[k] != NULL) { 62 | for (pi=FoStack[k]; pi <= FoTOS[k]; pi++) { 63 | i++; 64 | fprintf(stderr,"#%d rule %d %s\n",i,*pi,RulePtr[*pi]->rname); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pccts/antlr/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hash.h -- define hash table entries, sizes, hash function... 3 | * 4 | * SOFTWARE RIGHTS 5 | * 6 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 7 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 8 | * company may do whatever they wish with source code distributed with 9 | * PCCTS or the code generated by PCCTS, including the incorporation of 10 | * PCCTS, or its output, into commerical software. 11 | * 12 | * We encourage users to develop software with PCCTS. However, we do ask 13 | * that credit is given to us for developing PCCTS. By "credit", 14 | * we mean that if you incorporate our source code into one of your 15 | * programs (commercial product, research project, or otherwise) that you 16 | * acknowledge this fact somewhere in the documentation, research report, 17 | * etc... If you like PCCTS and have developed a nice tool with the 18 | * output, please mention that you developed it using PCCTS. In 19 | * addition, we ask that this header remain intact in our source code. 20 | * As long as these guidelines are kept, we expect to continue enhancing 21 | * this system and expect to make other tools available as they are 22 | * completed. 23 | * 24 | * ANTLR 1.33 25 | * Terence Parr 26 | * Parr Research Corporation 27 | * with Purdue University and AHPCRC, University of Minnesota 28 | * 1989-1998 29 | */ 30 | 31 | /* H a s h T a b l e S t u f f */ 32 | 33 | #ifndef HashTableSize 34 | #define HashTableSize 553 35 | #endif 36 | 37 | #ifndef StrTableSize 38 | #ifdef PC32 39 | #define StrTableSize 1000000 40 | #endif 41 | #endif 42 | 43 | #ifndef StrTableSize 44 | #ifdef PC 45 | #define StrTableSize 655200 46 | #endif 47 | #endif 48 | 49 | #ifndef StrTableSize 50 | #define StrTableSize 1000000 51 | #endif 52 | 53 | typedef struct _entry { /* Minimum hash table entry -- superclass */ 54 | char *str; 55 | struct _entry *next; 56 | } Entry; 57 | 58 | /* Hash 's' using 'size', place into h (s is modified) */ 59 | #define Hash(s,h,size) \ 60 | {while ( *s != '\0' ) h = (h<<1) + *s++; \ 61 | h %= size;} 62 | 63 | #ifdef __USE_PROTOS 64 | Entry *hash_get(Entry **, char *), 65 | **newHashTable(void), 66 | *hash_add(Entry **, char *, Entry *); 67 | 68 | void killHashTable(Entry **); 69 | 70 | #else 71 | Entry *hash_get(), **newHashTable(), *hash_add(); 72 | void killHashTable(); /* MR9 23-Sep-97 */ 73 | #endif 74 | -------------------------------------------------------------------------------- /pccts/antlr/makefile.VMS: -------------------------------------------------------------------------------- 1 | $! File: MAKE.COM - Makefile for ANTLR 1.33 on OpenVMS, DECC 2 | $! 3 | $! History: 4 | $! --------- 5 | $! 20-Mar-1992 Fred Scholldorf Hacked together for VAX/VMS. 6 | $! 24-Mar-1992 Fred Scholldorf LINK against VAXCRTL sharable library. 7 | $! 24-Aug-1993 Fred Scholldorf Upgrade for ANTLR V1.10. 8 | $! 27-Jan-1998 J.F. Pieronne Upgrade for ANTLR V1.33, DECC 9 | $! 10 | $ set noon !Don't stop on errors. 11 | $! 12 | $ if P1 .eqs. "LINK" then goto relink 13 | $! 14 | $ define/nolog pccts_h "[-.h]" 15 | $ define/nolog support_set "[-.support.set]" 16 | $! 17 | $ delete/nolog *.obj;* !Get rid of existing .OBJ files. 18 | $! 19 | $ options = "/INCLUDE=(pccts_h,support_set)/define=(__STDC__,USER_ZZSYN)" 20 | $ CC 'options' antlr 21 | $ CC 'options' scan 22 | $ CC 'options' err 23 | $ CC 'options' bits 24 | $ CC 'options' build 25 | $ CC 'options' fset2 26 | $ CC 'options' fset 27 | $ CC 'options' gen 28 | $ CC 'options' globals 29 | $ CC 'options' hash 30 | $ CC 'options' lex 31 | $ CC 'options' main 32 | $ CC 'options' misc 33 | $ CC 'options' pred 34 | $ CC 'options' egman 35 | $ CC 'options' mrhoist 36 | $ CC 'options' fcache 37 | $ CC 'options' [-.support.set]set 38 | $! 39 | $relink: 40 | $ LINK antlr,scan,err,bits,build, - 41 | fset2,fset,gen,globals,hash, - 42 | lex,main,misc,pred,egman,mrhoist,fcache,set, - 43 | sys$input:/options 44 | ! sys$share:vaxcrtl.exe/share 45 | $ EXIT 46 | -------------------------------------------------------------------------------- /pccts/antlr/makefile1: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for ANTLR 1.33 3 | # 4 | # SOFTWARE RIGHTS 5 | # 6 | # We reserve no LEGAL rights to the Purdue Compiler Construction Tool 7 | # Set (PCCTS) -- PCCTS is in the public domain. An individual or 8 | # company may do whatever they wish with source code distributed with 9 | # PCCTS or the code generated by PCCTS, including the incorporation of 10 | # PCCTS, or its output, into commerical software. 11 | # 12 | # We encourage users to develop software with PCCTS. However, we do ask 13 | # that credit is given to us for developing PCCTS. By "credit", 14 | # we mean that if you incorporate our source code into one of your 15 | # programs (commercial product, research project, or otherwise) that you 16 | # acknowledge this fact somewhere in the documentation, research report, 17 | # etc... If you like PCCTS and have developed a nice tool with the 18 | # output, please mention that you developed it using PCCTS. In 19 | # addition, we ask that this header remain intact in our source code. 20 | # As long as these guidelines are kept, we expect to continue enhancing 21 | # this system and expect to make other tools available as they are 22 | # completed. 23 | # 24 | # ANTLR 1.33 25 | # Terence Parr 26 | # Parr Research Corporation 27 | # with Purdue University 28 | # and AHPCRC, University of Minnesota 29 | # 1989-1995 30 | # 31 | # Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by 32 | # Ed Harfmann 33 | # Micro Data Base Systems 34 | # Lafayette, Indiana 35 | # 36 | SET=../support/set 37 | PCCTS_H=../h 38 | 39 | # 40 | # UNIX (default) 41 | # 42 | CC=cc 43 | ANTLR=../bin/antlr 44 | DLG=../bin/dlg 45 | OBJ_EXT=o 46 | OUT_OBJ = -o 47 | ANSI=-ansi 48 | AOTHER= 49 | CFLAGS= -O0 -g -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) 50 | # 51 | # SGI Users, use this CFLAGS 52 | # 53 | #CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262 54 | OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \ 55 | globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o $(OBJOTHER) 56 | 57 | antlr : $(OBJ) $(SRC) 58 | $(CC) $(CFLAGS) -o antlr $(OBJ) 59 | mv antlr ../bin 60 | 61 | # what files does PCCTS generate (both ANTLR and DLG) 62 | PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h 63 | 64 | SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \ 65 | hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c 66 | 67 | # 68 | # Don't worry about the ambiguity messages coming from antlr 69 | # for making antlr.c etc... [should be 10 of them, I think] 70 | # 71 | antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g 72 | $(ANTLR) -gh antlr.g $(AOTHER) 73 | 74 | antlr.o : antlr.c mode.h tokens.h 75 | 76 | scan.o : scan.c mode.h tokens.h 77 | 78 | scan.c mode.h: parser.dlg 79 | $(DLG) -C2 parser.dlg scan.c 80 | 81 | set.o : $(SET)/set.c 82 | $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c 83 | 84 | 85 | # 86 | # ****** These next targets are common to UNIX and PC world ******** 87 | # 88 | 89 | #clean up all the intermediate files 90 | clean: 91 | rm -f *.$(OBJ_EXT) core 92 | 93 | #remove everything in clean plus the PCCTS files generated 94 | scrub: 95 | rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core 96 | -------------------------------------------------------------------------------- /pccts/antlr/mode.h: -------------------------------------------------------------------------------- 1 | #define START 0 2 | #define STRINGS 1 3 | #define ACTION_STRINGS 2 4 | #define ACTION_CHARS 3 5 | #define ACTION_COMMENTS 4 6 | #define TOK_DEF_COMMENTS 5 7 | #define TOK_DEF_CPP_COMMENTS 6 8 | #define ACTION_CPP_COMMENTS 7 9 | #define CPP_COMMENTS 8 10 | #define COMMENTS 9 11 | #define ACTIONS 10 12 | #define PARSE_ENUM_FILE 11 13 | -------------------------------------------------------------------------------- /pccts/antlr/stdpccts.h: -------------------------------------------------------------------------------- 1 | #ifndef STDPCCTS_H 2 | #define STDPCCTS_H 3 | /* 4 | * stdpccts.h -- P C C T S I n c l u d e 5 | * 6 | * Terence Parr, Will Cohen, and Hank Dietz: 1989-1999 7 | * Purdue University Electrical Engineering 8 | * With AHPCRC, University of Minnesota 9 | * ANTLR Version 1.33MR20 10 | */ 11 | 12 | #ifndef ANTLR_VERSION 13 | #define ANTLR_VERSION 13320 14 | #endif 15 | 16 | #include "pcctscfg.h" 17 | #include "pccts_stdio.h" 18 | 19 | #include "pcctscfg.h" 20 | #include "set.h" 21 | #include 22 | #include "syn.h" 23 | #include "hash.h" 24 | #include "generic.h" 25 | #define zzcr_attr(attr,tok,t) 26 | #define zzSET_SIZE 20 27 | #include "antlr.h" 28 | #include "tokens.h" 29 | #include "dlgdef.h" 30 | #include "mode.h" 31 | #endif 32 | -------------------------------------------------------------------------------- /pccts/antlr/watantlr.mak: -------------------------------------------------------------------------------- 1 | SET=..\support\set 2 | PCCTS_H=..\h 3 | 4 | # 5 | # Watcom 6 | # 7 | CC=wcl386 8 | ANTLR=..\bin\antlr 9 | DLG=..\bin\dlg 10 | CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC 11 | OUT_OBJ = -o 12 | OBJ_EXT = obj 13 | LINK = wcl386 14 | 15 | .c.obj : 16 | $(CC) -c $[* $(CFLAGS) 17 | 18 | antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj & 19 | fset.obj gen.obj globals.obj hash.obj lex.obj main.obj & 20 | misc.obj set.obj pred.obj 21 | $(LINK) -fe=antlr.exe *.obj -k14336 22 | copy *.exe ..\bin 23 | 24 | # *********** Target list of PC machines *********** 25 | # 26 | # Don't worry about the ambiguity messages coming from antlr 27 | # for making antlr.c etc... [should be 10 of them, I think] 28 | # 29 | antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g 30 | $(ANTLR) antlr.g 31 | 32 | antlr.$(OBJ_EXT): antlr.c mode.h tokens.h 33 | 34 | scan.$(OBJ_EXT): scan.c mode.h tokens.h 35 | 36 | scan.c mode.h: parser.dlg 37 | $(DLG) -C2 parser.dlg scan.c 38 | 39 | set.$(OBJ_EXT): $(SET)\set.c 40 | $(CC) $(CFLAGS) -c set.$(OBJ_EXT) $(SET)\set.c 41 | 42 | # 43 | # ****** These next targets are common to UNIX and PC world ******** 44 | # 45 | 46 | #clean up all the intermediate files 47 | clean: 48 | del *.obj 49 | 50 | #remove everything in clean plus the PCCTS files generated 51 | scrub: 52 | del $(PCCTS_GEN) 53 | del *.$(OBJ_EXT) 54 | -------------------------------------------------------------------------------- /pccts/dlg/DlgMS.mak: -------------------------------------------------------------------------------- 1 | # PCCTS directory 2 | PCCTS_HOME=.. 3 | DLG_SRC=$(PCCTS_HOME)\dlg 4 | PCCTS_H=$(PCCTS_HOME)\h 5 | 6 | 7 | # Support directories 8 | SET=$(PCCTS_HOME)\support\set 9 | 10 | 11 | # Compiler stuff 12 | CC = cl 13 | CFLAGS = -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \ 14 | -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3 15 | 16 | DLG_OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \ 17 | output.obj relabel.obj automata.obj 18 | 19 | SUPPORT_OBJS = set.obj 20 | 21 | # Dependencies 22 | 23 | dlg.exe: $(DLG_OBJS) $(SUPPORT_OBJS) 24 | $(CC) $(CFLAGS) -o dlg.exe $(DLG_OBJS) $(SUPPORT_OBJS) 25 | del *.obj 26 | 27 | dlg_p.obj: $(DLG_SRC)\dlg_p.c \ 28 | $(PCCTS_H)\antlr.h \ 29 | $(PCCTS_H)\config.h \ 30 | $(PCCTS_H)\dlgdef.h \ 31 | $(SET)\set.h \ 32 | $(DLG_SRC)\dlg.h \ 33 | $(DLG_SRC)\mode.h \ 34 | $(DLG_SRC)\tokens.h \ 35 | 36 | $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_p.c 37 | 38 | dlg_a.obj: $(DLG_SRC)\dlg_a.c \ 39 | $(PCCTS_H)\antlr.h \ 40 | $(PCCTS_H)\config.h \ 41 | $(PCCTS_H)\dlgauto.h \ 42 | $(PCCTS_H)\dlgdef.h \ 43 | $(SET)\set.h \ 44 | $(DLG_SRC)\dlg.h \ 45 | $(DLG_SRC)\mode.h \ 46 | $(DLG_SRC)\tokens.h \ 47 | 48 | $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_a.c 49 | 50 | main.obj: $(DLG_SRC)\main.c \ 51 | $(PCCTS_H)\antlr.h \ 52 | $(PCCTS_H)\config.h \ 53 | $(PCCTS_H)\dlgdef.h \ 54 | $(SET)\set.h \ 55 | $(DLG_SRC)\dlg.h \ 56 | $(DLG_SRC)\mode.h \ 57 | $(DLG_SRC)\stdpccts.h \ 58 | $(DLG_SRC)\tokens.h \ 59 | 60 | $(CC) -c $(CFLAGS) $(DLG_SRC)\main.c 61 | 62 | err.obj: $(DLG_SRC)\err.c \ 63 | $(PCCTS_H)\antlr.h \ 64 | $(PCCTS_H)\config.h \ 65 | $(PCCTS_H)\dlgdef.h \ 66 | $(PCCTS_H)\err.h \ 67 | $(SET)\set.h \ 68 | $(DLG_SRC)\dlg.h \ 69 | $(DLG_SRC)\tokens.h \ 70 | 71 | $(CC) -c $(CFLAGS) $(DLG_SRC)\err.c 72 | 73 | support.obj: $(DLG_SRC)\support.c \ 74 | $(PCCTS_H)\config.h \ 75 | $(SET)\set.h \ 76 | $(DLG_SRC)\dlg.h \ 77 | 78 | $(CC) -c $(CFLAGS) $(DLG_SRC)\support.c 79 | 80 | output.obj: $(DLG_SRC)\output.c \ 81 | $(PCCTS_H)\config.h \ 82 | $(SET)\set.h \ 83 | $(DLG_SRC)\dlg.h \ 84 | 85 | $(CC) -c $(CFLAGS) $(DLG_SRC)\output.c 86 | 87 | relabel.obj: $(DLG_SRC)\relabel.c \ 88 | $(PCCTS_H)\config.h \ 89 | $(SET)\set.h \ 90 | $(DLG_SRC)\dlg.h \ 91 | 92 | $(CC) -c $(CFLAGS) $(DLG_SRC)\relabel.c 93 | 94 | automata.obj: $(DLG_SRC)\automata.c \ 95 | $(PCCTS_H)\config.h \ 96 | $(SET)\set.h \ 97 | $(DLG_SRC)\dlg.h \ 98 | 99 | $(CC) -c $(CFLAGS) $(DLG_SRC)\automata.c 100 | 101 | 102 | set.obj: $(SET)\set.c \ 103 | $(PCCTS_H)\config.h \ 104 | $(SET)\set.h \ 105 | 106 | $(CC) -c $(CFLAGS) $(SET)\set.c 107 | -------------------------------------------------------------------------------- /pccts/dlg/DlgMSVC50.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 5.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DLG"=.\DlgMSVC50.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/dlg/DlgMSVC60.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DLG"=.\DlgMSVC60.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/dlg/dlg68K.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/dlg/dlg68K.make -------------------------------------------------------------------------------- /pccts/dlg/dlgPPC.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/pccts/dlg/dlgPPC.make -------------------------------------------------------------------------------- /pccts/dlg/err.c: -------------------------------------------------------------------------------- 1 | /* 2 | * A n t l r S e t s / E r r o r F i l e H e a d e r 3 | * 4 | * Generated from: dlg_p.g 5 | * 6 | * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-1999 7 | * Parr Research Corporation 8 | * with Purdue University Electrical Engineering 9 | * With AHPCRC, University of Minnesota 10 | * ANTLR Version 1.33MR20 11 | */ 12 | 13 | #define ANTLR_VERSION 13320 14 | #include "pcctscfg.h" 15 | #include "pccts_stdio.h" 16 | 17 | #include 18 | #include "dlg.h" 19 | #define zzSET_SIZE 8 20 | #include "antlr.h" 21 | #include "tokens.h" 22 | #include "dlgdef.h" 23 | #include "err.h" 24 | 25 | ANTLRChar *zztokens[46]={ 26 | /* 00 */ "Invalid", 27 | /* 01 */ "@", 28 | /* 02 */ "[\\r\\t\\ ]+", 29 | /* 03 */ "\\n", 30 | /* 04 */ "L_EOF", 31 | /* 05 */ "PER_PER", 32 | /* 06 */ "NAME_PER_PER", 33 | /* 07 */ "LEXMEMBER", 34 | /* 08 */ "LEXACTION", 35 | /* 09 */ "PARSERCLASS", 36 | /* 10 */ "LEXPREFIX", 37 | /* 11 */ "ACTION", 38 | /* 12 */ "GREAT_GREAT", 39 | /* 13 */ "L_BRACE", 40 | /* 14 */ "R_BRACE", 41 | /* 15 */ "L_PAR", 42 | /* 16 */ "R_PAR", 43 | /* 17 */ "L_BRACK", 44 | /* 18 */ "R_BRACK", 45 | /* 19 */ "ZERO_MORE", 46 | /* 20 */ "ONE_MORE", 47 | /* 21 */ "OR", 48 | /* 22 */ "RANGE", 49 | /* 23 */ "NOT", 50 | /* 24 */ "OCTAL_VALUE", 51 | /* 25 */ "HEX_VALUE", 52 | /* 26 */ "DEC_VALUE", 53 | /* 27 */ "TAB", 54 | /* 28 */ "NL", 55 | /* 29 */ "CR", 56 | /* 30 */ "BS", 57 | /* 31 */ "CONTINUATION", 58 | /* 32 */ "LIT", 59 | /* 33 */ "REGCHAR", 60 | /* 34 */ "\\>", 61 | /* 35 */ "\\\\>", 62 | /* 36 */ "\\", 63 | /* 37 */ "\\n", 64 | /* 38 */ "/\\*", 65 | /* 39 */ "//", 66 | /* 40 */ "~[]", 67 | /* 41 */ "\\*/", 68 | /* 42 */ "[\\n\\r]", 69 | /* 43 */ "~[]", 70 | /* 44 */ "[\\n\\r]", 71 | /* 45 */ "~[]" 72 | }; 73 | SetWordType zzerr1[8] = {0x60,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; 74 | SetWordType zzerr2[8] = {0x70,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0}; 75 | SetWordType setwd1[46] = {0x0,0x6,0x0,0x0,0x30,0xc8,0xc8, 76 | 0x1,0x1,0x1,0x1,0x35,0x0,0x30,0x0, 77 | 0x30,0x0,0x30,0x0,0x30,0x30,0x0,0x0, 78 | 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 79 | 0x0,0x30,0x30,0x0,0x0,0x0,0x0,0x0, 80 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; 81 | SetWordType zzerr3[8] = {0x10,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0}; 82 | SetWordType zzerr4[8] = {0x10,0xa0,0x9a,0x7f, 0x3,0x0,0x0,0x0}; 83 | SetWordType zzerr5[8] = {0x10,0xa0,0x82,0x7f, 0x3,0x0,0x0,0x0}; 84 | SetWordType setwd2[46] = {0x0,0x0,0x0,0x0,0xeb,0x2,0x2, 85 | 0x0,0x0,0x0,0x0,0x56,0x0,0x6b,0x54, 86 | 0x6b,0x54,0x6b,0x0,0x4b,0x4b,0x50,0x0, 87 | 0x6b,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb, 88 | 0x0,0xeb,0xeb,0x0,0x0,0x0,0x0,0x0, 89 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; 90 | SetWordType zzerr6[8] = {0x10,0x0,0x0,0x7f, 0x3,0x0,0x0,0x0}; 91 | SetWordType setwd3[46] = {0x0,0x0,0x0,0x0,0x3b,0x0,0x0, 92 | 0x0,0x0,0x0,0x0,0x31,0x0,0x31,0x31, 93 | 0x31,0x31,0x31,0x2c,0x31,0x31,0x31,0x20, 94 | 0x31,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b, 95 | 0x0,0x3b,0x3b,0x0,0x0,0x0,0x0,0x0, 96 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; 97 | -------------------------------------------------------------------------------- /pccts/dlg/makefile.VMS: -------------------------------------------------------------------------------- 1 | $! File: MAKE.COM - Makefile for DLG 1.33 2 | $! 3 | $! History: 4 | $! --------- 5 | $! 20-Mar-1992 Fred Scholldorf Hacked together for VAX/VMS. 6 | $! 24-Mar-1992 Fred Scholldorf LINK against VAXCRTL sharable library. 7 | $! 24-Aug-1993 Fred Scholldorf Upgrade for PCCTS V1.10. 8 | $! 27-Jan-1998 J.F. Pieronne Upgrade for DECC 9 | $! 10 | $ set noon !Don't stop on errors. 11 | $! 12 | $ if P1 .eqs. "LINK" then goto relink 13 | $! 14 | $ define pccts_h "[-.h]" 15 | $ define support_set "[-.support.set]" 16 | $! 17 | $ delete/nolog *.obj;* !Get rid of existing .OBJ files. 18 | $! 19 | $ options = "/INCLUDE=(pccts_h,support_set)/define=(__STDC__,USER_ZZSYN)" 20 | $ CC 'options' dlg_a 21 | $ CC 'options' dlg_p 22 | $ CC 'options' err 23 | $ CC 'options' main 24 | $ CC 'options' [-.support.set]set 25 | $ CC 'options' support 26 | $ CC 'options' output 27 | $ CC 'options' relabel 28 | $ CC 'options' automata 29 | $! 30 | $relink: 31 | $ LINK /EXE=dlg.exe - 32 | dlg_a,dlg_p,err,main, - 33 | set,support,output, - 34 | relabel,automata, - 35 | sys$input:/options 36 | ! sys$share:vaxcrtl.exe/share 37 | $ EXIT 38 | -------------------------------------------------------------------------------- /pccts/dlg/makefile1: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for DLG 1.33 3 | # Terence Parr 4 | # Purdue University, U of MN, Parr Research Corporation 5 | # 1989-1994 6 | # 7 | # Ported to IBM C-Set/2 and Microsoft 6.0 by 8 | # Ed Harfmann 9 | # Micro Data Base Systems 10 | # Lafayette, Indiana 11 | # 12 | SET=../support/set 13 | PCCTS_H=../h 14 | 15 | ## 16 | ## Uncomment the appropriate section to build 17 | ## 18 | 19 | 20 | # 21 | # UNIX 22 | # 23 | CC=cc 24 | ANTLR=../bin/antlr 25 | DLG=../bin/dlg 26 | ANSI=-ansi 27 | CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) 28 | OBJ_EXT=o 29 | OUT_OBJ = -o 30 | OBJ = dlg_p.o dlg_a.o main.o err.o set.o support.o output.o \ 31 | relabel.o automata.o 32 | 33 | dlg : $(OBJ) $(SRC) 34 | $(CC) $(CFLAGS) -o dlg $(OBJ) 35 | mv dlg ../bin 36 | 37 | SRC = dlg_p.c dlg_a.c main.c err.c $(SET)/set.c support.c output.c \ 38 | relabel.c automata.c 39 | 40 | dlg_p.c parser.dlg err.c tokens.h : dlg_p.g 41 | $(ANTLR) dlg_p.g 42 | 43 | dlg_a.c mode.h : parser.dlg 44 | $(DLG) -C2 parser.dlg dlg_a.c 45 | 46 | dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h 47 | $(CC) $(CFLAGS) -c dlg_p.c 48 | 49 | dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h 50 | $(CC) $(CFLAGS) -c dlg_a.c 51 | 52 | main.$(OBJ_EXT) : main.c dlg.h 53 | $(CC) $(CFLAGS) -c main.c 54 | 55 | set.$(OBJ_EXT) : $(SET)/set.c 56 | $(CC) -c $(CFLAGS) $(SET)/set.c 57 | 58 | lint: 59 | lint *.c 60 | 61 | #clean up all the intermediate files 62 | clean: 63 | rm -f *.$(OBJ_EXT) core 64 | -------------------------------------------------------------------------------- /pccts/dlg/mode.h: -------------------------------------------------------------------------------- 1 | #define START 0 2 | #define ACT 1 3 | #define ACTION_COMMENTS 2 4 | #define ACTION_CPP_COMMENTS 3 5 | -------------------------------------------------------------------------------- /pccts/dlg/stdpccts.h: -------------------------------------------------------------------------------- 1 | #ifndef STDPCCTS_H 2 | #define STDPCCTS_H 3 | /* 4 | * stdpccts.h -- P C C T S I n c l u d e 5 | * 6 | * Terence Parr, Will Cohen, and Hank Dietz: 1989-1999 7 | * Purdue University Electrical Engineering 8 | * With AHPCRC, University of Minnesota 9 | * ANTLR Version 1.33MR20 10 | */ 11 | 12 | #ifndef ANTLR_VERSION 13 | #define ANTLR_VERSION 13320 14 | #endif 15 | 16 | #include "pcctscfg.h" 17 | #include "pccts_stdio.h" 18 | 19 | #include 20 | #include "dlg.h" 21 | #define zzSET_SIZE 8 22 | #include "antlr.h" 23 | #include "tokens.h" 24 | #include "dlgdef.h" 25 | #include "mode.h" 26 | #endif 27 | -------------------------------------------------------------------------------- /pccts/dlg/tokens.h: -------------------------------------------------------------------------------- 1 | #ifndef tokens_h 2 | #define tokens_h 3 | /* tokens.h -- List of labelled tokens and stuff 4 | * 5 | * Generated from: dlg_p.g 6 | * 7 | * Terence Parr, Will Cohen, and Hank Dietz: 1989-1999 8 | * Purdue University Electrical Engineering 9 | * ANTLR Version 1.33MR20 10 | */ 11 | #define zzEOF_TOKEN 1 12 | #define L_EOF 4 13 | #define PER_PER 5 14 | #define NAME_PER_PER 6 15 | #define LEXMEMBER 7 16 | #define LEXACTION 8 17 | #define PARSERCLASS 9 18 | #define LEXPREFIX 10 19 | #define ACTION 11 20 | #define GREAT_GREAT 12 21 | #define L_BRACE 13 22 | #define R_BRACE 14 23 | #define L_PAR 15 24 | #define R_PAR 16 25 | #define L_BRACK 17 26 | #define R_BRACK 18 27 | #define ZERO_MORE 19 28 | #define ONE_MORE 20 29 | #define OR 21 30 | #define RANGE 22 31 | #define NOT 23 32 | #define OCTAL_VALUE 24 33 | #define HEX_VALUE 25 34 | #define DEC_VALUE 26 35 | #define TAB 27 36 | #define NL 28 37 | #define CR 29 38 | #define BS 30 39 | #define CONTINUATION 31 40 | #define LIT 32 41 | #define REGCHAR 33 42 | 43 | #ifdef __USE_PROTOS 44 | void grammar(void); 45 | #else 46 | extern void grammar(); 47 | #endif 48 | 49 | #ifdef __USE_PROTOS 50 | void start_states(void); 51 | #else 52 | extern void start_states(); 53 | #endif 54 | 55 | #ifdef __USE_PROTOS 56 | void do_conversion(void); 57 | #else 58 | extern void do_conversion(); 59 | #endif 60 | 61 | #ifdef __USE_PROTOS 62 | void rule_list(void); 63 | #else 64 | extern void rule_list(); 65 | #endif 66 | 67 | #ifdef __USE_PROTOS 68 | void rule(void); 69 | #else 70 | extern void rule(); 71 | #endif 72 | 73 | #ifdef __USE_PROTOS 74 | void reg_expr(void); 75 | #else 76 | extern void reg_expr(); 77 | #endif 78 | 79 | #ifdef __USE_PROTOS 80 | void and_expr(void); 81 | #else 82 | extern void and_expr(); 83 | #endif 84 | 85 | #ifdef __USE_PROTOS 86 | void repeat_expr(void); 87 | #else 88 | extern void repeat_expr(); 89 | #endif 90 | 91 | #ifdef __USE_PROTOS 92 | void expr(void); 93 | #else 94 | extern void expr(); 95 | #endif 96 | 97 | #ifdef __USE_PROTOS 98 | void atom_list(void); 99 | #else 100 | extern void atom_list(); 101 | #endif 102 | 103 | #ifdef __USE_PROTOS 104 | void near_atom(void); 105 | #else 106 | extern void near_atom(); 107 | #endif 108 | 109 | #ifdef __USE_PROTOS 110 | void atom(void); 111 | #else 112 | extern void atom(); 113 | #endif 114 | 115 | #ifdef __USE_PROTOS 116 | void anychar(void); 117 | #else 118 | extern void anychar(); 119 | #endif 120 | 121 | #endif 122 | extern SetWordType zzerr1[]; 123 | extern SetWordType zzerr2[]; 124 | extern SetWordType setwd1[]; 125 | extern SetWordType zzerr3[]; 126 | extern SetWordType zzerr4[]; 127 | extern SetWordType zzerr5[]; 128 | extern SetWordType setwd2[]; 129 | extern SetWordType zzerr6[]; 130 | extern SetWordType setwd3[]; 131 | -------------------------------------------------------------------------------- /pccts/dlg/watdlg.mak: -------------------------------------------------------------------------------- 1 | SET=..\support\set 2 | PCCTS_H=..\h 3 | 4 | # 5 | # Watcom 6 | # 7 | CC=wcl386 8 | ANTLR=..\bin\antlr 9 | DLG=..\bin\dlg 10 | CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC 11 | LIBS= 12 | OBJ_EXT = obj 13 | LINK = wcl386 14 | 15 | .c.obj : 16 | $(CC) -c $[* $(CFLAGS) 17 | 18 | dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj & 19 | output.obj relabel.obj automata.obj 20 | $(LINK) -fe=dlg.exe *.obj -k14336 21 | copy *.exe ..\bin 22 | 23 | SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c & 24 | relabel.c automata.c 25 | 26 | dlg_p.c parser.dlg err.c tokens.h : dlg_p.g 27 | $(ANTLR) dlg_p.g 28 | 29 | dlg_a.c mode.h : parser.dlg 30 | $(DLG) -C2 parser.dlg dlg_a.c 31 | 32 | dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h 33 | $(CC) $(CFLAGS) -c dlg_p.c 34 | 35 | dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h 36 | $(CC) $(CFLAGS) -c dlg_a.c 37 | 38 | main.$(OBJ_EXT) : main.c dlg.h 39 | $(CC) $(CFLAGS) -c main.c 40 | 41 | set.$(OBJ_EXT) : $(SET)\set.c 42 | $(CC) -c $(CFLAGS) $(SET)\set.c 43 | 44 | #clean up all the intermediate files 45 | clean: 46 | del *.$(OBJ_EXT) 47 | -------------------------------------------------------------------------------- /pccts/h/ATokPtr.cpp: -------------------------------------------------------------------------------- 1 | /* ATokPtr.C 2 | * 3 | * ANTLRToken MUST be defined before entry to this file. 4 | * 5 | * SOFTWARE RIGHTS 6 | * 7 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 8 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 9 | * company may do whatever they wish with source code distributed with 10 | * PCCTS or the code generated by PCCTS, including the incorporation of 11 | * PCCTS, or its output, into commerical software. 12 | * 13 | * We encourage users to develop software with PCCTS. However, we do ask 14 | * that credit is given to us for developing PCCTS. By "credit", 15 | * we mean that if you incorporate our source code into one of your 16 | * programs (commercial product, research project, or otherwise) that you 17 | * acknowledge this fact somewhere in the documentation, research report, 18 | * etc... If you like PCCTS and have developed a nice tool with the 19 | * output, please mention that you developed it using PCCTS. In 20 | * addition, we ask that this header remain intact in our source code. 21 | * As long as these guidelines are kept, we expect to continue enhancing 22 | * this system and expect to make other tools available as they are 23 | * completed. 24 | * 25 | * ANTLR 1.33 26 | * Written by Russell Quong June 30, 1995 27 | * Adapted by Terence Parr to ANTLR stuff 28 | * Parr Research Corporation 29 | * with Purdue University and AHPCRC, University of Minnesota 30 | * 1989-1998 31 | */ 32 | 33 | #include "pcctscfg.h" 34 | 35 | PCCTS_NAMESPACE_STD 36 | 37 | #include "ATokPtr.h" 38 | 39 | void ANTLRTokenPtr::ref() const 40 | { 41 | if (ptr_ != NULL) { 42 | ptr_->ref(); 43 | } 44 | } 45 | 46 | void ANTLRTokenPtr::deref() 47 | { 48 | if (ptr_ != NULL) 49 | { 50 | ptr_->deref(); 51 | if ( ptr_->nref()==0 ) 52 | { 53 | delete ptr_; 54 | ptr_ = NULL; 55 | } 56 | } 57 | } 58 | 59 | ANTLRTokenPtr::~ANTLRTokenPtr() 60 | { 61 | deref(); 62 | } 63 | 64 | // 65 | // 8-Apr-97 MR1 Make operator -> a const member function 66 | // as weall as some other member functions 67 | // 68 | void ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs) // MR1 69 | { 70 | lhs.ref(); // protect against "xp = xp"; ie same underlying object 71 | deref(); 72 | ptr_ = lhs.ptr_; 73 | } 74 | 75 | void ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr) 76 | { 77 | if (addr != NULL) { 78 | addr->ref(); 79 | } 80 | deref(); 81 | ptr_ = addr; 82 | } 83 | -------------------------------------------------------------------------------- /pccts/h/ATokenStream.h: -------------------------------------------------------------------------------- 1 | /* ANTLRTokenStream.h 2 | * 3 | * SOFTWARE RIGHTS 4 | * 5 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 6 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 7 | * company may do whatever they wish with source code distributed with 8 | * PCCTS or the code generated by PCCTS, including the incorporation of 9 | * PCCTS, or its output, into commerical software. 10 | * 11 | * We encourage users to develop software with PCCTS. However, we do ask 12 | * that credit is given to us for developing PCCTS. By "credit", 13 | * we mean that if you incorporate our source code into one of your 14 | * programs (commercial product, research project, or otherwise) that you 15 | * acknowledge this fact somewhere in the documentation, research report, 16 | * etc... If you like PCCTS and have developed a nice tool with the 17 | * output, please mention that you developed it using PCCTS. In 18 | * addition, we ask that this header remain intact in our source code. 19 | * As long as these guidelines are kept, we expect to continue enhancing 20 | * this system and expect to make other tools available as they are 21 | * completed. 22 | * 23 | * ANTLR 1.33 24 | * Terence Parr 25 | * Parr Research Corporation 26 | * with Purdue University and AHPCRC, University of Minnesota 27 | * 1989-1998 28 | */ 29 | 30 | #ifndef ATOKENSTREAM_H_GATE 31 | #define ATOKENSTREAM_H_GATE 32 | 33 | #include "pcctscfg.h" 34 | 35 | /* This is really a behavior or protocol; it merely indicates the behavior 36 | * required of the input and output of an ANTLRTokenBuffer. You could 37 | * subclass it, but you can also just pass any old pointer to ANTLRTokenBuffer 38 | * with a type cast (in which case, your getANTLRToken() would have to 39 | * explicitly cast the input pointer to your REAL type (typically your lexer)). 40 | */ 41 | 42 | class ANTLRParser; // MR1 43 | 44 | class DllExportPCCTS ANTLRTokenStream { 45 | public: 46 | virtual _ANTLRTokenPtr getToken() = 0; 47 | virtual ANTLRParser * setParser(ANTLRParser *p) {return 0; }; // MR12 48 | virtual ANTLRParser * getParser() { return 0; }; // MR12 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /pccts/h/BufFileInput.cpp: -------------------------------------------------------------------------------- 1 | // FILE: BufFileInput.cpp 2 | // AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru 3 | // CREATION: 26-JAN-1998 4 | // DESCRIPTION: File Input Stream with lookahead for Scanner. 5 | // See file BufFileInput.h for details 6 | 7 | // Change History: 8 | // 9 | // 22-Jun-1998 assert.h -> PCCTS_ASSERT_H 10 | // string.h -> PCCTS_STRING_H 11 | // 12 | // 28-May-1998 Add virtual destructor to release buffer. 13 | // 14 | // Add dummy definition for ANTLRTokenType 15 | // to allow compilation without knowing 16 | // token type codes. 17 | // 18 | // Manfred Kogler (km@cast.uni-linz.ac.at) 19 | // (1.33MR14) 20 | // 21 | // 20-Jul-1998 MR14a - Reorder initialization list for ctor. 22 | // 23 | 24 | enum ANTLRTokenType {TER_HATES_CPP=0, SO_DO_OTHERS=9999 }; 25 | 26 | #include "pcctscfg.h" 27 | #include "pccts_assert.h" 28 | #include "pccts_string.h" 29 | 30 | PCCTS_NAMESPACE_STD 31 | 32 | #include "BufFileInput.h" 33 | 34 | BufFileInput::BufFileInput( FILE *f, int buf_size ) 35 | : input( f ), 36 | buf( new int[buf_size] ), 37 | size( buf_size ), 38 | start( 0 ), 39 | len( 0 ) 40 | { 41 | } 42 | 43 | BufFileInput::~BufFileInput() 44 | { 45 | delete [] buf; 46 | } 47 | 48 | int BufFileInput::nextChar( void ) 49 | { 50 | if( len > 0 ) 51 | { 52 | // get char from buffer 53 | int c = buf[start]; 54 | 55 | if( c != EOF ) 56 | { 57 | start++; start %= size; 58 | len--; 59 | } 60 | return c; 61 | } else { 62 | // get char from file 63 | int c = getc( input ); 64 | 65 | if( c == EOF ) 66 | { 67 | // if EOF - put it in the buffer as indicator 68 | buf[start] = EOF; 69 | len++; 70 | } 71 | return c; 72 | } 73 | } 74 | 75 | int BufFileInput::lookahead( char* s ) 76 | { 77 | int l = strlen( s ); 78 | 79 | assert( 0 < l && l <= size ); 80 | 81 | while( len < l ) 82 | { 83 | int c = getc( input ); 84 | 85 | buf[ (start+len) % size ] = c; 86 | 87 | len++; 88 | 89 | if( c == EOF ) return 0; 90 | } 91 | 92 | for( int i = 0; i < l; i++ ) 93 | { 94 | if( s[i] != buf[ (start+i) % size ] ) return 0; 95 | } 96 | return 1; 97 | } 98 | 99 | // End of file BufFileInput.cpp 100 | 101 | -------------------------------------------------------------------------------- /pccts/h/BufFileInput.h: -------------------------------------------------------------------------------- 1 | // FILE: BufFileInput.h 2 | // AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru 3 | // CREATION: 26-JAN-1998 4 | // DESCRIPTION: File Input Stream with lookahead for Scanner 5 | // Tested under Win32 with ANTLR 1.33 MR10 and MSVC 5.0 6 | 7 | // Change History: 8 | // 9 | // 28-May-1998 Add virtual destructor to release buffer 10 | // Manfred Kogler (km@cast.uni-linz.ac.at) 11 | // (1.33MR14) 12 | 13 | #ifndef BufFileInput_h 14 | #define BufFileInput_h 15 | 16 | #include "pcctscfg.h" 17 | 18 | #include "pccts_stdio.h" 19 | 20 | PCCTS_NAMESPACE_STD 21 | 22 | #include "DLexerBase.h" 23 | 24 | class DllExportPCCTS BufFileInput : public DLGInputStream 25 | { 26 | public: 27 | // constructor 28 | // f - input stream 29 | // buf_size - size of buffer (maximal length for string in is_in) 30 | 31 | BufFileInput(FILE *f, int buf_size = 8 ); 32 | 33 | virtual ~BufFileInput(); 34 | 35 | // gets next char from stream 36 | 37 | virtual int nextChar( void ); 38 | 39 | // looks in stream and compares next l characters with s 40 | // returns the result of comparision 41 | 42 | int lookahead( char* s ); 43 | 44 | private: 45 | FILE *input; // input stream; 46 | int* buf; // buffer 47 | int size; // size of buffer 48 | int start; // position of the first symbol in buffer 49 | int len; // count of characters in buffers 50 | }; 51 | 52 | #endif 53 | // end of file BufFileInput.h 54 | -------------------------------------------------------------------------------- /pccts/h/DLG_stream_input.h: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************/ 3 | /* */ 4 | /* Predefined char stream: Input from (c++) stream. */ 5 | /* */ 6 | /* By Hubert Holin (Hubert.Holin@Bigfoot.com), 1998. */ 7 | /* */ 8 | /* This is completely free stuff, do whatever you want with */ 9 | /* it (but then, I will take no responsability for whatever */ 10 | /* may happen if you do either... caveat emptor!). */ 11 | /* */ 12 | /************************************************************/ 13 | 14 | #ifndef _DLG_STREAM_INPUT_H 15 | #define _DLG_STREAM_INPUT_H 16 | 17 | #include "pccts_istream.h" 18 | 19 | PCCTS_NAMESPACE_STD 20 | 21 | #ifndef DLGX_H 22 | #include "DLexerBase.h" 23 | #endif 24 | 25 | 26 | // NOTES: The semantics of the copy constructor 27 | // and the affectation operator may be unwaranted... 28 | // and the stream may not be reset. 29 | // 30 | // It would have been so much nicer for nextChar() 31 | // to throw (of for the DLGInputStream to change status) 32 | // upon hiting EOF than to return an "int"... 33 | 34 | template < 35 | class E, 36 | class T = ::std::char_traits 37 | > 38 | class DLG_stream_input : public DLGInputStream 39 | { 40 | public: 41 | 42 | DLG_stream_input(::std::basic_istream * p_input_stream) 43 | : input(p_input_stream) 44 | { 45 | // nothing to do! 46 | }; 47 | 48 | DLG_stream_input(const DLG_stream_input & a_recopier) 49 | : input(a_recopier.input) 50 | { 51 | // nothing to do! 52 | }; 53 | 54 | virtual ~DLG_stream_input() 55 | { 56 | this->purge(); // bloody templarized lookup... 57 | }; 58 | 59 | DLG_stream_input operator = (const DLG_stream_input & a_affecter) 60 | { 61 | if (this != &a_affecter) 62 | { 63 | input = a_affecter.input; 64 | } 65 | 66 | return(*this); 67 | }; 68 | 69 | virtual int nextChar() 70 | { 71 | E extracted_stuff; 72 | 73 | input->get(extracted_stuff); 74 | 75 | if (*input) 76 | { 77 | return(int(extracted_stuff)); 78 | } 79 | else 80 | { 81 | return(EOF); 82 | } 83 | }; 84 | 85 | protected: 86 | 87 | ::std::basic_istream * input; 88 | 89 | private: 90 | 91 | void purge() 92 | { 93 | // nothing to do! 94 | }; 95 | }; 96 | 97 | #endif /* _DLG_STREAM_INPUT_H */ 98 | 99 | -------------------------------------------------------------------------------- /pccts/h/PBlackBox.h: -------------------------------------------------------------------------------- 1 | #ifndef PBLACKBOX_H 2 | #define PBLACKBOX_H 3 | 4 | /* 5 | * SOFTWARE RIGHTS 6 | * 7 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 8 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 9 | * company may do whatever they wish with source code distributed with 10 | * PCCTS or the code generated by PCCTS, including the incorporation of 11 | * PCCTS, or its output, into commerical software. 12 | * 13 | * We encourage users to develop software with PCCTS. However, we do ask 14 | * that credit is given to us for developing PCCTS. By "credit", 15 | * we mean that if you incorporate our source code into one of your 16 | * programs (commercial product, research project, or otherwise) that you 17 | * acknowledge this fact somewhere in the documentation, research report, 18 | * etc... If you like PCCTS and have developed a nice tool with the 19 | * output, please mention that you developed it using PCCTS. In 20 | * addition, we ask that this header remain intact in our source code. 21 | * As long as these guidelines are kept, we expect to continue enhancing 22 | * this system and expect to make other tools available as they are 23 | * completed. 24 | * 25 | * ANTLR 1.33 26 | * Terence Parr 27 | * Parr Research Corporation 28 | * with Purdue University and AHPCRC, University of Minnesota 29 | * 1989-1998 30 | */ 31 | 32 | #include "pcctscfg.h" 33 | 34 | #include "pccts_iostream.h" 35 | 36 | PCCTS_NAMESPACE_STD 37 | 38 | // MR20 Added #include for "DLexerBase.h" 39 | 40 | #include "DLexerBase.h" 41 | 42 | // 43 | // The default buffer size of the lexer is given by the 44 | // second argument of the lexer's ctor. It is optional 45 | // and defaults to 2000 46 | // 47 | 48 | template 49 | class DllExportPCCTS ParserBlackBox { 50 | protected: 51 | DLGFileInput *in; 52 | Lexer *scan; 53 | _ANTLRTokenPtr tok; 54 | ANTLRTokenBuffer *pipe; 55 | Parser *_parser; 56 | FILE *file; 57 | public: 58 | 59 | ParserBlackBox(FILE *f) 60 | { 61 | file = f; 62 | in = new DLGFileInput(f); 63 | scan = new Lexer(in); 64 | pipe = new ANTLRTokenBuffer(scan); 65 | tok = new Token; 66 | scan->setToken(tok); 67 | _parser = new Parser(pipe); 68 | _parser->init(); 69 | } 70 | ParserBlackBox(char *fname) 71 | { 72 | FILE *f = fopen(fname, "r"); 73 | if ( f==NULL ) {cerr << "cannot open " << fname << "\n"; return;} 74 | else { 75 | file = f; 76 | in = new DLGFileInput(f); 77 | scan = new Lexer(in); 78 | pipe = new ANTLRTokenBuffer(scan); 79 | tok = new Token; 80 | scan->setToken(tok); 81 | _parser = new Parser(pipe); 82 | _parser->init(); 83 | } 84 | } 85 | ~ParserBlackBox() 86 | { 87 | delete in; delete scan; delete pipe; delete _parser; delete tok; 88 | fclose(file); 89 | } 90 | 91 | Parser *parser() { return _parser; } 92 | Lexer *getLexer() { return scan; } 93 | }; 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /pccts/h/SList.h: -------------------------------------------------------------------------------- 1 | #ifndef SList_h 2 | #define SList_h 3 | 4 | /* 5 | * SList.h 6 | * 7 | * SOFTWARE RIGHTS 8 | * 9 | * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public 10 | * domain. An individual or company may do whatever they wish with 11 | * source code distributed with SORCERER or the code generated by 12 | * SORCERER, including the incorporation of SORCERER, or its output, into 13 | * commerical software. 14 | * 15 | * We encourage users to develop software with SORCERER. However, we do 16 | * ask that credit is given to us for developing SORCERER. By "credit", 17 | * we mean that if you incorporate our source code into one of your 18 | * programs (commercial product, research project, or otherwise) that you 19 | * acknowledge this fact somewhere in the documentation, research report, 20 | * etc... If you like SORCERER and have developed a nice tool with the 21 | * output, please mention that you developed it using SORCERER. In 22 | * addition, we ask that this header remain intact in our source code. 23 | * As long as these guidelines are kept, we expect to continue enhancing 24 | * this system and expect to make other tools available as they are 25 | * completed. 26 | * 27 | * PCCTS 1.33 28 | * Terence Parr 29 | * Parr Research Corporation 30 | * with Purdue University and AHPCRC, University of Minnesota 31 | * 1992-1998 32 | */ 33 | 34 | #include "pcctscfg.h" 35 | 36 | #include "pccts_stdio.h" 37 | #include "pccts_stdlib.h" 38 | 39 | PCCTS_NAMESPACE_STD 40 | 41 | #include "PCCTSAST.h" 42 | 43 | class PCCTS_AST; 44 | 45 | class SListNode { 46 | protected: 47 | void *_elem; /* pointer to any kind of element */ 48 | SListNode *_next; 49 | public: 50 | SListNode() {_elem=_next=NULL;} 51 | virtual ~SListNode() {_elem=_next=NULL;} 52 | void *elem() { return _elem; } 53 | void setElem(void *e) { _elem = e; } 54 | void setNext(SListNode *t) { _next = t; } 55 | SListNode *next() { return _next; } 56 | }; 57 | 58 | class SList { 59 | SListNode *head, *tail; 60 | public: 61 | SList() {head=tail=NULL;} 62 | virtual ~SList() {head=tail=NULL;} 63 | virtual void *iterate(SListNode **); 64 | virtual void add(void *e); 65 | virtual void lfree(); 66 | virtual PCCTS_AST *to_ast(SList list); 67 | virtual void require(int e,char *err){ if ( !e ) panic(err); } 68 | virtual void panic(char *err){ fprintf(stderr, "SList panic: %s\n", err); exit(PCCTS_EXIT_FAILURE); } 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /pccts/h/charbuf.h: -------------------------------------------------------------------------------- 1 | /* ANTLR attribute definition -- constant width text 2 | * 3 | * SOFTWARE RIGHTS 4 | * 5 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 6 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 7 | * company may do whatever they wish with source code distributed with 8 | * PCCTS or the code generated by PCCTS, including the incorporation of 9 | * PCCTS, or its output, into commerical software. 10 | * 11 | * We encourage users to develop software with PCCTS. However, we do ask 12 | * that credit is given to us for developing PCCTS. By "credit", 13 | * we mean that if you incorporate our source code into one of your 14 | * programs (commercial product, research project, or otherwise) that you 15 | * acknowledge this fact somewhere in the documentation, research report, 16 | * etc... If you like PCCTS and have developed a nice tool with the 17 | * output, please mention that you developed it using PCCTS. In 18 | * addition, we ask that this header remain intact in our source code. 19 | * As long as these guidelines are kept, we expect to continue enhancing 20 | * this system and expect to make other tools available as they are 21 | * completed. 22 | * 23 | * ANTLR 1.33 24 | * Terence Parr 25 | * Parr Research Corporation 26 | * with Purdue University and AHPCRC, University of Minnesota 27 | * 1989-1998 28 | */ 29 | 30 | #ifndef ZZCHARBUF_H 31 | #define ZZCHARBUF_H 32 | 33 | #include "pcctscfg.h" 34 | 35 | #include "pccts_string.h" 36 | 37 | #ifndef D_TextSize 38 | #define D_TextSize 30 39 | #endif 40 | 41 | typedef struct { char text[D_TextSize]; } Attrib; 42 | 43 | #define zzcr_attr(a,tok,t) strncpy((a)->text, t, D_TextSize-1); \ 44 | (a)->text[D_TextSize-1] = '\0'; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /pccts/h/charptr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SOFTWARE RIGHTS 3 | * 4 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 5 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 6 | * company may do whatever they wish with source code distributed with 7 | * PCCTS or the code generated by PCCTS, including the incorporation of 8 | * PCCTS, or its output, into commerical software. 9 | * 10 | * We encourage users to develop software with PCCTS. However, we do ask 11 | * that credit is given to us for developing PCCTS. By "credit", 12 | * we mean that if you incorporate our source code into one of your 13 | * programs (commercial product, research project, or otherwise) that you 14 | * acknowledge this fact somewhere in the documentation, research report, 15 | * etc... If you like PCCTS and have developed a nice tool with the 16 | * output, please mention that you developed it using PCCTS. In 17 | * addition, we ask that this header remain intact in our source code. 18 | * As long as these guidelines are kept, we expect to continue enhancing 19 | * this system and expect to make other tools available as they are 20 | * completed. 21 | * 22 | * ANTLR 1.33 23 | * Terence Parr 24 | * Parr Research Corporation 25 | * with Purdue University and AHPCRC, University of Minnesota 26 | * 1989-1998 27 | */ 28 | 29 | #include "pcctscfg.h" 30 | 31 | #ifdef __STDC__ 32 | #include "pccts_stdlib.h" 33 | #else 34 | #include 35 | #endif 36 | #include "pccts_string.h" 37 | 38 | /* 133MR1 include stdio.h for fprintf in charptr.c */ 39 | 40 | #include "pccts_stdio.h" 41 | 42 | /* 133MR1 include charptr.h for Attrib in charptr.c */ 43 | 44 | #include "charptr.h" 45 | 46 | #ifdef __USE_PROTOS 47 | zzcr_attr(Attrib *a,int token,char *text) 48 | #else 49 | zzcr_attr(a,token,text) 50 | Attrib *a; 51 | int token; 52 | char *text; 53 | #endif 54 | { 55 | *a = (char *) malloc(strlen(text)+1); /* MR6 */ 56 | if ( *a == NULL ) {fprintf(stderr, "zzcr_attr: out of memory!\n"); exit(-1);} 57 | strcpy(*a, text); 58 | } 59 | -------------------------------------------------------------------------------- /pccts/h/charptr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * SOFTWARE RIGHTS 4 | * 5 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 6 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 7 | * company may do whatever they wish with source code distributed with 8 | * PCCTS or the code generated by PCCTS, including the incorporation of 9 | * PCCTS, or its output, into commerical software. 10 | * 11 | * We encourage users to develop software with PCCTS. However, we do ask 12 | * that credit is given to us for developing PCCTS. By "credit", 13 | * we mean that if you incorporate our source code into one of your 14 | * programs (commercial product, research project, or otherwise) that you 15 | * acknowledge this fact somewhere in the documentation, research report, 16 | * etc... If you like PCCTS and have developed a nice tool with the 17 | * output, please mention that you developed it using PCCTS. In 18 | * addition, we ask that this header remain intact in our source code. 19 | * As long as these guidelines are kept, we expect to continue enhancing 20 | * this system and expect to make other tools available as they are 21 | * completed. 22 | * 23 | * ANTLR 1.33 24 | * Terence Parr 25 | * Parr Research Corporation 26 | * with Purdue University and AHPCRC, University of Minnesota 27 | * 1989-1998 28 | */ 29 | 30 | /* 31 | * WARNING!!!!: charptr.h does NOT make copies and the 32 | * memory is freed after the attribute scope exits. 33 | */ 34 | 35 | #ifndef ZZCHARPTR_H 36 | #define ZZCHARPTR_H 37 | 38 | typedef char *Attrib; 39 | #define zzdef0(a) {*(a)=NULL;} 40 | /* MR8 Jens Tingleff (jensting@imaginet.fr) */ 41 | /* Set memory pointer to null after free() */ 42 | #define zzd_attr(a) {if ( *(a)!=NULL ) {free(*(a)); *(a)=NULL; }; } 43 | 44 | #ifdef __STDC__ 45 | extern zzcr_attr(Attrib *,int,char *); 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /pccts/h/config.h: -------------------------------------------------------------------------------- 1 | #include "pcctscfg.h" 2 | -------------------------------------------------------------------------------- /pccts/h/int.h: -------------------------------------------------------------------------------- 1 | /* ANTLR attribute definition -- long integers 2 | * 3 | * SOFTWARE RIGHTS 4 | * 5 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 6 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or 7 | * company may do whatever they wish with source code distributed with 8 | * PCCTS or the code generated by PCCTS, including the incorporation of 9 | * PCCTS, or its output, into commerical software. 10 | * 11 | * We encourage users to develop software with PCCTS. However, we do ask 12 | * that credit is given to us for developing PCCTS. By "credit", 13 | * we mean that if you incorporate our source code into one of your 14 | * programs (commercial product, research project, or otherwise) that you 15 | * acknowledge this fact somewhere in the documentation, research report, 16 | * etc... If you like PCCTS and have developed a nice tool with the 17 | * output, please mention that you developed it using PCCTS. In 18 | * addition, we ask that this header remain intact in our source code. 19 | * As long as these guidelines are kept, we expect to continue enhancing 20 | * this system and expect to make other tools available as they are 21 | * completed. 22 | * 23 | * ANTLR 1.33 24 | * Terence Parr 25 | * Parr Research Corporation 26 | * with Purdue University and AHPCRC, University of Minnesota 27 | * 1989-1998 28 | */ 29 | 30 | #ifndef ZZINT_H 31 | #define ZZINT_H 32 | 33 | typedef long Attrib; 34 | 35 | #define zzcr_attr(a,tok,t) *(a) = atol(t); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /pccts/h/pccts_assert.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_ASSERT_H__ 2 | #define __PCCTS_ASSERT_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_iostream.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_IOSTREAM_H__ 2 | #define __PCCTS_IOSTREAM_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_istream.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_ISTREAM_H__ 2 | #define __PCCTS_ISTREAM_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_SETJMP_H__ 2 | #define __PCCTS_SETJMP_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_STDARG_H__ 2 | #define __PCCTS_STDARG_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_STDIO_H__ 2 | #define __PCCTS_STDIO_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_STDLIB_H__ 2 | #define __PCCTS_STDLIB_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pccts_string.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCCTS_STRING_H__ 2 | #define __PCCTS_STRING_H__ 3 | 4 | #ifdef PCCTS_USE_NAMESPACE_STD 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pccts/h/pcctslib50.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 5.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pcctslib"=.\pcctslib50.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/h/pcctslib60.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pcctslib"=.\pcctslib60.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /pccts/h/pcnames.bat: -------------------------------------------------------------------------------- 1 | ren aparser.c aparser.cpp 2 | ren astbase.c astbase.cpp 3 | ren atokenbu.c atokbuf.cpp 4 | ren atokenbu.h atokbuf.h 5 | ren atokenst.h atokstr.h 6 | ren dlexerba.c dlexbase.cpp 7 | ren dlexerba.h dlexbase.h 8 | ren dlexer.c dlexer.cpp 9 | ren list.c list.cpp 10 | ren pblackbo.h pblckbox.h 11 | ren pcctsast.c pcctsast.cpp 12 | -------------------------------------------------------------------------------- /pccts/h/slist.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SList.C 3 | * 4 | * SOFTWARE RIGHTS 5 | * 6 | * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public 7 | * domain. An individual or company may do whatever they wish with 8 | * source code distributed with SORCERER or the code generated by 9 | * SORCERER, including the incorporation of SORCERER, or its output, into 10 | * commerical software. 11 | * 12 | * We encourage users to develop software with SORCERER. However, we do 13 | * ask that credit is given to us for developing SORCERER. By "credit", 14 | * we mean that if you incorporate our source code into one of your 15 | * programs (commercial product, research project, or otherwise) that you 16 | * acknowledge this fact somewhere in the documentation, research report, 17 | * etc... If you like SORCERER and have developed a nice tool with the 18 | * output, please mention that you developed it using SORCERER. In 19 | * addition, we ask that this header remain intact in our source code. 20 | * As long as these guidelines are kept, we expect to continue enhancing 21 | * this system and expect to make other tools available as they are 22 | * completed. 23 | * 24 | * PCCTS 1.33 25 | * Terence Parr 26 | * Parr Research Corporation 27 | * with Purdue University and AHPCRC, University of Minnesota 28 | * 1992-1998 29 | */ 30 | 31 | #define ANTLR_SUPPORT_CODE 32 | 33 | #include "SList.h" 34 | 35 | /* Iterate over a list of elements; returns ptr to a new element 36 | * in list upon every call and NULL when no more are left. 37 | * Very useful like this: 38 | * 39 | * cursor = mylist; 40 | * while ( (p=mylist->iterate(&cursor)) ) { 41 | * // place with element p 42 | * } 43 | * 44 | * The cursor must be initialized to point to the list to iterate over. 45 | */ 46 | void *SList:: 47 | iterate(SListNode **cursor) 48 | { 49 | void *e; 50 | 51 | if ( cursor == NULL || *cursor==NULL ) return NULL; 52 | if ( head == *cursor ) { *cursor = (*cursor)->next(); } 53 | e = (*cursor)->elem(); 54 | (*cursor) = (*cursor)->next(); 55 | return e; 56 | } 57 | 58 | /* add an element to end of list. */ 59 | void SList:: 60 | add(void *e) 61 | { 62 | SListNode *p, *tail=NULL; 63 | require(e!=NULL, "slist_add: attempting to add NULL list element"); 64 | 65 | p = new SListNode; 66 | require(p!=NULL, "add: cannot alloc new list node"); 67 | p->setElem(e); 68 | if ( head == NULL ) 69 | { 70 | head = tail = p; 71 | } 72 | else /* find end of list */ 73 | { 74 | tail->setNext(p); 75 | tail = p; 76 | } 77 | } 78 | 79 | void SList:: 80 | lfree() 81 | { 82 | SListNode *p,*q; 83 | 84 | if ( head==NULL ) return; /* empty list */ 85 | for (p = head; p!=NULL; p=q) 86 | { 87 | q = p->next(); 88 | free(p); 89 | } 90 | } 91 | 92 | PCCTS_AST *SList:: 93 | to_ast(SList list) 94 | { 95 | PCCTS_AST *t=NULL, *last=NULL; 96 | SListNode *p; 97 | 98 | for (p = head; p!=NULL; p=p->next()) 99 | { 100 | PCCTS_AST *u = (PCCTS_AST *)p->elem(); 101 | if ( last==NULL ) last = t = u; 102 | else { last->setRight(u); last = u; } 103 | } 104 | return t; 105 | } 106 | -------------------------------------------------------------------------------- /pccts/install68K.mpw: -------------------------------------------------------------------------------- 1 | # 2 | # File name install68K.mpw 3 | # 4 | # Description This script builds 68K version of antlr, dlg and sor. 5 | # and install them into Tools folder in your MPW. 6 | # They have commando interfaces. 7 | # 8 | # Installation Set Directory to the directory containing this file. 9 | # Enter "install68K.mpw" and press enter key. 10 | # 11 | # Requirements SC compiler 12 | # http://developer.apple.com/dev/tools/mpw-tools/compilers/index.html 13 | # 14 | # Author Kenji Tanaka (kentar@osa.att.ne.jp) 15 | # http://www.geocities.com/SiliconValley/Platform/5502/pccts 16 | # Created 06/16/98 17 | # Modified 12/14/98 18 | # 19 | 20 | Echo "# `Date -t` ----- Building 68K version of PCCTS tools." 21 | 22 | # Make 'Macintosh' folders to hold object files. 23 | 24 | Echo "# `Date -t` ----- Making Object File Folders." 25 | If (!`exists :dlg:Obj:`) 26 | NewFolder :dlg:Obj: 27 | End 28 | If (!`exists :antlr:Obj:`) 29 | NewFolder :antlr:Obj: 30 | End 31 | If (!`exists :sorcerer:Obj:`) 32 | NewFolder :sorcerer:Obj: 33 | End 34 | 35 | Echo "# `Date -t` ----- Done." 36 | Echo "#" 37 | 38 | # DLG build commands 39 | 40 | Echo "# `Date -t` ----- Building DLG." 41 | Echo "# `Date -t` ----- Analyzing dependencies." 42 | Directory :dlg: 43 | Begin 44 | Echo "Set Echo 1" 45 | Make Install -f dlg68K.make 46 | End > dlg.makeout 47 | Echo "# `Date -t` ----- Executing build commands." 48 | dlg.makeout 49 | Delete dlg.makeout 50 | Delete -y Obj 51 | 52 | Echo "# `Date -t` ----- Done." 53 | Echo "#" 54 | Directory :: 55 | 56 | # ANTLR build commands 57 | 58 | Echo "# `Date -t` ----- Building ANTLR." 59 | Echo "# `Date -t` ----- Analyzing dependencies." 60 | Directory :antlr: 61 | Begin 62 | Echo "Set Echo 1" 63 | Make Install -f antlr68K.make 64 | End > antlr.makeout 65 | antlr.makeout 66 | Delete antlr.makeout 67 | Delete -y Obj 68 | Echo "# `Date -t` ----- Done." 69 | Echo "#" 70 | Directory :: 71 | 72 | # SORCERER build commands 73 | 74 | Echo "# `Date -t` ----- Building SORCERER." 75 | Echo "# `Date -t` ----- Analyzing dependencies." 76 | Directory :sorcerer: 77 | Begin 78 | Echo "Set Echo 1" 79 | Make Install -f sor68K.make 80 | End > sorcerer.makeout 81 | sorcerer.makeout 82 | Delete sorcerer.makeout 83 | Delete -y Obj 84 | Echo "# `Date -t` ----- Done." 85 | Echo "#" 86 | Directory :: 87 | 88 | # Done 89 | 90 | Echo "# `Date -t` ----- Done Building 68K version of PCCTS tools." 91 | -------------------------------------------------------------------------------- /pccts/installPPC.mpw: -------------------------------------------------------------------------------- 1 | # File name installPPC.mpw 2 | # 3 | # Description This script builds PPC version of antlr, dlg and sor. 4 | # and install them into Tools folder in your MPW. 5 | # They have commando interfaces. 6 | # 7 | # Installation Set Directory to the directory containing this file. 8 | # Enter "installPPC.mpw" and press enter key. 9 | # 10 | # Requirements MrC(for PPC) compiler 11 | # http://developer.apple.com/dev/tools/mpw-tools/compilers/index.html 12 | # 13 | # Author Kenji Tanaka (kentar@osa.att.ne.jp) 14 | # http://www.geocities.com/SiliconValley/Platform/5502/pccts 15 | # Created 06/16/98 16 | # Modified 12/14/98 17 | 18 | Echo "# `Date -t` ----- Building PPC version of PCCTS tools." 19 | 20 | # Make 'Macintosh' folders to hold object files. 21 | 22 | Echo "# `Date -t` ----- Making Object File Folders." 23 | If (!`exists :dlg:Obj:`) 24 | NewFolder :dlg:Obj: 25 | End 26 | If (!`exists :antlr:Obj:`) 27 | NewFolder :antlr:Obj: 28 | End 29 | If (!`exists :sorcerer:Obj:`) 30 | NewFolder :sorcerer:Obj: 31 | End 32 | 33 | Echo "# `Date -t` ----- Done." 34 | Echo "#" 35 | 36 | # DLG build commands 37 | 38 | Echo "# `Date -t` ----- Building DLG." 39 | Echo "# `Date -t` ----- Analyzing dependencies." 40 | Directory :dlg: 41 | Begin 42 | Echo "Set Echo 1" 43 | Make Install -f dlgPPC.make 44 | End > dlg.makeout 45 | Echo "# `Date -t` ----- Executing build commands." 46 | dlg.makeout 47 | Delete dlg.makeout 48 | Delete -y Obj 49 | 50 | Echo "# `Date -t` ----- Done." 51 | Echo "#" 52 | Directory :: 53 | 54 | # ANTLR build commands 55 | 56 | Echo "# `Date -t` ----- Building ANTLR." 57 | Echo "# `Date -t` ----- Analyzing dependencies." 58 | Directory :antlr: 59 | Begin 60 | Echo "Set Echo 1" 61 | Make Install -f antlrPPC.make 62 | End > antlr.makeout 63 | antlr.makeout 64 | Delete antlr.makeout 65 | Delete -y Obj 66 | Echo "# `Date -t` ----- Done." 67 | Echo "#" 68 | Directory :: 69 | 70 | # SORCERER build commands 71 | 72 | Echo "# `Date -t` ----- Building SORCERER." 73 | Echo "# `Date -t` ----- Analyzing dependencies." 74 | Directory :sorcerer: 75 | Begin 76 | Echo "Set Echo 1" 77 | Make Install -f sorPPC.make 78 | End > sorcerer.makeout 79 | sorcerer.makeout 80 | Delete sorcerer.makeout 81 | Delete -y Obj 82 | Echo "# `Date -t` ----- Done." 83 | Echo "#" 84 | Directory :: 85 | 86 | 87 | # Done 88 | 89 | Echo "# `Date -t` ----- Done Building PPC version of PCCTS tools." 90 | -------------------------------------------------------------------------------- /pccts/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Main makefile for PCCTS 1.33MR20 /* MRXXX */ 3 | # 4 | # Terence Parr 5 | # Parr Research Corporation 6 | # 7 | # verbosity versus silence... 8 | PSss= 9 | # 10 | # this can be set to /user/local/bin etc... 11 | BINDIR=bin 12 | # This part added by Thomas Herter, M"unchen, Germany. See also manpages 13 | # target. 14 | MANDIR=$(HOME)/man 15 | MANEXT=1 16 | MANFILES=pccts.1 dlg/dlg.1 antlr/antlr.1 17 | 18 | #CC=cc 19 | 20 | .SILENT: 21 | 22 | pccts: 23 | echo " " 24 | echo " Welcome to PCCTS 1.33MR20a installation" 25 | echo " " 26 | echo " (Version 1.33 Maintenance Release #20a)" 27 | echo " " 28 | echo " Released 10 August 1999" 29 | echo " " 30 | echo " Featuring" 31 | echo " ANTLR -- ANother Tool for Language Recognition" 32 | echo " DLG -- DFA-based Lexical Analyzer Generator" 33 | echo " SORCERER -- Source-to-source translator (tree walker)" 34 | echo " " 35 | echo " http://www.antlr.org" 36 | echo " " 37 | echo " Trouble reports to tmoog@polhode.com" 38 | echo " Additional PCCTS 1.33 information at" 39 | echo " http://www.polhode.com" 40 | echo 41 | # 42 | if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi 43 | echo Making executables... 44 | (cd antlr; make -s) 45 | echo antlr executable now in $(BINDIR) 46 | (cd dlg; make -s) 47 | echo dlg executable now in $(BINDIR) 48 | echo 49 | echo " PCCTS 1.33MR20 installation complete" 50 | 51 | clean: 52 | (cd antlr; make -s clean) 53 | (cd dlg; make -s clean) 54 | 55 | 56 | manpages: 57 | if [ ! -d $(MANDIR) ] ; then mkdir $(MANDIR) ; fi 58 | cp -p $(MANFILES) $(MANDIR)/man$(MANEXT) 59 | -------------------------------------------------------------------------------- /pccts/support/DECmms/makefile.VMS: -------------------------------------------------------------------------------- 1 | $! File: MAKE.COM - Makefile for genmms OpenVMS 2 | $! 3 | $! History: 4 | $! --------- 5 | $! 28-Jan-1998 J.F. Pieronne V1.0. 6 | $! 7 | $ set noon !Don't stop on errors. 8 | $! 9 | $ if P1 .eqs. "LINK" then goto relink 10 | $! 11 | $! 12 | $ delete/nolog *.obj;* !Get rid of existing .OBJ files. 13 | $! 14 | $ options = "/INCLUDE=([--.h])/define=(__STDC__)" 15 | $ CC 'options' genmms 16 | $! 17 | $relink: 18 | $ LINK genmms, sys$input:/options 19 | ! sys$share:vaxcrtl.exe/share 20 | $ EXIT 21 | -------------------------------------------------------------------------------- /pccts/support/genmk/makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## 7-Apr-97 3 | ## added support/genmk/makefile to pccts 1.33MR1 distribution kit 4 | ## (support/genmk/makefile" omitted from 1.33 distribution kit) 5 | ## 6 | SRC=genmk.c 7 | OBJ=genmk.o 8 | # Define PC if you use a PC OS (changes directory symbol and object file extension) 9 | # see pccts/h/pcctscfg.h 10 | #CFLAGS=-I../../h -DPC 11 | CFLAGS=-I../../h 12 | CC=cc 13 | BAG=../../bin/bag 14 | 15 | genmk: $(OBJ) $(SRC) ../../h/pcctscfg.h 16 | $(CC) -o genmk $(OBJ) 17 | 18 | clean: 19 | rm -rf core *.o 20 | 21 | scrub: 22 | rm -rf genmk core *.o 23 | 24 | shar: 25 | shar genmk.c makefile > genmk.shar 26 | 27 | archive: 28 | $(BAG) genmk.c makefile > genmk.bag 29 | -------------------------------------------------------------------------------- /pccts/support/genmk/watgenmk.mak: -------------------------------------------------------------------------------- 1 | SET=..\..\support\set 2 | PCCTS_H=..\..\h 3 | 4 | # 5 | # Watcom 6 | # 7 | CC=wcl386 8 | ANTLR=..\..\bin\antlr 9 | DLG=..\..\bin\dlg 10 | CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC 11 | OUT_OBJ = -o 12 | OBJ_EXT = obj 13 | LINK = wcl386 14 | 15 | .c.obj : 16 | $(CC) -c $[* $(CFLAGS) 17 | 18 | genmk.exe: genmk.obj 19 | $(LINK) -fe=genmk.exe *.obj -k14336 20 | copy *.exe ..\..\bin 21 | 22 | #clean up all the intermediate files 23 | clean: 24 | del *.obj 25 | 26 | #remove everything in clean plus the PCCTS files generated 27 | scrub: 28 | del *.$(OBJ_EXT) 29 | -------------------------------------------------------------------------------- /pccts/support/rexpr/makefile: -------------------------------------------------------------------------------- 1 | BAG=../../bin/bag 2 | SRC=test.c rexpr.c 3 | OBJ=test.o rexpr.o 4 | CFLAGS = -g 5 | 6 | test: $(OBJ) $(SRC) 7 | cc -g -o texpr $(OBJ) 8 | 9 | shar: 10 | shar makefile test.c rexpr.c rexpr.h > rexpr.shar 11 | 12 | archive: 13 | $(BAG) makefile test.c rexpr.c rexpr.h > rexpr.bag 14 | 15 | clean: 16 | rm -rf *.o core texpr 17 | 18 | scrub: 19 | rm -rf *.o core texpr 20 | -------------------------------------------------------------------------------- /pccts/support/rexpr/rexpr.h: -------------------------------------------------------------------------------- 1 | #define Atom 256 /* token Atom (an impossible char value) */ 2 | #define Epsilon 257 /* epsilon arc (an impossible char value) */ 3 | 4 | /* track field must be same for all node types */ 5 | typedef struct _a { 6 | struct _a *track; /* track mem allocation */ 7 | int label; 8 | struct _a *next; 9 | struct _n *target; 10 | } Arc, *ArcPtr; 11 | 12 | typedef struct _n { 13 | struct _n *track; 14 | ArcPtr arcs, arctail; 15 | } Node, *NodePtr; 16 | 17 | typedef struct { 18 | NodePtr left, 19 | right; 20 | } Graph, *GraphPtr; 21 | 22 | #ifdef __USE_PROTOS 23 | int rexpr( char *expr, char *s ); 24 | int match( NodePtr automaton, char *s ); 25 | #else 26 | int rexpr(); 27 | int match(); 28 | #endif 29 | 30 | 31 | -------------------------------------------------------------------------------- /pccts/support/rexpr/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rexpr.h" 3 | 4 | /* 5 | * test for rexpr(). 6 | * To make this test: 7 | * cc -o rexpr test.c rexpr.c 8 | * Then from command line type: 9 | * rexpr r string 10 | * where r is the regular expression that decribes a language 11 | * and string is the string to verify. 12 | */ 13 | main(argc,argv) 14 | int argc; 15 | char *argv[]; 16 | { 17 | if ( argc!=3 ) fprintf(stderr,"rexpr: expr s\n"); 18 | else printf("%d\n", rexpr(argv[1], argv[2])); 19 | } 20 | -------------------------------------------------------------------------------- /pccts/support/sym/template.h: -------------------------------------------------------------------------------- 1 | /* T e m p l a t e F o r S y m b o l T a b l e M a n a g e r */ 2 | 3 | /* define some hash function */ 4 | #ifndef HASH 5 | #define HASH(p, h) while ( *p != '\0' ) h = (h<<1) + *p++; 6 | #endif 7 | 8 | /* minimum symbol table record */ 9 | typedef struct _sym { 10 | char *symbol; 11 | struct _sym *next, *prev, **head, *scope; 12 | unsigned int hash; 13 | } Sym, *SymPtr; 14 | 15 | #ifdef __USE_PROTOS 16 | void zzs_init(int, int); 17 | void zzs_done(void); 18 | void zzs_add(char *, Sym *); 19 | Sym *zzs_get(char *); 20 | void zzs_del(Sym *); 21 | void zzs_keydel(char *); 22 | Sym **zzs_scope(Sym **); 23 | Sym *zzs_rmscope(Sym **); 24 | void zzs_stat(void); 25 | Sym *zzs_new(char *); 26 | Sym *zzs_newadd(char *); 27 | char *zzs_strdup(char *); 28 | #else 29 | void zzs_init(); 30 | void zzs_done(); 31 | void zzs_add(); 32 | Sym *zzs_get(); 33 | void zzs_del(); 34 | void zzs_keydel(); 35 | Sym **zzs_scope(); 36 | Sym *zzs_rmscope(); 37 | void zzs_stat(); 38 | Sym *zzs_new(); 39 | Sym *zzs_newadd(); 40 | char *zzs_strdup(); 41 | #endif 42 | -------------------------------------------------------------------------------- /test/diff.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem DIFF.BAT 3 | rem This script should simulate the behaviour of Unix diff. 4 | rem As it stands it simply uses the FC.EXE command which 5 | rem is part of DOS. This does not give a useful return 6 | rem value, so the script must check the output using the 7 | rem for /f "usebackq" structure. 8 | 9 | if not "%2" == "" goto AfterUsage 10 | :usage 11 | echo DIFF [file1] [file2] 12 | goto :end 13 | 14 | :afterUsage 15 | set DIFFLEN= 16 | set CMD=fc %1 %2 17 | set DIFF_STATUS=0 18 | for /f "usebackq" %%l in ( `%CMD%` ) do ( 19 | if "%%l"=="Comparing" ( 20 | rem This is expected 21 | ) else if "%%l"=="FC:" ( 22 | rem This is also expected 23 | ) else ( 24 | rem If anything else comes out, the comparison found a difference 25 | set DIFF_STATUS=1 26 | ) 27 | ) 28 | exit /b %DIFF_STATUS% 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/posix.mak: -------------------------------------------------------------------------------- 1 | # Makefile to control testing of CCCC on POSIX platforms 2 | 3 | # Define the variables used by the platform-independent rules. 4 | CP=cp 5 | RMDIR=rm -rf 6 | MV=mv 7 | ECHO=echo 8 | DIFF=diff 9 | PATHSEP=/ 10 | CCCC=../cccc/cccc 11 | 12 | # include the file containing the platform independent rules. 13 | include rules.mak 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/prn1.cc: -------------------------------------------------------------------------------- 1 | /* static */ int yadda(STATIC* new_static, ssim_func_port_handle func_port) 2 | { 3 | #if !KC_USE_STATICS_VECTOR 4 | return X; 5 | #else 6 | return Y; 7 | #endif 8 | } 9 | -------------------------------------------------------------------------------- /test/prn1.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@anonymous@@ 2 | CCCC_Module@char@builtin@ 3 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 4 | CCCC_Module@double@builtin@ 5 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@float@builtin@ 7 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@int@builtin@ 9 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@long@builtin@ 11 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@void@builtin@ 13 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Member@anonymous@yadda@@(STATIC *,ssim_func_port_handle)@ 15 | CCCC_MemExt@anonymous@yadda@@(STATIC *,ssim_func_port_handle)@prn1.cc@1@definition@F????@LOC:5 COM:1 MVG:2@?@d@ 16 | CCCC_RejExt@prn1.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 17 | -------------------------------------------------------------------------------- /test/prn10.cc: -------------------------------------------------------------------------------- 1 | // prn10.cc 2 | // SourceForge bugtracker item 233584 3 | // submitted by Victor B Putz 4 | // Tests handling of data members and globals specified as 5 | // 'const static' and 'static const' as both are accepted by GCC. 6 | 7 | const static char csNonMember; 8 | static const char scNonMember; 9 | 10 | class A 11 | { 12 | const static char csMember; 13 | static const char scMember; 14 | }; 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/prn10.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@A@class@ 2 | CCCC_ModExt@A@class@prn10.cc@10@definition@?T??2@LOC:5 COM:0 MVG:0@2@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_RejExt@prn10.cc@1@@?T??2@LOC:2 COM:5 MVG:0@2@r@ 16 | -------------------------------------------------------------------------------- /test/prn10.xmlref: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | A 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | A 35 | 36 | definition 37 | 38 | 39 | 40 | 41 | 42 | 43 | A 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | A 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | A 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | <file scope items> 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /test/prn11.cc: -------------------------------------------------------------------------------- 1 | // prn11.cc 2 | // SourceForge bug tracker item 233585 3 | // Submitted by Victor B Putz 4 | // Tests parsing of namespace declarations 5 | // I am not confident that the present counting rules applying 6 | // to this construct are optimal yet. 7 | 8 | namespace A 9 | { 10 | void b( void ); 11 | }; 12 | 13 | void A::b( void ) 14 | { 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/prn11.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@A@@ 2 | CCCC_Module@anonymous@@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@A@b@@(void)@ 16 | CCCC_MemExt@A@b@@(void)@prn11.cc@13@definition@F????@LOC:3 COM:0 MVG:0@?@d@ 17 | CCCC_Member@anonymous@b@@(void)@ 18 | CCCC_MemExt@anonymous@b@@(void)@prn11.cc@10@declaration@F????@LOC:1 COM:0 MVG:0@?@D@ 19 | CCCC_RejExt@prn11.cc@1@@F????@LOC:3 COM:6 MVG:0@?@r@ 20 | -------------------------------------------------------------------------------- /test/prn12.cc: -------------------------------------------------------------------------------- 1 | // prn12.cc 2 | // SourceForge bug tracker item 233587 3 | // Submitted by Victor B Putz 4 | // Tests parsing of negative numbers as initializers. 5 | 6 | class C 7 | { 8 | int a; 9 | C( void ) : 10 | e( -1 ) {}; 11 | }; 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/prn12.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@C@class@ 2 | CCCC_ModExt@C@class@prn12.cc@6@definition@F???2@LOC:5 COM:4 MVG:0@2@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@C@C@@(void)@ 16 | CCCC_MemExt@C@C@@(void)@prn12.cc@9@definition@F???2@LOC:1 COM:0 MVG:0@2@d@ 17 | CCCC_RejExt@prn12.cc@1@@F???2@LOC:0 COM:0 MVG:0@2@r@ 18 | -------------------------------------------------------------------------------- /test/prn15.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@Image@@ 2 | CCCC_Module@Prn15@class@ 3 | CCCC_ModExt@Prn15@class@prn15.java@9@definition@?????@LOC:3 COM:5 MVG:0@?@d@ 4 | CCCC_Module@char@builtin@ 5 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@double@builtin@ 7 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@float@builtin@ 9 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@int@builtin@ 11 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@long@builtin@ 13 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Module@void@builtin@ 15 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 16 | CCCC_Member@Prn15@get_image@Image@(int)@ 17 | CCCC_MemExt@Prn15@get_image@Image@(int)@prn15.java@11@definition@????0@LOC:61 COM:0 MVG:42@?@d@ 18 | CCCC_UseRel@Image@Prn15@ 19 | CCCC_UseExt@Image@Prn15@prn15.java@11@return type@????0@*@?@p@ 20 | CCCC_RejExt@prn15.java@1@@?????@LOC:0 COM:0 MVG:0@?@r@ 21 | -------------------------------------------------------------------------------- /test/prn15.java: -------------------------------------------------------------------------------- 1 | // prn15.java 2 | 3 | // This test case looks at the effect of large 4 | // numbers of degenerate case labels. 5 | 6 | // It is based on a sample submitted by Jordan Zimmerman 7 | // which was apparently causing CCCC to hang. 8 | 9 | public class Prn15 10 | { 11 | public Image get_image(int image_code) 12 | { 13 | switch ( image_code ) 14 | { 15 | case cc_def.IMAGE_BUTTON_SUBMIT: 16 | case cc_def.IMAGE_BUTTON_SIGN_IN: 17 | case cc_def.IMAGE_BUTTON_SEARCH: 18 | case cc_def.IMAGE_BUTTON_SEARCH_CATEGORIES: 19 | case cc_def.IMAGE_BUTTON_PREVIOUS: 20 | case cc_def.IMAGE_BUTTON_PREVIOUS_GRAY: 21 | case cc_def.IMAGE_BUTTON_NEXT: 22 | case cc_def.IMAGE_BUTTON_NEXT_GRAY: 23 | case cc_def.IMAGE_BUTTON_GO_NAV: 24 | case cc_def.IMAGE_BUTTON_SIGN_IN_SECURE: 25 | case cc_def.IMAGE_BUTTON_GO_CONTENT: 26 | case cc_def.IMAGE_BUTTON_OK: 27 | case cc_def.IMAGE_CCMOS_BUTTON_OK: 28 | case cc_def.IMAGE_CCMOS_BUTTON_CANCEL: 29 | case cc_def.IMAGE_BUTTON_CANCEL: 30 | case cc_def.IMAGE_BUTTON_ADD_TO_CART: 31 | case cc_def.IMAGE_BUTTON_SAVE_TO_REGISTRY: 32 | case cc_def.IMAGE_BUTTON_ADD_CREDIT_CARD: 33 | case cc_def.IMAGE_BUTTON_ADD_REMINDER: 34 | case cc_def.IMAGE_BUTTON_UPDATE_REMINDER: 35 | case cc_def.IMAGE_BUTTON_CANCEL_REMINDER: 36 | case cc_def.IMAGE_BUTTON_SUGGEST_GIFTS: 37 | case cc_def.IMAGE_BUTTON_CONTINUE_SHOPPING_SMALL: 38 | case cc_def.IMAGE_BUTTON_CREATE_REGISTRY: 39 | case cc_def.IMAGE_BUTTON_UPDATE_REGISTRY: 40 | case cc_def.IMAGE_BUTTON_DELETE_REGISTRY: 41 | case cc_def.IMAGE_BUTTON_CONTINUE_SECURE: 42 | case cc_def.IMAGE_BUTTON_SEND_EMAIL: 43 | case cc_def.IMAGE_BUTTON_REDEEM_COUPON: 44 | case cc_def.IMAGE_BUTTON_REDEEM_CERTIFICATE: 45 | case cc_def.IMAGE_BUTTON_SHOW_CREDIT_BALANCE: 46 | case cc_def.IMAGE_BUTTON_HELP: 47 | case cc_def.IMAGE_BUTTON_CONTINUE: 48 | case cc_def.IMAGE_BUTTON_BACK: 49 | case cc_def.IMAGE_BUTTON_SHIP_IT: 50 | case cc_def.IMAGE_BUTTON_SKIP_TOUR: 51 | case cc_def.IMAGE_BUTTON_ECARD_PERSONALIZE: 52 | case cc_def.IMAGE_BUTTON_ECARD_VIEW: 53 | case cc_def.IMAGE_BUTTON_ECARD_SEND: 54 | case cc_def.IMAGE_BUTTON_ENTER: 55 | case cc_def.IMAGE_BUTTON_ADD_ADDRESS: 56 | { 57 | try 58 | { 59 | return get_dynamic_button(image_code); 60 | } 61 | catch ( ServletException the_exception ) 62 | { 63 | the_exception.printStackTrace(); 64 | return null; 65 | } 66 | } 67 | 68 | default: 69 | return null; 70 | } 71 | 72 | return null; 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /test/prn16.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@ImageOps@class@ 2 | CCCC_ModExt@ImageOps@class@prn16.java@35@definition@?????@LOC:3 COM:30 MVG:0@?@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@ImageOps@ImageOps@@()@ 16 | CCCC_MemExt@ImageOps@ImageOps@@()@prn16.java@37@definition@????0@LOC:1 COM:0 MVG:1@?@d@ 17 | CCCC_RejExt@prn16.java@1@@?????@LOC:0 COM:0 MVG:0@?@r@ 18 | -------------------------------------------------------------------------------- /test/prn16.java: -------------------------------------------------------------------------------- 1 | // prn16.java 2 | 3 | // This file is a minimal test case for a problem 4 | // reported by Colin Watson (maintainer of CCCC for 5 | // the Debian Linux distribution). 6 | 7 | // The problem reported by Colin related to unit test 8 | // prn14, for which the generated .db file differed 9 | // from the reference copy on some (but not all) 10 | // architecture platforms. The difference was the 11 | // inclusion in the .db file of a line which read: 12 | // CCCC_Module@@@ 13 | // This line implies that a module with an empty string 14 | // as its name has been added to the internal database 15 | // for some reason. 16 | 17 | // Colin was kind enough to investigate the problem and 18 | // come up with a minimal sample which triggered the problem 19 | // which the code of this example is based on. 20 | 21 | // On investigation, I found that the addition of the 22 | // module with the empty name is occurring as a result 23 | // of the parser executing the action associated with 24 | // the 'implementsClause' rule defined in java.g 25 | // despite the fact that the 'implements' keyword 26 | // does not appear (outside the comment) in the sample 27 | // code. The action for this rule contains a call 28 | // to ParseStore::record_userel_extent. 29 | // For the moment, I lack the energy to work out why 30 | // the generated parser code is executing this action, 31 | // however I have modified the code of record_userel_extent 32 | // to check client and server name and do 33 | // nothing if either is the empty string. 34 | 35 | public class ImageOps /* implements ChangeListener */ 36 | { 37 | public ImageOps() { for (int i = 0;;) {} } 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/prn2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * A L F _ PRINT. C X X 3 | * 4 | * This file contains print routines for ALF. 5 | * 6 | * Copyright (c) 1998, Sente Inc. 7 | * 8 | * $Id: prn2.cc,v 1.1.1.1 2001/04/12 16:06:50 tim_littlefair Exp $ 9 | */ 10 | 11 | #include 12 | #include "utils.h" 13 | #include "AlfObject.hxx" 14 | 15 | void alfPrintSpaces(int numTabs, FILE* fp) 16 | { 17 | int numBlanks; 18 | for (numBlanks = 0; numBlanks < 4*numTabs; numBlanks++) 19 | fprintf(fp,"%c",' '); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test/prn2.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@anonymous@@ 2 | CCCC_Module@char@builtin@ 3 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 4 | CCCC_Module@double@builtin@ 5 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@float@builtin@ 7 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@int@builtin@ 9 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@long@builtin@ 11 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@void@builtin@ 13 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Member@anonymous@alfPrintSpaces@@(int,FILE *)@ 15 | CCCC_MemExt@anonymous@alfPrintSpaces@@(int,FILE *)@prn2.cc@15@definition@F????@LOC:6 COM:9 MVG:1@?@d@ 16 | CCCC_RejExt@prn2.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 17 | -------------------------------------------------------------------------------- /test/prn3.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@A@struct@ 2 | CCCC_ModExt@A@struct@prn3.cc@93@definition@FT??0@LOC:9 COM:6 MVG:0@0@d@ 3 | CCCC_Module@FP@class@ 4 | CCCC_ModExt@FP@class@prn3.cc@77@definition@FT??2@LOC:5 COM:0 MVG:0@2@d@ 5 | CCCC_Module@Hugo@class@ 6 | CCCC_ModExt@Hugo@class@prn3.cc@156@definition@FT??2@LOC:9 COM:9 MVG:0@2@d@ 7 | CCCC_Module@Hugo_2@class@ 8 | CCCC_ModExt@Hugo_2@class@prn3.cc@134@definition@FT??2@LOC:9 COM:8 MVG:0@2@d@ 9 | CCCC_Module@InlFunc@class@ 10 | CCCC_ModExt@InlFunc@class@prn3.cc@47@definition@F???2@LOC:4 COM:43 MVG:0@2@d@ 11 | CCCC_Module@anonymous@@ 12 | CCCC_Module@char@builtin@ 13 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Module@double@builtin@ 15 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 16 | CCCC_Module@float@builtin@ 17 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 18 | CCCC_Module@int@builtin@ 19 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 20 | CCCC_Module@long@builtin@ 21 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 22 | CCCC_Module@void@builtin@ 23 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 24 | CCCC_Member@Hugo@Hugo@@()@ 25 | CCCC_MemExt@Hugo@Hugo@@()@prn3.cc@159@declaration@FT??0@LOC:1 COM:0 MVG:0@0@D@ 26 | CCCC_Member@Hugo@~Hugo@@()@ 27 | CCCC_MemExt@Hugo@~Hugo@@()@prn3.cc@160@declaration@FT??0@LOC:1 COM:0 MVG:0@0@D@ 28 | CCCC_Member@Hugo_2@Hugo_2@@()@ 29 | CCCC_MemExt@Hugo_2@Hugo_2@@()@prn3.cc@137@declaration@FT??0@LOC:1 COM:0 MVG:0@0@D@ 30 | CCCC_Member@Hugo_2@~Hugo_2@@()@ 31 | CCCC_MemExt@Hugo_2@~Hugo_2@@()@prn3.cc@138@declaration@FT??0@LOC:1 COM:0 MVG:0@0@D@ 32 | CCCC_Member@InlFunc@InlFunc@@()@ 33 | CCCC_MemExt@InlFunc@InlFunc@@()@prn3.cc@50@declaration@F???0@LOC:1 COM:0 MVG:0@0@D@ 34 | CCCC_Member@InlFunc@getFunc@@()@ 35 | CCCC_MemExt@InlFunc@getFunc@@()@prn3.cc@52@declaration@F???0@LOC:1 COM:0 MVG:0@0@D@ 36 | CCCC_Member@InlFunc@~InlFunc@@()@ 37 | CCCC_MemExt@InlFunc@~InlFunc@@()@prn3.cc@51@declaration@F???0@LOC:1 COM:0 MVG:0@0@D@ 38 | CCCC_Member@anonymous@getInt@@()@ 39 | CCCC_MemExt@anonymous@getInt@@()@prn3.cc@76@declaration@FT??2@LOC:1 COM:6 MVG:0@2@D@ 40 | CCCC_RejExt@prn3.cc@1@@FT??2@LOC:3 COM:21 MVG:0@2@r@ 41 | -------------------------------------------------------------------------------- /test/prn4.cc: -------------------------------------------------------------------------------- 1 | // prn4.cc 2 | 3 | // Classes with namespace qualifiers should have their name 4 | // reduced to the final component. In versions prior to 3.pre45 5 | // this did not happen. On Unix systems the result was reports 6 | // with names like std::string.html. On Win32, the colon is not 7 | // legal in file names and the report generation process terminates early. 8 | 9 | void MyClass::someFunction(const std::string& s) 10 | { 11 | // do nothing 12 | } 13 | 14 | -------------------------------------------------------------------------------- /test/prn4.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@MyClass@@ 2 | CCCC_Module@char@builtin@ 3 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 4 | CCCC_Module@double@builtin@ 5 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@float@builtin@ 7 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@int@builtin@ 9 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@long@builtin@ 11 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@string@@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@MyClass@someFunction@@(const string &)@ 16 | CCCC_MemExt@MyClass@someFunction@@(const string &)@prn4.cc@9@definition@F????@LOC:3 COM:7 MVG:0@?@d@ 17 | CCCC_UseRel@string@MyClass@ 18 | CCCC_UseExt@string@MyClass@prn4.cc@9@pass by reference@?????@*@?@p@ 19 | CCCC_RejExt@prn4.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 20 | -------------------------------------------------------------------------------- /test/prn5.cc: -------------------------------------------------------------------------------- 1 | // prn5.cc 2 | // Prior to version 3.pre45, use of builtin types like char, int 3 | // in parameter lists led to spurious relationships being registered 4 | // to non-existent types 'char ', 'int '. 5 | 6 | void MyClass::someFunction(char c) 7 | { 8 | // do nothing 9 | } 10 | -------------------------------------------------------------------------------- /test/prn5.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@MyClass@@ 2 | CCCC_Module@char@builtin@ 3 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 4 | CCCC_Module@double@builtin@ 5 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@float@builtin@ 7 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@int@builtin@ 9 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@long@builtin@ 11 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@void@builtin@ 13 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Member@MyClass@someFunction@@(char)@ 15 | CCCC_MemExt@MyClass@someFunction@@(char)@prn5.cc@6@definition@F????@LOC:3 COM:5 MVG:0@?@d@ 16 | CCCC_RejExt@prn5.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 17 | -------------------------------------------------------------------------------- /test/prn6.cc: -------------------------------------------------------------------------------- 1 | 2 | int64 bbb::mbr = 3 | aaa::b01 | 4 | aaa::b02 | 5 | aaa::b02 | 6 | aaa::b03 | 7 | aaa::b04 | 8 | aaa::b05 | 9 | aaa::b06 | 10 | aaa::b07 | 11 | aaa::b08 | 12 | aaa::b09 | 13 | aaa::b10 | 14 | aaa::b11 | 15 | aaa::b12 | 16 | aaa::b13 | 17 | aaa::b14; 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/prn6.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@char@builtin@ 2 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 3 | CCCC_Module@double@builtin@ 4 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@float@builtin@ 6 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@int@builtin@ 8 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@long@builtin@ 10 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@void@builtin@ 12 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_RejExt@prn6.cc@1@@?????@LOC:16 COM:0 MVG:0@?@r@ 14 | -------------------------------------------------------------------------------- /test/prn6.xmlref: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | <file scope items> 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/prn7.c: -------------------------------------------------------------------------------- 1 | // prn7.c 2 | // Test case submitted by Larry Peters of ATI 3 | // ******************************************************************** 4 | // * 5 | // * cccc Sample code 6 | // * 7 | // ******************************************************************** 8 | #include 9 | 10 | /////////////////////////////////////////////////////////////////////// 11 | // First issue has to do with struct typedefs using the ugly MS style 12 | // of declaring pointer typedefs for the struct following the struct 13 | // definition: 14 | 15 | typedef struct MY_STRUCT 16 | { 17 | int _iVal; 18 | long _lVal; 19 | char *_pszVal; 20 | } MYSTRUCT,*PMYSTRUCT,*LPMYSTRUCT; // These last two cause errors! 21 | 22 | /////////////////////////////////////////////////////////////////////// 23 | // The second issue has to do with multiple line string literals. 24 | // There are two problems here: the first is handling multiple line 25 | // literals -- should just be a grammar change (see below). The second 26 | // problem I think may require a pre-processor (yuck). Take a look and 27 | // let me know what you think: 28 | char szSimpleOne[] = "Test 1" "This is OK too" 29 | "so is this!"; // Ugly but legal... 30 | 31 | /* 32 | // This one is too hard for the time being. 33 | // I can't see a way to fix it without going against the 34 | // design rule that CCCC does not run (or fake) the preprocessor 35 | #define MY_STR "BLAH!" 36 | 37 | char szDifficultOne[] = "Test 1" MY_STR 38 | "yuck!"; // Again, ugly but legal... 39 | 40 | */ 41 | 42 | /////////////////////////////////////////////////////////////////////// 43 | // This last one involves using the sizeof operator in the "global" 44 | // scope. 45 | 46 | // This one fails 47 | long lVal = sizeof( long ); 48 | 49 | void main() 50 | { 51 | // This one works! 52 | long lVal2 = sizeof( long ); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /test/prn7.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@anonymous@@ 2 | CCCC_Module@char@builtin@ 3 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 4 | CCCC_Module@double@builtin@ 5 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 6 | CCCC_Module@float@builtin@ 7 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 8 | CCCC_Module@int@builtin@ 9 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@long@builtin@ 11 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@void@builtin@ 13 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Member@anonymous@main@@()@ 15 | CCCC_MemExt@anonymous@main@@()@prn7.c@49@definition@F???0@LOC:4 COM:1 MVG:0@0@d@ 16 | CCCC_RejExt@prn7.c@1@@F???0@LOC:9 COM:33 MVG:0@0@r@ 17 | -------------------------------------------------------------------------------- /test/prn8.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@EwoisErrorHandler@class@ 2 | CCCC_ModExt@EwoisErrorHandler@class@prn8.java@5@definition@?????@LOC:5 COM:3 MVG:0@?@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@EwoisErrorHandler@handleError@void@(int)@ 16 | CCCC_MemExt@EwoisErrorHandler@handleError@void@(int)@prn8.java@7@definition@????0@LOC:15 COM:0 MVG:5@?@d@ 17 | CCCC_RejExt@prn8.java@1@@?????@LOC:0 COM:0 MVG:0@?@r@ 18 | -------------------------------------------------------------------------------- /test/prn8.java: -------------------------------------------------------------------------------- 1 | // prn8.java 2 | // SF Bugtracker bug #226676 3 | // reported by Eric Pischel 4 | 5 | public class EwoisErrorHandler 6 | { 7 | public synchronized void handleError( int fehlertyp ) 8 | { 9 | String lvTyp = ""; 10 | switch (fehlertyp) 11 | { 12 | case WARNING: 13 | lvTyp = "Warnung"; 14 | break; 15 | case LOGINFO: 16 | lvTyp = "LogInfo"; 17 | break; 18 | } 19 | StringBuffer buffer = new StringBuffer(lvTyp); 20 | buffer.append("Zeit: ").append(""); 21 | } 22 | int WARNING = 1; 23 | int LOGINFO = 2; 24 | } 25 | -------------------------------------------------------------------------------- /test/prn9.cc: -------------------------------------------------------------------------------- 1 | // PRN9.cc 2 | // SourceForge bug tracker item 233548 3 | // Submitted by Victor B Putz 4 | // Tests handling of inheritance relationships specified as 'public virtual' 5 | // and 'virtual public' as both are accepted by GCC. 6 | 7 | class A 8 | { 9 | }; 10 | 11 | class B : public virtual A 12 | { 13 | }; 14 | 15 | class C : virtual public A 16 | { 17 | }; 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/prn9.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@A@class@ 2 | CCCC_ModExt@A@class@prn9.cc@7@definition@????2@LOC:3 COM:5 MVG:0@2@d@ 3 | CCCC_Module@B@class@ 4 | CCCC_ModExt@B@class@prn9.cc@11@definition@????0@LOC:3 COM:0 MVG:0@0@d@ 5 | CCCC_Module@C@class@ 6 | CCCC_ModExt@C@class@prn9.cc@15@definition@????0@LOC:3 COM:0 MVG:0@0@d@ 7 | CCCC_Module@char@builtin@ 8 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@double@builtin@ 10 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@float@builtin@ 12 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@int@builtin@ 14 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Module@long@builtin@ 16 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 17 | CCCC_Module@void@builtin@ 18 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 19 | CCCC_UseRel@A@B@ 20 | CCCC_UseExt@A@B@prn9.cc@11@inheritance@????0@*@0@I@ 21 | CCCC_UseRel@A@C@ 22 | CCCC_UseExt@A@C@prn9.cc@15@inheritance@????0@*@0@I@ 23 | CCCC_RejExt@prn9.cc@1@@????0@LOC:0 COM:0 MVG:0@0@r@ 24 | -------------------------------------------------------------------------------- /test/run_test.bat: -------------------------------------------------------------------------------- 1 | @rem run_test.bat 2 | @rem This script replaces the action of the make program in running 3 | @rem the tests described in rules.mak as there is no make provided 4 | @rem with Microsoft Visual C++ Toolkit 2003. 5 | 6 | @rem the first test case is exercises the logic for procedural metrics 7 | @rem the second test case is exercises the logic for structural metrics 8 | @rem the third test case is exercises the logic for metrics arising out of the 9 | @rem work of Chidamber and Kemerer 10 | @rem the fourth test case applies to the ability to specify an option 11 | @rem file to control CCCC's policies for parsing and presentation 12 | 13 | @rem regression tests 14 | @rem PRN1 and PRN2 sent in by Kenneth H. Cox 15 | @rem PRN3 sent in by Dr D. Ruppert, against CCCC 3.pre39 16 | @rem PRN4 prepared by TL to check for problems with classes being mapped 17 | @rem to modules via their qualified name (CCCC policy is that the simple name 18 | @rem is used) 19 | @rem PRN5 prepared by TL to check for problem due to relationships being 20 | @rem created involving built-in types 21 | @rem PRN6 based on a test case reported by ??? 22 | @rem PRN7 based on a test case reported by Larry Peters of ATI 23 | @rem PRN8 based on a test case reported by Eric Pischel 24 | @rem PRN9-PRN12 based on test cases reported by Victor B Putz 25 | @rem PRN13-PRN14 based on example programs from Sun's Java Tutorial. 26 | @rem PRN15 based on a test case reported by Jordan Zimmerman 27 | @rem PRN16 based on a test case reported by Colin Watson 28 | 29 | @echo off 30 | 31 | set MODE=%1 32 | set TEST=%2 33 | 34 | set CCCC=..\cccc\cccc.exe 35 | set DIFF=call diff.bat 36 | set RM=del 37 | set RMDIR=rmdir 38 | set MV=rename 39 | set ECHO=echo 40 | 41 | if "%TEST%"=="" then goto :usage 42 | 43 | if "%MODE%"=="c" ( 44 | call run_test_c.bat 45 | goto :checkStatus 46 | ) else if "%MODE%"=="cc" ( 47 | call run_test_cc.bat 48 | goto :checkStatus 49 | ) else if "%MODE%"=="java" ( 50 | call run_test_java.bat 51 | goto :checkStatus 52 | ) else if "%MODE%"=="test4" ( 53 | call run_test_test4.bat 54 | goto :checkStatus 55 | ) else goto :usage 56 | 57 | :checkStatus 58 | set OVERALL_STATUS=%CCCC_STATUS%%DBDIFF_STATUS%%HTMLDIFF_STATUS%%XMLDIFF_STATUS% 59 | if not "%OVERALL_STATUS%"=="0000" ( 60 | echo Problem found: 61 | echo CCCC returned %CCCC_STATUS% 62 | echo DB diff returned %DBDIFF_STATUS% 63 | echo HTML diff returned %HTMLDIFF_STATUS% 64 | echo XML diff returned %XMLDIFF_STATUS% 65 | pause 66 | ) else ( 67 | echo test %TEST% passed 68 | ) 69 | goto :end 70 | 71 | :usage 72 | echo run_test [mode] [test] 73 | echo [mode] is one of c, cc, java, test4 74 | echo [test] is one of test1..test4, prn1..prn16 75 | goto :end 76 | 77 | 78 | :end 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /test/run_test_c.bat: -------------------------------------------------------------------------------- 1 | @rem run_test_c.bat 2 | @rem This script depends on environment variables set up in run_test.bat 3 | %CCCC% --report_mask=cspPrRojh --db_outfile=%TEST%.db --html_outfile=%TEST%.html --xml_outfile=%TEST%.xml %TEST%.c 4 | set CCCC_STATUS=%ERRORLEVEL% 5 | %DIFF% %TEST%.db %TEST%.dbref 6 | set DBDIFF_STATUS=%DIFF_STATUS% 7 | %DIFF% %TEST%.html %TEST%.htmlref 8 | set HTMLDIFF_STATUS=%DIFF_STATUS% 9 | %DIFF% %TEST%.xml %TEST%.xmlref 10 | set XMLDIFF_STATUS=%DIFF_STATUS% 11 | 12 | -------------------------------------------------------------------------------- /test/run_test_cc.bat: -------------------------------------------------------------------------------- 1 | @rem run_test_cc.bat 2 | @This script depends on environment variables set up in run_test.bat 3 | %CCCC% --report_mask=cspPrRojh --db_outfile=%TEST%.db --html_outfile=%TEST%.html --xml_outfile=%TEST%.xml %TEST%.cc 4 | set CCCC_STATUS=%ERRORLEVEL% 5 | %DIFF% %TEST%.db %TEST%.dbref 6 | set DBDIFF_STATUS=%DIFF_STATUS% 7 | %DIFF% %TEST%.html %TEST%.htmlref 8 | set HTMLDIFF_STATUS=%DIFF_STATUS% 9 | %DIFF% %TEST%.xml %TEST%.xmlref 10 | set XMLDIFF_STATUS=%DIFF_STATUS% 11 | 12 | -------------------------------------------------------------------------------- /test/run_test_java.bat: -------------------------------------------------------------------------------- 1 | @rem run_test_java.bat 2 | @This script depends on environment variables set up in run_test.bat 3 | %CCCC% --report_mask=cspPrRojh --db_outfile=%TEST%.db --html_outfile=%TEST%.html --xml_outfile=%TEST%.xml %TEST%.java 4 | set CCCC_STATUS=%ERRORLEVEL% 5 | %DIFF% %TEST%.db %TEST%.dbref 6 | set DBDIFF_STATUS=%DIFF_STATUS% 7 | %DIFF% %TEST%.html %TEST%.htmlref 8 | set HTMLDIFF_STATUS=%DIFF_STATUS% 9 | %DIFF% %TEST%.xml %TEST%.xmlref 10 | set XMLDIFF_STATUS=%DIFF_STATUS% 11 | 12 | -------------------------------------------------------------------------------- /test/run_test_test4.bat: -------------------------------------------------------------------------------- 1 | @rem run_test_test4.bat 2 | @This script depends on environment variables set up in run_test.bat 3 | %CCCC% --opt_infile=test4.opt --report_mask=cspPrRojh --db_outfile=test4.db --html_outfile=test4.html --xml_outfile=test4.xml %TEST%.cc 4 | set CCCC_STATUS=%DIFF_STATUS% 5 | %DIFF% %TEST%.db %TEST%.dbref 6 | set DBDIFF_STATUS=%DIFF_STATUS% 7 | %DIFF% %TEST%.html %TEST%.htmlref 8 | set HTMLDIFF_STATUS=%DIFF_STATUS% 9 | %DIFF% %TEST%.xml %TEST%.xmlref 10 | set XMLDIFF_STATUS=%DIFF_STATUS% 11 | 12 | -------------------------------------------------------------------------------- /test/test1.cc: -------------------------------------------------------------------------------- 1 | //## test1.cc 2 | //## test case illustrating simple procedural metrics 3 | //## Lines starting //## are ignored by CCCC so they will be used in this 4 | //## file for explanatory comments (as opposed to comments which we wish 5 | //## to count). 6 | //## The file is annotated along the way with comment lines like these 7 | //## scope/comment LOC COM MVG 8 | //## definition of class Test1 (start) 0 0 0 9 | //## running totals 0 0 0 10 | //## definition of class Test1 (end) 0 0 0 11 | //## Note that extents nest, so there is effectively a stack of 12 | //## running totals for each extent open at a particular point in a file 13 | 14 | //## definition of class Test1 (start) 0 0 0 15 | // Leading comment for class. 16 | class Test1 17 | { 18 | //## running totals 2 1 0 19 | // Internal comment for class. 20 | // This should not be associated with the following function due to 21 | // the intervening visibility declaration. 22 | //## running totals 2 4 0 23 | public: 24 | //## running totals for definition of class Test1 (push) 3 4 0 25 | //## definition of method Test1::method1 (start) 0 0 0 26 | // Leading comment for inline method 27 | void method1() 28 | { 29 | //## running totals 2 1 0 30 | int s=1; 31 | switch(s) 32 | //## running totals 4 1 1 33 | { 34 | case 1: 35 | break; 36 | //## running totals 7 1 2 37 | case 2: 38 | break; 39 | //## running totals 9 1 3 40 | default: 41 | break; 42 | //## running totals 11 1 4 43 | } 44 | } 45 | //## definition of method Test1::method1 (end) 13 1 4 46 | //## running totals for definition of class Test1 (pop+push) 3 4 0 47 | //## declaration of method Test1::method2 (start) 0 0 0 48 | void method2(); 49 | //## declaration of method Test1::method2 (end) 1 0 0 50 | //## running totals for definition of class Test1 (pop) 3 4 0 51 | }; 52 | //## definition of class Test1 (end) 4 4 0 53 | 54 | //## definition of method Test1::method2 (start) 0 0 0 55 | void Test1::method2() 56 | { 57 | if(1) 58 | { 59 | // do nothing 60 | } 61 | } 62 | //## definition of method Test1::method2 (end) 6 1 1 63 | 64 | //## after processing the whole file we expect to find the following 65 | //## extents recognized and mentioned in the .db file 66 | //## definition of class Test1 LOC:4 COM:4 MVG:0 67 | //## definition of method Test1::method1 LOC:13 COM:1 MVG:4 68 | //## declaration of method Test1::method2 LOC:1 COM:0 MVG:0 69 | //## definition of method Test1::method2 LOC:6 COM:1 MVG:1 70 | -------------------------------------------------------------------------------- /test/test1.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@Test1@class@ 2 | CCCC_ModExt@Test1@class@test1.cc@16@definition@F???2@LOC:4 COM:4 MVG:0@2@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@Test1@method1@@()@ 16 | CCCC_MemExt@Test1@method1@@()@test1.cc@27@definition@F???0@LOC:13 COM:1 MVG:4@0@d@ 17 | CCCC_Member@Test1@method2@@()@ 18 | CCCC_MemExt@Test1@method2@@()@test1.cc@48@declaration@F???0@LOC:1 COM:0 MVG:0@0@D@ 19 | CCCC_MemExt@Test1@method2@@()@test1.cc@55@definition@F????@LOC:6 COM:1 MVG:1@?@d@ 20 | CCCC_RejExt@test1.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 21 | -------------------------------------------------------------------------------- /test/test2.cc: -------------------------------------------------------------------------------- 1 | //## test2.cc 2 | //## test source file for the structural metrics measured by CCCC. 3 | //## 4 | //## This file defines the following classes: 5 | //## Test2a 6 | //## Test2b 7 | //## Test2c 8 | //## It also defines the following method 9 | //## Test2e::Test2e(const Test2a&) 10 | 11 | //## The following relationships should be visible in the code: 12 | //## Test2a uses Test2e by inheritance with public visibility 13 | //## Test2a uses Test2b by containment by reference with public visibility 14 | //## Test2a uses Test2b by parameter passing by value with private visibility 15 | //## Test2c uses uses Test2d by containment by value with protected visibility 16 | //## Test2e uses Test2a by parameter passing by value with unknown visibility 17 | 18 | class Test2a : public Test2e 19 | { 20 | public: 21 | Test2b *m_2b; 22 | private: 23 | void doSomething(Test2b); 24 | }; 25 | 26 | class Test2c 27 | { 28 | protected: 29 | Test2d m_2d; 30 | }; 31 | 32 | //## The extent record for the following class definition would normally be 33 | //## brought into the database alongside the extent record for the declaration 34 | //## of the method within the class definition, allowing the visibility to be 35 | //## known. In this case, we are choosing to analyze this definition without 36 | //## that knowledge, hence the visibility of the method cannot be inferred and 37 | //## the analyzer should assume that it is of the less desirable visible 38 | //## classification. 39 | Test2e::Test2e(const Test2a&) 40 | { 41 | } 42 | 43 | //## The code above should give rise to the following relationships 44 | //## The annotations [], [C], [V], [CV] show how the relationship is 45 | //## classified on the two scales concrete/abstract and visible/hidden 46 | //## where abstract relationships are ones where the supplier is treated 47 | //## as an opaque type for the purposes of the interface (i.e. containment 48 | //## or parameter passing by reference), and hidden ones are where the 49 | //## supplier is known not to appear in the protected or public interface of 50 | //## the client. 51 | //## Class Clients Suppliers 52 | //## Test2a Test2d[V] Test2e[V],Test2b[CV] 53 | //## Test2b Test2a[CV] 54 | //## Test2c Test2d[CV] 55 | //## Test2d Test2d[CV] Test2a[V] 56 | //## Test2e Test2a[CV] 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /test/test2.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@Test2a@class@ 2 | CCCC_ModExt@Test2a@class@test2.cc@18@definition@F???0@LOC:6 COM:0 MVG:0@0@d@ 3 | CCCC_Module@Test2b@@ 4 | CCCC_Module@Test2c@class@ 5 | CCCC_ModExt@Test2c@class@test2.cc@26@definition@F???2@LOC:5 COM:0 MVG:0@2@d@ 6 | CCCC_Module@Test2d@@ 7 | CCCC_Module@Test2e@@ 8 | CCCC_Module@char@builtin@ 9 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 10 | CCCC_Module@double@builtin@ 11 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 12 | CCCC_Module@float@builtin@ 13 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 14 | CCCC_Module@int@builtin@ 15 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 16 | CCCC_Module@long@builtin@ 17 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 18 | CCCC_Module@void@builtin@ 19 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 20 | CCCC_Member@Test2a@doSomething@@(Test2b)@ 21 | CCCC_MemExt@Test2a@doSomething@@(Test2b)@test2.cc@23@declaration@F???2@LOC:1 COM:0 MVG:0@2@D@ 22 | CCCC_Member@Test2e@Test2e@@(const Test2a &)@ 23 | CCCC_MemExt@Test2e@Test2e@@(const Test2a &)@test2.cc@39@definition@F????@LOC:3 COM:0 MVG:0@?@d@ 24 | CCCC_UseRel@Test2b@Test2a@ 25 | CCCC_UseExt@Test2b@Test2a@test2.cc@21@has by reference@????0@LOC:0 COM:0 MVG:0@0@h@ 26 | CCCC_UseExt@Test2b@Test2a@test2.cc@23@pass by value@F???2@*@2@P@ 27 | CCCC_UseRel@Test2e@Test2a@ 28 | CCCC_UseExt@Test2e@Test2a@test2.cc@18@inheritance@????0@*@0@I@ 29 | CCCC_UseRel@Test2d@Test2c@ 30 | CCCC_UseExt@Test2d@Test2c@test2.cc@29@has by value@F???1@LOC:0 COM:0 MVG:0@1@H@ 31 | CCCC_UseRel@Test2a@Test2e@ 32 | CCCC_UseExt@Test2a@Test2e@test2.cc@39@pass by reference@F????@*@?@p@ 33 | CCCC_RejExt@test2.cc@1@@F????@LOC:0 COM:0 MVG:0@?@r@ 34 | -------------------------------------------------------------------------------- /test/test3.cc: -------------------------------------------------------------------------------- 1 | //## test3.cc 2 | //## This file is intended to test the performance of CCCC in measurement 3 | //## of the metrics described in the papers by Chidamber and Kemerer 4 | //## about 'a metrics suite for object oriented design'. 5 | 6 | //## Test3a attempts to check the values for WMC1 and WMCv 7 | //## When I was originally writing this class I found some bugs in the 8 | //## handling of operator functions, hence the fact that they are 9 | //## extensively used in this item. 10 | class Test3a 11 | { 12 | public: 13 | Test3a(); 14 | ~Test3a(); 15 | operator new(); 16 | operator delete[](); 17 | protected: 18 | operator!=(); 19 | operator unsigned long int(); 20 | private: 21 | operator==(); 22 | operator ()(); 23 | operator [](); 24 | operator*(); 25 | operator.*(); 26 | do_something(); 27 | do_something_else(); 28 | }; 29 | //## Manual count of the above definition yields WMC1=13, WMCv=6 (including 30 | //## protected functions which we treat as visible). 31 | 32 | //## Test3b1 to Test3b5 attempt to test the logic for DIT, NOC and CBO. 33 | class Test3b1 : public Test3b0 {}; 34 | class Test3b2 : public Test3b1 {}; 35 | class Test3b4 : public Test3b3, public Test3b0, public Test3b2 {}; 36 | class Test3b5 37 | { 38 | public: 39 | Test3b5(Test3b3); 40 | private: 41 | Test3b0 m_3b0; 42 | }; 43 | 44 | //## Should get the following values: 45 | //## class DIT NOC CBO 46 | //## Test3b0 0 2 3 47 | //## Test3b1 1 1 2 48 | //## Test3b2 2 1 2 49 | //## Test3b3 0 1 2 50 | //## Test3b4 3 0 3 51 | //## Test3b5 0 0 2 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /test/test4.cc: -------------------------------------------------------------------------------- 1 | //## test4.cc 2 | //## This file is intended to test the operation of the CCCC feature 3 | //## of being able to define an options file which affects the 4 | //## execution of CCCC in a number of ways. 5 | //## There is a companion file test4.opt which modifies the behaviour 6 | //## of CCCC in the following ways: 7 | //## display format of L_C has one decimal place; 8 | //## threshold for L_C to be displayed in red is 3.0 9 | //## default dialect assignment for extension .cc is set to c++.test4 10 | //## treatment of the pseudo-keyword TEST4_EXT in dialect c++.test4 is 11 | //## to be ignored. 12 | //## Ultimately, the format of the opt file needs to be documented, 13 | //## for the time being users keen to try the facility out may be 14 | //## able to infer enough to apply it to their needs by reading 15 | //## rules.mak to see how to invoke cccc with the opt file 16 | //## output, and by diffing test4.opt against vanilla.opt, 17 | //## which contains the version of the opt file obtained when 18 | //## the compiled-in default options (see cccc_opt.cc) are 19 | //## exported using 'cccc --opt_outfile=vanilla.opt' 20 | 21 | class Test4a 22 | { 23 | public: 24 | TEST4_EXT void dummy() 25 | { 26 | // Comment line one 27 | // Comment line two 28 | int i; 29 | i = 1; 30 | i = 2; 31 | i = 3; 32 | } 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /test/test4.dbref: -------------------------------------------------------------------------------- 1 | CCCC_Module@Test4a@class@ 2 | CCCC_ModExt@Test4a@class@test4.cc@21@definition@F???2@LOC:4 COM:0 MVG:0@2@d@ 3 | CCCC_Module@char@builtin@ 4 | CCCC_ModExt@char@builtin@@0@builtin definition@d?????@@0@d@ 5 | CCCC_Module@double@builtin@ 6 | CCCC_ModExt@double@builtin@@0@builtin definition@d?????@@0@d@ 7 | CCCC_Module@float@builtin@ 8 | CCCC_ModExt@float@builtin@@0@builtin definition@d?????@@0@d@ 9 | CCCC_Module@int@builtin@ 10 | CCCC_ModExt@int@builtin@@0@builtin definition@d?????@@0@d@ 11 | CCCC_Module@long@builtin@ 12 | CCCC_ModExt@long@builtin@@0@builtin definition@d?????@@0@d@ 13 | CCCC_Module@void@builtin@ 14 | CCCC_ModExt@void@builtin@@0@builtin definition@d?????@@0@d@ 15 | CCCC_Member@Test4a@dummy@@()@ 16 | CCCC_MemExt@Test4a@dummy@@()@test4.cc@24@definition@F???0@LOC:7 COM:2 MVG:0@0@d@ 17 | CCCC_RejExt@test4.cc@1@@F???2@LOC:0 COM:0 MVG:0@2@r@ 18 | -------------------------------------------------------------------------------- /test/w32bcc.mak: -------------------------------------------------------------------------------- 1 | # Makefile for testing CCCC on Win32 VC platform 2 | 3 | RM=del 4 | RMDIR=rmdir 5 | MV=rename 6 | ECHO=echo 7 | DIFF=diff.bat 8 | PATHSEP=\\ 9 | CCCC=..\\cccc\\cccc.exe 10 | 11 | !include rules.mak 12 | 13 | -------------------------------------------------------------------------------- /test/w32vc.mak: -------------------------------------------------------------------------------- 1 | # Makefile for testing CCCC on Win32 VC platform 2 | 3 | RM=del 4 | RMDIR=rmdir 5 | MV=rename 6 | ECHO=echo 7 | DIFF=diff.bat 8 | PATHSEP=\\ 9 | CCCC=..\\cccc\\cccc.exe 10 | 11 | include rules.mak 12 | 13 | -------------------------------------------------------------------------------- /test/win32_nmake.mak: -------------------------------------------------------------------------------- 1 | # Makefile for testing CCCC on Win32 VC platform 2 | 3 | RM=del 4 | RMDIR=rmdir 5 | MV=rename 6 | ECHO=echo 7 | DIFF=diff.bat 8 | PATHSEP=\\ 9 | CCCC=..\\cccc\\cccc.exe 10 | 11 | include rules.mak 12 | 13 | -------------------------------------------------------------------------------- /vcaddin/CcccDevStudioAddIn.def: -------------------------------------------------------------------------------- 1 | ; CcccDevStudioAddIn.def : Declares the module parameters for the DLL. 2 | 3 | LIBRARY "CCCCDEVSTUDIOADDIN" 4 | DESCRIPTION 'CCCCDEVSTUDIOADDIN Windows Dynamic Link Library' 5 | 6 | EXPORTS 7 | ; Explicit exports can go here 8 | DllCanUnloadNow PRIVATE 9 | DllGetClassObject PRIVATE 10 | DllRegisterServer PRIVATE 11 | DllUnregisterServer PRIVATE 12 | -------------------------------------------------------------------------------- /vcaddin/CcccDevStudioAddIn.h: -------------------------------------------------------------------------------- 1 | // CcccDevStudioAddIn.h : main header file for the CCCCDEVSTUDIOADDIN DLL 2 | // 3 | 4 | #if !defined(AFX_CCCCDEVSTUDIOADDIN_H__2AB447B3_A834_11D3_AFED_444553540000__INCLUDED_) 5 | #define AFX_CCCCDEVSTUDIOADDIN_H__2AB447B3_A834_11D3_AFED_444553540000__INCLUDED_ 6 | 7 | #ifndef __AFXWIN_H__ 8 | #error include 'stdafx.h' before including this file for PCH 9 | #endif 10 | 11 | #include "resource.h" // main symbols 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | //{{AFX_INSERT_LOCATION}} 21 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 22 | 23 | #endif // !defined(AFX_CCCCDEVSTUDIOADDIN_H__2AB447B3_A834_11D3_AFED_444553540000__INCLUDED) 24 | -------------------------------------------------------------------------------- /vcaddin/CcccDevStudioAddIn.odl: -------------------------------------------------------------------------------- 1 | // CcccDevStudioAddIn.odl : type library source for CcccDevStudioAddIn.dll 2 | 3 | // This file will be processed by the Make Type Library (mktyplib) tool to 4 | // produce the type library (CcccDevStudioAddIn.tlb). 5 | 6 | [ uuid(2AB447AF-A834-11D3-AFED-444553540000), version(1.0), 7 | helpstring ("CCCCDEVSTUDIOADDIN Developer Studio Add-in") ] 8 | library CcccDevStudioAddIn 9 | { 10 | importlib("stdole32.tlb"); 11 | 12 | 13 | // Dual interface for CCommands 14 | // 15 | // All commands that your add-in adds to DevStudio 16 | // must appear in this interface. You may use the 17 | // ClassView to add methods to this interface, which 18 | // will cause stub implementations of those methods to 19 | // appear in your CCommands class. 20 | 21 | [ uuid(2AB447AB-A834-11D3-AFED-444553540000), 22 | oleautomation, 23 | dual 24 | ] 25 | 26 | interface ICommands : IDispatch 27 | { 28 | // methods 29 | [id(1)] 30 | HRESULT CcccDevStudioAddInCommandMethod(); 31 | [id(2), helpstring("method configureCCCCDevStudioAddIn")] HRESULT configureCCCCDevStudioAddIn(); 32 | [id(3), helpstring("method runCCCCOnActiveFile")] HRESULT runCCCCOnActiveFile(); 33 | [id(4), helpstring("method runCCCCOnProjectFiles")] HRESULT runCCCCOnProjectFiles(); 34 | [id(5), helpstring("method runCCCCOnWorkspaceFiles")] HRESULT runCCCCOnWorkspaceFiles(); 35 | [id(6), helpstring("method configureAddIn")] HRESULT configureAddIn(); 36 | [id(7), helpstring("method UserCommand1")] HRESULT userCommand1(); 37 | [id(8), helpstring("method UserCommand2")] HRESULT userCommand2(); 38 | [id(9), helpstring("method UserCommand3")] HRESULT userCommand3(); 39 | [id(10), helpstring("method UserCommand4")] HRESULT userCommand4(); 40 | [id(11), helpstring("method UserCommand5")] HRESULT userCommand5(); 41 | [id(12), helpstring("method UserCommand6")] HRESULT userCommand6(); 42 | }; 43 | 44 | // Class information for CCommands 45 | 46 | [ uuid(2AB447AC-A834-11D3-AFED-444553540000) ] 47 | coclass Commands 48 | { 49 | [default] interface ICommands; 50 | }; 51 | 52 | //{{AFX_APPEND_ODL}} 53 | //}}AFX_APPEND_ODL}} 54 | }; 55 | -------------------------------------------------------------------------------- /vcaddin/CommandForm.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_COMMANDFORM_H__406BC922_AE87_11D3_AFED_444553540000__INCLUDED_) 2 | #define AFX_COMMANDFORM_H__406BC922_AE87_11D3_AFED_444553540000__INCLUDED_ 3 | 4 | #if _MSC_VER >= 1000 5 | #pragma once 6 | #endif // _MSC_VER >= 1000 7 | // CommandForm.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CCommandForm dialog 12 | 13 | class CCommandForm : public CDialog 14 | { 15 | // Construction 16 | public: 17 | CCommandForm(CWnd* pParent = NULL); // standard constructor 18 | virtual ~CCommandForm(); 19 | 20 | virtual void setDefaults(); 21 | void loadConfiguration(); 22 | void saveConfiguration(); 23 | 24 | // function to allow access to the strings 25 | CString cmdText(int index); 26 | 27 | // Dialog Data 28 | //{{AFX_DATA(CCommandForm) 29 | enum { IDD = IDD_DIALOG1 }; 30 | //}}AFX_DATA 31 | 32 | 33 | // Overrides 34 | // ClassWizard generated virtual function overrides 35 | //{{AFX_VIRTUAL(CCommandForm) 36 | protected: 37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | protected: 42 | 43 | // Generated message map functions 44 | //{{AFX_MSG(CCommandForm) 45 | afx_msg void OnDefaults(); 46 | //}}AFX_MSG 47 | DECLARE_MESSAGE_MAP() 48 | private: 49 | CString m_Cmd[8]; 50 | }; 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_COMMANDFORM_H__406BC922_AE87_11D3_AFED_444553540000__INCLUDED_) 56 | -------------------------------------------------------------------------------- /vcaddin/Commands.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/vcaddin/Commands.cpp -------------------------------------------------------------------------------- /vcaddin/Commands.h: -------------------------------------------------------------------------------- 1 | // Commands.h : header file 2 | // 3 | 4 | #if !defined(AFX_COMMANDS_H__2AB447BF_A834_11D3_AFED_444553540000__INCLUDED_) 5 | #define AFX_COMMANDS_H__2AB447BF_A834_11D3_AFED_444553540000__INCLUDED_ 6 | 7 | #include "CcccDevStudioAddInTypes.h" 8 | #include "DevStudioFileStore.h" 9 | 10 | class CCommands : 11 | public CComDualImpl, 12 | public CComObjectRoot, 13 | public CComCoClass 14 | { 15 | protected: 16 | IApplication* m_pApplication; 17 | 18 | public: 19 | CCommands(); 20 | ~CCommands(); 21 | void SetApplicationObject(IApplication* m_pApplication); 22 | 23 | BEGIN_COM_MAP(CCommands) 24 | COM_INTERFACE_ENTRY(IDispatch) 25 | COM_INTERFACE_ENTRY(ICommands) 26 | END_COM_MAP() 27 | DECLARE_NOT_AGGREGATABLE(CCommands) 28 | 29 | public: 30 | STDMETHOD(configureAddIn)(); 31 | STDMETHOD(runCCCCOnWorkspaceFiles)(); 32 | STDMETHOD(runCCCCOnProjectFiles)(); 33 | STDMETHOD(runCCCCOnActiveFile)(); 34 | STDMETHOD(configureCCCCDevStudioAddIn)(); 35 | 36 | STDMETHOD(userCommand1)(); 37 | STDMETHOD(userCommand2)(); 38 | STDMETHOD(userCommand3)(); 39 | STDMETHOD(userCommand4)(); 40 | STDMETHOD(userCommand5)(); 41 | STDMETHOD(userCommand6)(); 42 | 43 | // ICommands methods 44 | STDMETHOD(CcccDevStudioAddInCommandMethod)(THIS); 45 | 46 | private: 47 | // member variable for the full path to the CCCC binary 48 | std::string m_CCCCName; 49 | 50 | // member variable for the full path to the web browser 51 | std::string m_BrowserName; 52 | 53 | // A utility function to run a process, copying the process's console 54 | // output to the Macro tab in the output pane. 55 | void runProcess(const std::string& commandLine); 56 | 57 | // A utility function to run CCCC on a list of files 58 | void runCCCC(const FilenameList& fileList); 59 | 60 | }; 61 | 62 | typedef CComObject CCommandsObj; 63 | 64 | //{{AFX_INSERT_LOCATION}} 65 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 66 | 67 | #endif // !defined(AFX_COMMANDS_H__2AB447BF_A834_11D3_AFED_444553540000__INCLUDED) 68 | -------------------------------------------------------------------------------- /vcaddin/DSAddIn.h: -------------------------------------------------------------------------------- 1 | // DSAddIn.h : header file 2 | // 3 | 4 | #if !defined(AFX_DSADDIN_H__2AB447BD_A834_11D3_AFED_444553540000__INCLUDED_) 5 | #define AFX_DSADDIN_H__2AB447BD_A834_11D3_AFED_444553540000__INCLUDED_ 6 | 7 | #include "commands.h" 8 | 9 | // {2AB447AA-A834-11D3-AFED-444553540000} 10 | DEFINE_GUID(CLSID_DSAddIn, 11 | 0x2ab447aa, 0xa834, 0x11d3, 0xaf, 0xed, 0x44, 0x45, 0x53, 0x54, 0, 0); 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CDSAddIn 15 | 16 | class CDSAddIn : 17 | public IDSAddIn, 18 | public CComObjectRoot, 19 | public CComCoClass 20 | { 21 | public: 22 | DECLARE_REGISTRY(CDSAddIn, "CcccDevStudioAddIn.DSAddIn.1", 23 | "CCCCDEVSTUDIOADDIN Developer Studio Add-in", IDS_CCCCDEVSTUDIOADDIN_LONGNAME, 24 | THREADFLAGS_BOTH) 25 | 26 | CDSAddIn() {} 27 | BEGIN_COM_MAP(CDSAddIn) 28 | COM_INTERFACE_ENTRY(IDSAddIn) 29 | END_COM_MAP() 30 | DECLARE_NOT_AGGREGATABLE(CDSAddIn) 31 | 32 | // IDSAddIns 33 | public: 34 | STDMETHOD(OnConnection)(THIS_ IApplication* pApp, VARIANT_BOOL bFirstTime, 35 | long dwCookie, VARIANT_BOOL* OnConnection); 36 | STDMETHOD(OnDisconnection)(THIS_ VARIANT_BOOL bLastTime); 37 | 38 | protected: 39 | CCommandsObj* m_pCommands; 40 | DWORD m_dwCookie; 41 | private: 42 | void addCommand(IApplication* pApp, LPCSTR methodName, LPCSTR methodTip, long imageIndex, VARIANT_BOOL bFirstTime); 43 | }; 44 | 45 | //{{AFX_INSERT_LOCATION}} 46 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 47 | 48 | #endif // !defined(AFX_DSADDIN_H__2AB447BD_A834_11D3_AFED_444553540000__INCLUDED) 49 | -------------------------------------------------------------------------------- /vcaddin/DevStudioFileStore.h: -------------------------------------------------------------------------------- 1 | // DevStudioFileStore.h: interface for the DevStudioFileStore class. 2 | // 3 | // This file defines a class DevStudioFileStore which exists to encapsulate 4 | // the operations required to parse the .dsp and .dsw files used by 5 | // MS Developer studio and get the names of the files in any or all of the 6 | // projects in the workspace. 7 | 8 | 9 | #if !defined(AFX_DEVSTUDIOFILESTORE_H__76B7B6C2_AA85_11D3_AFED_444553540000__INCLUDED_) 10 | #define AFX_DEVSTUDIOFILESTORE_H__76B7B6C2_AA85_11D3_AFED_444553540000__INCLUDED_ 11 | 12 | #if _MSC_VER >= 1000 13 | #pragma once 14 | #endif // _MSC_VER >= 1000 15 | 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | // The answers to queries on the class below will be 22 | // a collection of names. 23 | // For the moment, I can't see why we would not want to have 24 | // an automatically sorted list with duplicates eliminated. 25 | typedef std::set FilenameList; 26 | 27 | class DevStudioFileStore 28 | { 29 | public: 30 | DevStudioFileStore(IApplication *pApp, const std::string& wsDir, const std::string& wsName); 31 | virtual ~DevStudioFileStore(); 32 | 33 | void listWorkspaceFiles(FilenameList& fileList); 34 | void listProjectFiles(std::string projectName, FilenameList& fileList); 35 | 36 | // A diagnostic function to list the files in each project 37 | void dumpProjectFileList(); 38 | 39 | // a function to propose a working directory for the run. 40 | // If the IApplication object allowed access to the 41 | // path to the .dsw file, this would be an excellent 42 | // choice, but as it is there is no way of getting this, 43 | // so we propose either the directory containing the active 44 | // project (if one exists), or the directory containing 45 | // the active document (if one exists), or the current directory. 46 | std::string suggestedWorkingDirectory(); 47 | 48 | private: 49 | IApplication* m_pApplication; 50 | std::string m_WorkspaceName; 51 | std::string m_WorkspaceDirectory; 52 | 53 | typedef std::map ProjectFileStore; 54 | ProjectFileStore m_ProjectFileStore; 55 | 56 | // A utility function to accept a base directory and a relative file name, 57 | // and translate to the canonical name of the file they specify. 58 | std::string composeFilename(const std::string& baseDir, const std::string& relname); 59 | 60 | // A utility function to open a .dsp or .dsw file, search for lines with a 61 | // given prefix, and translate the remainder of those lines to filenames 62 | // using the location of the opened file as the base directory. 63 | void collectFilenames(const std::string& dsFile, const std::string& pfx, 64 | FilenameList& fileList); 65 | 66 | 67 | // A utility function to copy a std::string (or by implicit conversion 68 | // a const char*) to the Macro output tab. 69 | void dump(const std::string& str); 70 | }; 71 | 72 | #endif // !defined(AFX_DEVSTUDIOFILESTORE_H__76B7B6C2_AA85_11D3_AFED_444553540000__INCLUDED_) 73 | -------------------------------------------------------------------------------- /vcaddin/FileList.h: -------------------------------------------------------------------------------- 1 | #ifndef FILELIST_H 2 | #define FILELIST_H 3 | 4 | #include 5 | 6 | /// 7 | class File 8 | { 9 | friend class FileList; 10 | public: 11 | File(); 12 | 13 | static bool Create(File& file, const CString& rootPath, CString filename, bool resolve = true); 14 | 15 | void* GetParent(void) const; 16 | const CString& GetShortName(void) const; 17 | const CString& GetTitle(void) const; 18 | const CString& GetExt(void) const; 19 | const CString& GetPath(void) const; 20 | 21 | void SetParent(void* parent); 22 | void SetShortName(const CString& shortName); 23 | void SetTitle(const CString& title); 24 | void SetExt(const CString& ext); 25 | void SetPath(const CString& path); 26 | void SetDuplicate(bool duplicate); 27 | 28 | protected: 29 | void* m_parent; 30 | 31 | CString m_shortName; 32 | CString m_title; 33 | CString m_ext; 34 | CString m_path; 35 | 36 | bool m_duplicate; 37 | }; //File 38 | 39 | 40 | class FileList 41 | { 42 | public: 43 | FileList(); 44 | ~FileList(); 45 | 46 | // Attributes 47 | int GetCount(void) const; 48 | 49 | // Operations 50 | File& Add(const File& file); 51 | void RemoveAll(void); 52 | void Sort(void); 53 | File& operator[](int index) const; 54 | 55 | int FindExact(File& file) const; 56 | int FindNext(int startPos, File& file) const; 57 | int FindPrevious(int startPos, File& file) const; 58 | 59 | struct Info 60 | { 61 | POSITION m_pos; 62 | File* m_file; 63 | }; 64 | 65 | protected: 66 | void BuildArray(void); 67 | 68 | CList m_fileList; 69 | CArray m_fileArray; 70 | }; 71 | 72 | inline File::File() 73 | : m_duplicate(false) 74 | { } 75 | inline void* File::GetParent(void) const 76 | { return m_parent; } 77 | inline const CString& File::GetShortName(void) const 78 | { return m_shortName; } 79 | inline const CString& File::GetTitle(void) const 80 | { return m_title; } 81 | inline const CString& File::GetExt(void) const 82 | { return m_ext; } 83 | inline const CString& File::GetPath(void) const 84 | { return m_path; } 85 | inline void File::SetParent(void* parent) 86 | { m_parent = parent; } 87 | inline void File::SetShortName(const CString& shortName) 88 | { m_shortName = shortName; } 89 | inline void File::SetTitle(const CString& title) 90 | { m_title = title; } 91 | inline void File::SetExt(const CString& ext) 92 | { m_ext = ext; } 93 | inline void File::SetPath(const CString& path) 94 | { m_path = path; } 95 | inline void File::SetDuplicate(bool duplicate) 96 | { m_duplicate = duplicate; } 97 | 98 | inline int FileList::GetCount(void) const 99 | { return m_fileList.GetCount(); } 100 | inline File& FileList::operator[](int index) const 101 | { return *m_fileArray[index].m_file; } 102 | 103 | #endif FILELIST_H -------------------------------------------------------------------------------- /vcaddin/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CcccDevStudioAddIn.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | #include "atlimpl.cpp" 8 | -------------------------------------------------------------------------------- /vcaddin/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__2AB447B6_A834_11D3_AFED_444553540000__INCLUDED_) 7 | #define AFX_STDAFX_H__2AB447B6_A834_11D3_AFED_444553540000__INCLUDED_ 8 | 9 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 10 | 11 | #include // MFC core and standard components 12 | #include 13 | 14 | #include 15 | //You may derive a class from CComModule and use it if you want to override 16 | //something, but do not change the name of _Module 17 | extern CComModule _Module; 18 | #include 19 | 20 | // Developer Studio Object Model 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | ///////////////////////////////////////////////////////////////////////////// 32 | // Debugging support 33 | 34 | // Use VERIFY_OK around all calls to the Developer Studio objects which 35 | // you expect to return S_OK. 36 | // In DEBUG builds of your add-in, VERIFY_OK displays an ASSERT dialog box 37 | // if the expression returns an HRESULT other than S_OK. If the HRESULT 38 | // is a success code, the ASSERT box will display that HRESULT. If it 39 | // is a failure code, the ASSERT box will display that HRESULT plus the 40 | // error description string provided by the object which raised the error. 41 | // In RETAIL builds of your add-in, VERIFY_OK just evaluates the expression 42 | // and ignores the returned HRESULT. 43 | 44 | #ifdef _DEBUG 45 | 46 | void GetLastErrorDescription(CComBSTR& bstr); // Defined in CcccDevStudioAddIn.cpp 47 | #define VERIFY_OK(f) \ 48 | { \ 49 | HRESULT hr = (f); \ 50 | if (hr != S_OK) \ 51 | { \ 52 | if (FAILED(hr)) \ 53 | { \ 54 | CComBSTR bstr; \ 55 | GetLastErrorDescription(bstr); \ 56 | _RPTF2(_CRT_ASSERT, "Object call returned %lx\n\n%S", hr, (BSTR) bstr); \ 57 | } \ 58 | else \ 59 | _RPTF1(_CRT_ASSERT, "Object call returned %lx", hr); \ 60 | } \ 61 | } 62 | 63 | #else //_DEBUG 64 | 65 | #define VERIFY_OK(f) (f); 66 | 67 | #endif //_DEBUG 68 | 69 | //{{AFX_INSERT_LOCATION}} 70 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 71 | 72 | #endif // !defined(AFX_STDAFX_H__2AB447B6_A834_11D3_AFED_444553540000__INCLUDED) 73 | -------------------------------------------------------------------------------- /vcaddin/WorkspaceInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKSPACEINFO_H 2 | #define WORKSPACEINFO_H 3 | 4 | #include "resource.h" // main symbols 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "FileList.h" 13 | 14 | /// 15 | class WorkspaceInfo 16 | { 17 | public: 18 | /// 19 | class Project 20 | { 21 | friend class WorkspaceInfo; 22 | public: 23 | const CString& GetName(void) const; 24 | bool IsActive(void) const; 25 | const CTime& GetTimeStamp(void) const; 26 | 27 | void SetActive(bool active); 28 | 29 | protected: 30 | CString m_name; // The name of the project or workspace. 31 | bool m_active; // Is the project active? 32 | CTime m_timeStamp; // The time stamp of the project. 33 | Project* m_parent; // Parent project. 34 | }; //Project 35 | 36 | typedef CList ProjectList; 37 | 38 | public: 39 | // Attributes 40 | static ProjectList& GetProjectList(void); // Not const on purpose. 41 | static FileList& GetFileList(void); // Not const on purpose. 42 | static const CString& GetWorkspaceLocation(void); 43 | static const CString& GetExtraFilename(void); 44 | static const CString& GetExcludeFilename(void); 45 | 46 | // Operations 47 | static void SetWorkspaceLocation(void); // Do once on Workspace Open. 48 | static bool CheckIntegrity(void); 49 | static bool Refresh(void); 50 | static void Add(CString projectName); 51 | static void RemoveAll(void); 52 | 53 | static IApplication *m_pApplication; 54 | 55 | protected: 56 | static bool CheckProjectIntegrity(CString projectName); 57 | static void ReadDSPFile(Project& prj); 58 | static void ReadDSWFile(Project& prj); 59 | static Project* AddHelper(CString projectName); 60 | 61 | static CString m_workspaceLocation; 62 | static CString m_extraFilename; 63 | static CString m_excludeFilename; 64 | 65 | static ProjectList m_projects; 66 | static FileList m_fileList; 67 | }; //WorkspaceInfo 68 | 69 | 70 | inline const CString& WorkspaceInfo::Project::GetName(void) const 71 | { return m_name; } 72 | inline bool WorkspaceInfo::Project::IsActive(void) const 73 | { return m_active; } 74 | inline const CTime& WorkspaceInfo::Project::GetTimeStamp(void) const 75 | { return m_timeStamp; } 76 | inline void WorkspaceInfo::Project::SetActive(bool active) 77 | { m_active = active; } 78 | 79 | 80 | inline WorkspaceInfo::ProjectList& WorkspaceInfo::GetProjectList(void) 81 | { return m_projects; } 82 | inline FileList& WorkspaceInfo::GetFileList(void) 83 | { return m_fileList; } 84 | inline const CString& WorkspaceInfo::GetWorkspaceLocation(void) 85 | { return m_workspaceLocation; } 86 | inline const CString& WorkspaceInfo::GetExtraFilename(void) 87 | { return m_extraFilename; } 88 | inline const CString& WorkspaceInfo::GetExcludeFilename(void) 89 | { return m_excludeFilename; } 90 | 91 | #endif WORKSPACEINFO_H 92 | 93 | -------------------------------------------------------------------------------- /vcaddin/res/CcccDevStudioAddIn.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // CCCCDEVSTUDIOADDIN.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /vcaddin/res/TBarLrge.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/vcaddin/res/TBarLrge.bmp -------------------------------------------------------------------------------- /vcaddin/res/TBarMedm.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlertProject/CCCC/707c7dcbd7ff6175b30e53b646f01960196db4f8/vcaddin/res/TBarMedm.bmp -------------------------------------------------------------------------------- /vcaddin/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by CcccDevStudioAddIn.rc 4 | // 5 | #define IDS_CCCCDEVSTUDIOADDIN_LONGNAME 1 6 | #define IDS_CCCCDEVSTUDIOADDIN_DESCRIPTION 2 7 | #define IDS_CMD_STRING 3 8 | #define IDR_TOOLBAR_MEDIUM 128 9 | #define IDR_TOOLBAR_LARGE 129 10 | #define IDD_DIALOG1 132 11 | #define IDC_EDIT1 1000 12 | #define IDC_EDIT2 1001 13 | #define IDC_EDIT3 1002 14 | #define IDC_EDIT4 1003 15 | #define IDC_EDIT5 1004 16 | #define IDC_EDIT6 1005 17 | #define IDC_EDIT7 1006 18 | #define IDC_EDIT8 1007 19 | #define IDC_BUTTON1 1008 20 | 21 | // Next default values for new objects 22 | // 23 | #ifdef APSTUDIO_INVOKED 24 | #ifndef APSTUDIO_READONLY_SYMBOLS 25 | #define _APS_NEXT_RESOURCE_VALUE 133 26 | #define _APS_NEXT_COMMAND_VALUE 32771 27 | #define _APS_NEXT_CONTROL_VALUE 1010 28 | #define _APS_NEXT_SYMED_VALUE 101 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /w32installer/ccccwrap.bat: -------------------------------------------------------------------------------- 1 | @rem ccccwrap.bat 2 | @rem Wrapper script to provide a command line environment with CCCC in the path. 3 | @echo off 4 | 5 | rem Give the command prompt a distinctive colour scheme so that 6 | rem the user can tell it from other command prompt windows. 7 | color 2e 8 | 9 | set CCCC_ENV=cccc_env.bat 10 | set CCCC_EXE=cccc.exe 11 | 12 | if not exist %CCCC_ENV% goto noEnv 13 | call %CCCC_ENV% 14 | 15 | if not exist %CCCC_PATH_DIR%\%CCCC_EXE% goto noExe 16 | if not exist %CCCC_WORK_DIR% goto noWorkDir 17 | 18 | path %CCCC_PATH_DIR%;%path% 19 | cd %CCCC_WORK_DIR% 20 | 21 | rem Request the usage message. 22 | %CCCC_PATH_DIR%\cccc.exe --help 23 | 24 | 25 | rem Start the shell 26 | %COMSPEC% 27 | goto end 28 | 29 | :noEnv 30 | echo The file %CCCC_ENV% was not found. 31 | echo This file is required to define the command line environment for CCCC. 32 | echo Please uninstall and reinstall CCCC to get a working command line environment. 33 | pause 34 | goto end 35 | 36 | :noExe 37 | echo The executable %CCCC_EXE% was not found in %CCCC_PATH_DIR%. 38 | echo Please uninstall and reinstall CCCC to get a working command line environment. 39 | pause 40 | goto end 41 | 42 | :noWorkDir 43 | echo The shell variable CCCC_WORK_DIR is defined as %CCCC_WORK_DIR% but this 44 | echo directory does not exist. 45 | echo This variable is required to define the initial work directory 46 | echo for a session using the CCCC command line environment. 47 | echo Please uninstall and reinstall CCCC to get a working command line environment. 48 | pause 49 | goto end 50 | 51 | :end 52 | 53 | -------------------------------------------------------------------------------- /w32installer/ccccwrap_build.bat: -------------------------------------------------------------------------------- 1 | @rem ccccwrap.bat 2 | @rem Wrapper script to provide a command line environment 3 | @rem for building CCCC using the Microsoft Visual C++ Toolkit 2003. 4 | @echo off 5 | 6 | rem Give the command prompt a distinctive colour scheme so that 7 | rem the user can tell it from other command prompt windows. 8 | color 2f 9 | 10 | set CCCC_SRC_DIR=src 11 | set MSVCT2003_DIR="c:\Program Files\Microsoft Visual C++ Toolkit 2003" 12 | 13 | if not exist %CCCC_SRC_DIR% ( 14 | echo "Source code directory not present" 15 | pause 16 | exit 17 | ) 18 | 19 | if not exist %MSVCT2003_DIR% ( 20 | echo Microsoft Visual C++ Toolkit 2003 not present 21 | echo Please install or adapt build files to use a different compiler. 22 | pause 23 | ) else ( 24 | echo Start the build using the script 'build_w32vct2003.bat' 25 | ) 26 | 27 | cd %CCCC_SRC_DIR% 28 | 29 | rem Start the shell 30 | 31 | %COMSPEC% 32 | goto end 33 | 34 | :end 35 | 36 | -------------------------------------------------------------------------------- /w32installer/make_cccc_env.bat: -------------------------------------------------------------------------------- 1 | @rem make_cccc_env.bat 2 | @rem This script runs at CCCC install time to generate a 3 | @rem batch file to set up environment variables for the 4 | @rem command line interface for CCCC. 5 | @echo off 6 | 7 | set SCRIPT=cccc_env.bat 8 | echo @rem cccc_env.bat> %SCRIPT% 9 | echo @rem CCCC_PATH_DIR defines the installation directory where the>> %SCRIPT% 10 | echo @rem cccc executable is found.>> %SCRIPT% 11 | echo set CCCC_PATH_DIR=%1>> %SCRIPT% 12 | echo @rem >> %SCRIPT% 13 | echo @rem CCCC_WORK_DIR defines the initial working directory for the>> %SCRIPT% 14 | echo @rem command line session>> %SCRIPT% 15 | echo set CCCC_WORK_DIR=%2>> %SCRIPT% 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /zip_src.bat: -------------------------------------------------------------------------------- 1 | set JAVA_HOME=c:\j2sdk1.4.1_02 2 | setlocal 3 | del /s *.obj 4 | del /s *.exe 5 | rmdir /s /q .\.cccc 6 | rmdir /s /q cccc\.cccc 7 | rmdir /s /q test\.cccc 8 | 9 | cd .. 10 | %JAVA_HOME%\bin\jar cvf ccccdist.zip ccccdist 11 | dir ccccdist.zip 12 | endlocal 13 | --------------------------------------------------------------------------------