The following source (cut down already) PROGRAM pprt(input, output); (* Nils Goesche <ngo@cartan.de> wrote in comp.programming 0 is defined as the empty set -- denoted {} 1 is defined as the set that contains 0 -- {0} = {{}} 2 is defined as the set containing 0 and 1 -- {0, 1} = {{}, {{}}} and so on. (Mathematicians will note that to have this ``definition´´ make sense, you'll first have to introduce the notion of an inductive set and the infinity axiom -- but I think this is enough to explain the idea behind the construction). Now, the programming problem is to produce a nice, pretty printed definition of a natural number n. *) VAR n : integer; (* 1----------------1 *) PROCEDURE prettyprt(n : integer); BEGIN (* prettyprt *) END; (* prettyprt *) (* 1----------------1 *) BEGIN (* pprt *) REPEAT write('Value to display: '); readln(n); IF n >= 0 THEN prettyprt(n); writeln; UNTIL n < 0; END. (* pprt *) results in the following error from gpc
[1] c:\p\pprt>gpc -v pprtx.p Reading specs from c:/djgpp/lib/gcc-lib/djgpp/2.953/specs gpc version 20020910, based on 2.95.3 20010315/djgpp (release) c:/djgpp/lib/gcc-lib/djgpp/2.953/gpcpp.exe -lang-pascal -v -famtmpfile=c:/djgpp /tmp\ccaaaaaa -fstandard-pascal -D__STANDARD_PASCAL__ -fmixed-comments -undef -D __GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=1 -D__GPC_VERSION__=2 .1 -D__GPC_RELEASE__=20020910 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN __=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS -D__OS_DOS__=1 -D__unix__ -D__i386__ -D__GO32__ -D__DJGPP__=2 -D__MSDOS__ -D__OS_DOS__=1 -D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS -Asy stem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386) -Acpu(i386) -Amachine(i38 6) -Di386 -D__i386 -D__i386__ -D__tune_pentium__ -imacros c:/djgpp/lib/gcc-lib/d jgpp/2.953/djgpp.ver -remap pprtx.p c:/djgpp/tmp\ccSv07U1.i GNU Pascal Compiler PreProcessor version 20020910, based on gcc-2.95.3 20010315/ djgpp (release) (80386, BSD syntax) #include "..." search starts here: #include <...> search starts here: /usr/local/include c:/djgpp/i586-pc-msdosdjgpp/include c:/djgpp/lib/gcc-lib/djgpp/2.953/include c:/djgpp/include End of search list. pprtx.p:32: unterminated string or character constant pprtx.p:10: possible real start of unterminated constant
I suspect something in the quoted comment line 10 is driving it up the wall, such as a "'". gpc is being run through an alias that supplies --standard-pascal. Are you trying to have the lexer do too much at once? Once a comment is started nothing except *) (or maybe } or EOF) should close it. I took the isolated ' out of the comment, and the error changed. So I think there is enough to annoy it in there. It compiles through rhide150b though! Also PascalP has no problem. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!