From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id 4D5F43858004; Thu, 17 Nov 2022 22:33:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D5F43858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668724397; bh=+GECjo/ku9E0rYkreebhccDbpLFBjxFQF6UzJqGjXJw=; h=From:To:Subject:Date:From; b=lUrizdcfThcXrjAHHHmfSevpqSXH34Uw5Ens1cog7gb8uvEh8FE2XXxCe+HpWEXDW Y0OkFoARlSEWf9LQOvKayvf2rChTwJO/E/kEl7az/Qp1w1hwUf1WpLFypaI8lCxm+E r96lyTGnjMCs7m+673Bl0zeLUCOA4dqbQQ3IpYA4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] pge ebnf and def2doc.py first cut complete for Sphinx X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: b0545fc190cb2dc1553d6065a3a5b8a73997521d X-Git-Newrev: 681cb6adddbea126beb4a81fba8267a081e9d639 Message-Id: <20221117223317.4D5F43858004@sourceware.org> Date: Thu, 17 Nov 2022 22:33:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:681cb6adddbea126beb4a81fba8267a081e9d639 commit 681cb6adddbea126beb4a81fba8267a081e9d639 Author: Gaius Mulley Date: Thu Nov 17 22:32:13 2022 +0000 pge ebnf and def2doc.py first cut complete for Sphinx The m2 tools have been changed to emit Sphinx output. pge has also been rebuilt. gcc/m2/ChangeLog: * gcc/m2/Make-lang.in: Introduced rst rules for subcomponents: gm2-libs.rst, gm2-ebnf.rst SYSTEM-pim.rst, SYSTEM-iso.rst and Builtins.rst. * gcc/m2/Make-maintainer.in: Added pge-clean rule. * gcc/m2/gm2-compiler/ppg.mod: Introduced new option -x for sphinx output. Implemented ebnf pretty printing. * gcc/m2/tools-src/def2doc.py: Introduced state class to ensure that the rst block is only changed if necessary. * gcc/m2/pge-boot/GASCII.c: Rebuilt. * gcc/m2/pge-boot/GArgs.c: Rebuilt. * gcc/m2/pge-boot/GAssertion.c: Rebuilt. * gcc/m2/pge-boot/GDebug.c: Rebuilt. * gcc/m2/pge-boot/GDynamicStrings.c: Rebuilt. * gcc/m2/pge-boot/GFIO.c: Rebuilt. * gcc/m2/pge-boot/GIO.c: Rebuilt. * gcc/m2/pge-boot/GIndexing.c: Rebuilt. * gcc/m2/pge-boot/GLists.c: Rebuilt. * gcc/m2/pge-boot/GM2Dependent.c: Rebuilt. * gcc/m2/pge-boot/GM2EXCEPTION.c: Rebuilt. * gcc/m2/pge-boot/GM2RTS.c: Rebuilt. * gcc/m2/pge-boot/GNameKey.c: Rebuilt. * gcc/m2/pge-boot/GNumberIO.c: Rebuilt. * gcc/m2/pge-boot/GOutput.c: Rebuilt. * gcc/m2/pge-boot/GPushBackInput.c: Rebuilt. * gcc/m2/pge-boot/GRTExceptions.c: Rebuilt. * gcc/m2/pge-boot/GSFIO.c: Rebuilt. * gcc/m2/pge-boot/GStdIO.c: Rebuilt. * gcc/m2/pge-boot/GStorage.c: Rebuilt. * gcc/m2/pge-boot/GStrCase.c: Rebuilt. * gcc/m2/pge-boot/GStrIO.c: Rebuilt. * gcc/m2/pge-boot/GStrLib.c: Rebuilt. * gcc/m2/pge-boot/GSymbolKey.c: Rebuilt. * gcc/m2/pge-boot/GSysStorage.c: Rebuilt. * gcc/m2/pge-boot/Gbnflex.c: Rebuilt. * gcc/m2/pge-boot/Gpge.c: Rebuilt. * gcc/m2/pge-boot/main.c: Rebuilt. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/Make-lang.in | 114 +- gcc/m2/Make-maintainer.in | 1 + gcc/m2/gm2-compiler/ppg.mod | 15 +- gcc/m2/pge-boot/GASCII.c | 4 +- gcc/m2/pge-boot/GArgs.c | 18 +- gcc/m2/pge-boot/GAssertion.c | 4 +- gcc/m2/pge-boot/GDebug.c | 10 +- gcc/m2/pge-boot/GDynamicStrings.c | 214 ++-- gcc/m2/pge-boot/GFIO.c | 400 +++---- gcc/m2/pge-boot/GIO.c | 20 +- gcc/m2/pge-boot/GIndexing.c | 80 +- gcc/m2/pge-boot/GLists.c | 28 +- gcc/m2/pge-boot/GM2Dependent.c | 263 +++-- gcc/m2/pge-boot/GM2EXCEPTION.c | 8 +- gcc/m2/pge-boot/GM2RTS.c | 56 +- gcc/m2/pge-boot/GNameKey.c | 120 +-- gcc/m2/pge-boot/GNumberIO.c | 94 +- gcc/m2/pge-boot/GOutput.c | 10 +- gcc/m2/pge-boot/GPushBackInput.c | 28 +- gcc/m2/pge-boot/GRTExceptions.c | 150 +-- gcc/m2/pge-boot/GSFIO.c | 4 +- gcc/m2/pge-boot/GStdIO.c | 20 +- gcc/m2/pge-boot/GStorage.c | 4 +- gcc/m2/pge-boot/GStrCase.c | 4 +- gcc/m2/pge-boot/GStrIO.c | 4 +- gcc/m2/pge-boot/GStrLib.c | 4 +- gcc/m2/pge-boot/GSymbolKey.c | 40 +- gcc/m2/pge-boot/GSysStorage.c | 10 +- gcc/m2/pge-boot/Gbnflex.c | 22 +- gcc/m2/pge-boot/Gpge.c | 2071 +++++++++++++++++++------------------ gcc/m2/pge-boot/main.c | 234 ++--- gcc/m2/tools-src/def2doc.py | 103 +- libgm2/libm2cor/Makefile.in | 1 - libgm2/libm2iso/Makefile.in | 1 - libgm2/libm2log/Makefile.in | 1 - libgm2/libm2min/Makefile.in | 1 - libgm2/libm2pim/Makefile.in | 1 - 37 files changed, 2191 insertions(+), 1971 deletions(-) diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index 103e62f8584..5febe465689 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -39,6 +39,14 @@ TEXISRC = $(objdir)/m2/images/gnu.eps \ m2/SYSTEM-iso.texi \ m2/Builtins.texi +RSTSRC = $(objdir)/m2/images/gnu.eps \ + $(srcdir)/doc/gm2.texi \ + m2/gm2-libs.rst \ + m2/gm2-ebnf.rst \ + m2/SYSTEM-pim.rst \ + m2/SYSTEM-iso.rst \ + m2/Builtins.rst + # Define the names for selecting modula-2 in LANGUAGES. m2 modula-2 modula2: gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) \ $(GCC_PASSES) $(GCC_PARTS) @@ -94,9 +102,30 @@ m2.all.cross: gm2-cross$(exeext) plugin/m2rte$(exeext).so m2.start.encap: gm2$(exeext) plugin/m2rte$(exeext).so m2.rest.encap: -m2.info: doc/m2.info +# Documentation. + +doc/m2/info/texinfo/gm2.info: $(SPHINX_FILES) + + if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \ + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/m2/doc/ BUILDDIR=$(objdir)/doc/gm2/info SPHINXBUILD=$(SPHINX_BUILD); \ + else true; fi + +doc/m2/pdf/latex/gm2.pdf: $(SPHINX_FILES) + + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/m2/doc/ BUILDDIR=$(objdir)/doc/gm2/pdf SPHINXBUILD=$(SPHINX_BUILD) + +doc/m2/html/html/index.html: $(SPHINX_FILES) + + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/m2/doc/ BUILDDIR=$(objdir)/doc/gm2/html SPHINXBUILD=$(SPHINX_BUILD) -m2.man: doc/m2.1 +m2.man: doc/m2/man/man/gm2.1 + +m2.srcman: doc/m2/man/man/gm2.1 + -cp -p $^ $(srcdir)/doc + +doc/m2/man/man/gm2.1: $(SPHINX_FILES) + + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/m2/doc BUILDDIR=$(objdir)/doc/m2/man SPHINXBUILD=$(SPHINX_BUILD) + +# m2.info: doc/m2.info + +# m2.man: doc/m2.1 m2.install-man: $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext) @@ -114,6 +143,8 @@ m2.ps: m2.dvi m2.pdf: m2.ps gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $< +m2.doc: $(RSTSRC) + .INTERMEDIATE: gm2.pod m2.pod: doc/gm2.texi $(TEXISRC) @@ -134,11 +165,13 @@ $(objdir)/m2/images/gnu.eps: $(srcdir)/m2/images/gnupng pngtopnm $< | pnmtops -noturn > $@ ; \ fi +# gm2-libs.texi + m2/gm2-libs.texi: gm2-libs.texi-check; @true ifeq ($(HAVE_PYTHON),yes) gm2-libs.texi-check: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/Builtins.texi \ - $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def m2/gm2-ebnf.texi + $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -t -uLibraries -s$(srcdir)/m2 -b$(objdir)/m2 -o $(objdir)/m2/gm2-libs.texi $(STAMP) gm2-libs.texi-check else @@ -147,12 +180,39 @@ gm2-libs.texi-check: touch $(objdir)/m2/gm2-libs.texi endif +# gm2-libs.rst + +m2/gm2-libs.rst: gm2-libs.rst-check; @true + +ifeq ($(HAVE_PYTHON),yes) +gm2-libs.rst-check: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/Builtins.texi \ + $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def + $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -uLibraries -s$(srcdir)/m2 -b$(objdir)/m2 -o $(objdir)/m2/gm2-libs.rst + $(STAMP) gm2-libs.rst-check +else +gm2-libs.rst-check: + echo "not building gm2-libs.rst as python3 has not been found" + touch $(objdir)/m2/gm2-libs.rst +endif + +# gm2-ebnf.texi + m2/gm2-ebnf.texi: gm2-ebnf.texi-check; @true gm2-ebnf.texi-check: $(PGE) $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf - $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf > m2/gm2-ebnf.texi + $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf -o m2/gm2-ebnf.texi $(STAMP) gm2-ebnf.texi-check +# gm2-ebnf.rst + +m2/gm2-ebnf.rst: gm2-ebnf.rst-check; @true + +gm2-ebnf.rst-check: $(PGE) $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf + $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf -o m2/gm2-ebnf.rst + $(STAMP) gm2-ebnf.rst-check + +# SYSTEM-pim.texi + m2/SYSTEM-pim.texi: SYSTEM-pim-texi-check; @true ifeq ($(HAVE_PYTHON),yes) @@ -165,6 +225,22 @@ SYSTEM-pim-texi-check: $(objdir)/m2/gm2-libs/SYSTEM.def touch $(objdir)/m2/SYSTEM-pim.texi endif +# SYSTEM-pim.rst + +m2/SYSTEM-pim.rst: SYSTEM-pim-rst-check; @true + +ifeq ($(HAVE_PYTHON),yes) +SYSTEM-pim-rst-check: $(objdir)/m2/gm2-libs/SYSTEM.def + $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs/SYSTEM.def -o $(objdir)/m2/SYSTEM-pim.rst + $(STAMP) SYSTEM-pim-rst-check +else +SYSTEM-pim-rst-check: $(objdir)/m2/gm2-libs/SYSTEM.def + echo "not building SYSTEM-pim.rst as python3 has not been found" + touch $(objdir)/m2/SYSTEM-pim.rst +endif + +# SYSTEM-pim.texi + m2/SYSTEM-iso.texi: SYSTEM-iso.texi-check; @true ifeq ($(HAVE_PYTHON),yes) @@ -177,6 +253,22 @@ SYSTEM-iso.texi-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def touch $(objdir)/m2/SYSTEM-iso.texi endif +# SYSTEM-pim.rst + +m2/SYSTEM-iso.rst: SYSTEM-iso.rst-check; @true + +ifeq ($(HAVE_PYTHON),yes) +SYSTEM-iso.rst-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def + $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs-iso/SYSTEM.def -o $(objdir)/m2/SYSTEM-iso.rst + $(STAMP) SYSTEM-iso.rst-check +else +SYSTEM-iso.rst-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def + echo "not building SYSTEM-iso.rst as python3 has not been found" + touch $(objdir)/m2/SYSTEM-iso.rst +endif + +# m2/Builtins.texi + m2/Builtins.texi: Builtins.texi-check; @true ifeq ($(HAVE_PYTHON),yes) @@ -189,6 +281,20 @@ Builtins.texi-check: m2/gm2-libs/Builtins.def touch $(objdir)/m2/Builtins.texi endif +# m2/Builtins.rst + +m2/Builtins.rst: Builtins.rst-check; @true + +ifeq ($(HAVE_PYTHON),yes) +Builtins.rst-check: m2/gm2-libs/Builtins.def + $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b./ -f$(srcdir)/m2/gm2-libs/Builtins.def -o $(objdir)/m2/Builtins.rst + $(STAMP) Builtins.rst-check +else +Builtins.rst-check: m2/gm2-libs/Builtins.def + echo "not building SYSTEM-iso.rst as python3 has not been found" + touch $(objdir)/m2/Builtins.rst +endif + $(objdir)/m2/gm2-compiler-boot: test -d $@ || mkdir $@ diff --git a/gcc/m2/Make-maintainer.in b/gcc/m2/Make-maintainer.in index 8a477226760..881876f952f 100644 --- a/gcc/m2/Make-maintainer.in +++ b/gcc/m2/Make-maintainer.in @@ -351,6 +351,7 @@ pge-verify: force # Remove pge build files. pge-clean: force + $(RM) -f m2/gm2-pg-boot/* m2/gm2-ppg-boot/* m2/gm2-pge-boot/* # The rest of the Make-lang.in handles the bootstrap tool (maintained diff --git a/gcc/m2/gm2-compiler/ppg.mod b/gcc/m2/gm2-compiler/ppg.mod index f44046fb681..aabe1150a62 100644 --- a/gcc/m2/gm2-compiler/ppg.mod +++ b/gcc/m2/gm2-compiler/ppg.mod @@ -168,6 +168,7 @@ VAR PrettyPrint, EmitCode, Texinfo, + Sphinx, FreeDocLicense, Debugging, WasNoError : BOOLEAN ; @@ -2410,6 +2411,9 @@ BEGIN IF Texinfo THEN Output.WriteString('@example') ; NewLine(0) + ELSIF Sphinx + THEN + Output.WriteString('.. code-block:: ebnf') ; NewLine(0) END ; Output.WriteKey(GetDefinitionName(p)) ; Output.WriteString(' := ') ; @@ -2427,6 +2431,10 @@ BEGIN THEN Output.WriteString('@findex ') ; Output.WriteKey(GetDefinitionName(p)) ; Output.WriteString(' (ebnf)') ; NewLine(0) ; Output.WriteString('@end example') ; NewLine(0) + ELSIF Sphinx + THEN + Output.WriteString('.. index::') ; NewLine(0) ; + Output.WriteString(' pair: ') ; Output.WriteKey(GetDefinitionName(p)) ; Output.WriteString('; (ebnf)') ; NewLine(0) END ; NewLine(0) END @@ -5341,7 +5349,7 @@ END PostProcessRules ; PROCEDURE DisplayHelp ; BEGIN - WriteString('Usage: ppg [-l] [-c] [-d] [-e] [-k] [-t] [-k] [-p] [-t] [-f] [-o outputfile] filename') ; WriteLn ; + WriteString('Usage: ppg [-l] [-c] [-d] [-e] [-k] [-t] [-k] [-p] [-x] [-f] [-o outputfile] filename') ; WriteLn ; WriteString(' -l suppress file and line source information') ; WriteLn ; WriteString(' -c do not generate any Modula-2 code within the parser rules') ; WriteLn ; WriteString(' -h or --help generate this help message') ; WriteLn ; @@ -5350,6 +5358,7 @@ BEGIN WriteString(' -d generate internal debugging information') ; WriteLn ; WriteString(' -p only display the ebnf rules') ; WriteLn ; WriteString(' -t generate texinfo formating for pretty printing (-p)') ; WriteLn ; + WriteString(' -x generate sphinx formating for pretty printing (-p)') ; WriteLn ; WriteString(' -f generate GNU Free Documentation header before pretty printing in texinfo') ; WriteLn ; WriteString(' -o write output to filename') ; WriteLn ; exit (0) @@ -5398,6 +5407,9 @@ BEGIN ELSIF StrEqual(ArgName, '-t') THEN Texinfo := TRUE + ELSIF StrEqual(ArgName, '-x') + THEN + Sphinx := TRUE ELSIF StrEqual(ArgName, '-f') THEN FreeDocLicense := TRUE @@ -5440,6 +5452,7 @@ PROCEDURE Init ; BEGIN WasNoError := TRUE ; Texinfo := FALSE ; + Sphinx := FALSE ; FreeDocLicense := FALSE ; EmitCode := TRUE ; LargestValue := 0 ; diff --git a/gcc/m2/pge-boot/GASCII.c b/gcc/m2/pge-boot/GASCII.c index 3df3e421fc8..a4101d20ede 100644 --- a/gcc/m2/pge-boot/GASCII.c +++ b/gcc/m2/pge-boot/GASCII.c @@ -75,10 +75,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define ASCII_del (char) 0177 # define ASCII_EOL ASCII_nl -extern "C" void _M2_ASCII_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_ASCII_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_ASCII_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_ASCII_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GArgs.c b/gcc/m2/pge-boot/GArgs.c index f8f66b27c8c..e8ad8723eae 100644 --- a/gcc/m2/pge-boot/GArgs.c +++ b/gcc/m2/pge-boot/GArgs.c @@ -39,15 +39,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define MaxArgs 255 # define MaxString 4096 -typedef struct _T2_a _T2; +typedef struct Args__T2_a Args__T2; -typedef _T2 *_T1; +typedef Args__T2 *Args__T1; -typedef struct _T3_a _T3; +typedef struct Args__T3_a Args__T3; -struct _T2_a { _T3 * array[MaxArgs+1]; }; -struct _T3_a { char array[MaxString+1]; }; -static _T1 Source; +struct Args__T2_a { Args__T3 * array[MaxArgs+1]; }; +struct Args__T3_a { char array[MaxString+1]; }; +static Args__T1 Source; /* GetArg - returns the nth argument from the command line. @@ -80,7 +80,7 @@ extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int High = _a_high; if (i < (UnixArgs_GetArgC ())) { - Source = static_cast<_T1> (UnixArgs_GetArgV ()); + Source = static_cast (UnixArgs_GetArgV ()); while (((*(*Source).array[i]).array[j] != ASCII_nul) && (j < High)) { a[j] = (*(*Source).array[i]).array[j]; @@ -109,10 +109,10 @@ extern "C" unsigned int Args_Narg (void) __builtin_unreachable (); } -extern "C" void _M2_Args_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Args_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Args_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Args_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GAssertion.c b/gcc/m2/pge-boot/GAssertion.c index 2c537479d8e..9a4cda4c161 100644 --- a/gcc/m2/pge-boot/GAssertion.c +++ b/gcc/m2/pge-boot/GAssertion.c @@ -60,10 +60,10 @@ extern "C" void Assertion_Assert (unsigned int Condition) } } -extern "C" void _M2_Assertion_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Assertion_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Assertion_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Assertion_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GDebug.c b/gcc/m2/pge-boot/GDebug.c index ab6a1e7c406..3518c9bf702 100644 --- a/gcc/m2/pge-boot/GDebug.c +++ b/gcc/m2/pge-boot/GDebug.c @@ -90,10 +90,10 @@ static void WriteLn (void) extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high) { - typedef struct _T1_a _T1; + typedef struct Halt__T1_a Halt__T1; - struct _T1_a { char array[MaxNoOfDigits+1]; }; - _T1 No; + struct Halt__T1_a { char array[MaxNoOfDigits+1]; }; + Halt__T1 No; char Message[_Message_high+1]; char Module[_Module_high+1]; @@ -159,10 +159,10 @@ extern "C" void Debug_DebugString (const char *a_, unsigned int _a_high) } } -extern "C" void _M2_Debug_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Debug_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Debug_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Debug_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GDynamicStrings.c b/gcc/m2/pge-boot/GDynamicStrings.c index 49fb5181ddf..70031e89c6e 100644 --- a/gcc/m2/pge-boot/GDynamicStrings.c +++ b/gcc/m2/pge-boot/GDynamicStrings.c @@ -65,63 +65,63 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define DebugOn FALSE # define CheckOn FALSE # define TraceOn FALSE -typedef struct Contents_r Contents; +typedef struct DynamicStrings_Contents_r DynamicStrings_Contents; -typedef struct DebugInfo_r DebugInfo; +typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo; -typedef struct stringRecord_r stringRecord; +typedef struct DynamicStrings_stringRecord_r DynamicStrings_stringRecord; -typedef struct descriptor_r descriptor; +typedef struct DynamicStrings_descriptor_r DynamicStrings_descriptor; -typedef descriptor *Descriptor; +typedef DynamicStrings_descriptor *DynamicStrings_Descriptor; -typedef struct frameRec_r frameRec; +typedef struct DynamicStrings_frameRec_r DynamicStrings_frameRec; -typedef frameRec *frame; +typedef DynamicStrings_frameRec *DynamicStrings_frame; -typedef struct _T3_a _T3; +typedef struct DynamicStrings__T3_a DynamicStrings__T3; -typedef enum {inuse, marked, onlist, poisoned} desState; +typedef enum {DynamicStrings_inuse, DynamicStrings_marked, DynamicStrings_onlist, DynamicStrings_poisoned} DynamicStrings_desState; -typedef stringRecord *DynamicStrings_String; +typedef DynamicStrings_stringRecord *DynamicStrings_String; -struct DebugInfo_r { - DynamicStrings_String next; - void *file; - unsigned int line; - void *proc; - }; +struct DynamicStrings_DebugInfo_r { + DynamicStrings_String next; + void *file; + unsigned int line; + void *proc; + }; -struct descriptor_r { - unsigned int charStarUsed; - void *charStar; - unsigned int charStarSize; - unsigned int charStarValid; - desState state; - DynamicStrings_String garbage; - }; +struct DynamicStrings_descriptor_r { + unsigned int charStarUsed; + void *charStar; + unsigned int charStarSize; + unsigned int charStarValid; + DynamicStrings_desState state; + DynamicStrings_String garbage; + }; -struct frameRec_r { - DynamicStrings_String alloc; - DynamicStrings_String dealloc; - frame next; - }; +struct DynamicStrings_frameRec_r { + DynamicStrings_String alloc; + DynamicStrings_String dealloc; + DynamicStrings_frame next; + }; -struct _T3_a { char array[(MaxBuf-1)+1]; }; -struct Contents_r { - _T3 buf; - unsigned int len; - DynamicStrings_String next; - }; +struct DynamicStrings__T3_a { char array[(MaxBuf-1)+1]; }; +struct DynamicStrings_Contents_r { + DynamicStrings__T3 buf; + unsigned int len; + DynamicStrings_String next; + }; -struct stringRecord_r { - Contents contents; - Descriptor head; - DebugInfo debug; - }; +struct DynamicStrings_stringRecord_r { + DynamicStrings_Contents contents; + DynamicStrings_Descriptor head; + DynamicStrings_DebugInfo debug; + }; static unsigned int Initialized; -static frame frameHead; +static DynamicStrings_frame frameHead; static DynamicStrings_String captured; /* @@ -553,7 +553,7 @@ static void AddDebugInfo (DynamicStrings_String s); total length of, a. The offset is in, o. */ -static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o); +static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o); /* DeallocateCharStar - deallocates any charStar. @@ -578,7 +578,7 @@ static void MarkInvalid (DynamicStrings_String s); total length of, a. */ -static void ConcatContentsAddress (Contents *c, void * a, unsigned int h); +static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigned int h); /* AddToGarbage - adds String, b, onto the garbage list of, a. Providing @@ -640,21 +640,21 @@ static void writeStringDesc (DynamicStrings_String s) writeString ((const char *) " ", 1); switch (s->head->state) { - case inuse: + case DynamicStrings_inuse: writeString ((const char *) "still in use (", 14); writeCard (s->contents.len); writeString ((const char *) ") characters", 12); break; - case marked: + case DynamicStrings_marked: writeString ((const char *) "marked", 6); break; - case onlist: + case DynamicStrings_onlist: writeString ((const char *) "on a (lost) garbage list", 24); break; - case poisoned: + case DynamicStrings_poisoned: writeString ((const char *) "poisoned", 8); break; @@ -1052,7 +1052,7 @@ static void AddDeallocated (DynamicStrings_String s) static unsigned int IsOnAllocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1078,7 +1078,7 @@ static unsigned int IsOnAllocated (DynamicStrings_String s) static unsigned int IsOnDeallocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1104,7 +1104,7 @@ static unsigned int IsOnDeallocated (DynamicStrings_String s) static void SubAllocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1128,7 +1128,7 @@ static void SubAllocated (DynamicStrings_String s) static void SubDeallocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1193,7 +1193,7 @@ static void AddDebugInfo (DynamicStrings_String s) total length of, a. The offset is in, o. */ -static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o) +static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o) { unsigned int i; char a[_a_high+1]; @@ -1211,13 +1211,13 @@ static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, u if (o < h) { (*c).len = MaxBuf; - Storage_ALLOCATE ((void **) &(*c).next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &(*c).next, sizeof (DynamicStrings_stringRecord)); (*c).next->head = NULL; (*c).next->contents.len = 0; (*c).next->contents.next = NULL; ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o); AddDebugInfo ((*c).next); - (*c).next = AssignDebug ((*c).next, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 722, (const char *) "ConcatContents", 14); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 722, (const char *) "ConcatContents", 14); } else { @@ -1252,7 +1252,7 @@ static void DeallocateCharStar (DynamicStrings_String s) static DynamicStrings_String CheckPoisoned (DynamicStrings_String s) { - if (((PoisonOn && (s != NULL)) && (s->head != NULL)) && (s->head->state == poisoned)) + if (((PoisonOn && (s != NULL)) && (s->head != NULL)) && (s->head->state == DynamicStrings_poisoned)) { M2RTS_HALT (-1); __builtin_unreachable (); @@ -1285,17 +1285,17 @@ static void MarkInvalid (DynamicStrings_String s) total length of, a. */ -static void ConcatContentsAddress (Contents *c, void * a, unsigned int h) +static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigned int h) { - typedef char *_T1; + typedef char *ConcatContentsAddress__T1; - _T1 p; + ConcatContentsAddress__T1 p; unsigned int i; unsigned int j; j = 0; i = (*c).len; - p = static_cast<_T1> (a); + p = static_cast (a); while ((j < h) && (i < MaxBuf)) { (*c).buf.array[i] = (*p); @@ -1307,7 +1307,7 @@ static void ConcatContentsAddress (Contents *c, void * a, unsigned int h) { /* avoid dangling else. */ (*c).len = MaxBuf; - Storage_ALLOCATE ((void **) &(*c).next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &(*c).next, sizeof (DynamicStrings_stringRecord)); (*c).next->head = NULL; (*c).next->contents.len = 0; (*c).next->contents.next = NULL; @@ -1315,7 +1315,7 @@ static void ConcatContentsAddress (Contents *c, void * a, unsigned int h) AddDebugInfo ((*c).next); if (TraceOn) { - (*c).next = AssignDebug ((*c).next, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 917, (const char *) "ConcatContentsAddress", 21); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 917, (const char *) "ConcatContentsAddress", 21); } } else @@ -1347,7 +1347,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin writeString('warning trying to add to a marked string') ; writeLn END ; */ - if (((((a != b) && (a != NULL)) && (b != NULL)) && (b->head->state == marked)) && (a->head->state == inuse)) + if (((((a != b) && (a != NULL)) && (b != NULL)) && (b->head->state == DynamicStrings_marked)) && (a->head->state == DynamicStrings_inuse)) { c = a; while (c->head->garbage != NULL) @@ -1355,7 +1355,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin c = c->head->garbage; } c->head->garbage = b; - b->head->state = onlist; + b->head->state = DynamicStrings_onlist; if (CheckOn) { SubDebugInfo (b); @@ -1413,21 +1413,21 @@ static void DumpState (DynamicStrings_String s) { switch (s->head->state) { - case inuse: + case DynamicStrings_inuse: writeString ((const char *) "still in use (", 14); writeCard (s->contents.len); writeString ((const char *) ") characters", 12); break; - case marked: + case DynamicStrings_marked: writeString ((const char *) "marked", 6); break; - case onlist: + case DynamicStrings_onlist: writeString ((const char *) "on a garbage list", 17); break; - case poisoned: + case DynamicStrings_poisoned: writeString ((const char *) "poisoned", 8); break; @@ -1526,21 +1526,21 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi /* make a local copy of each unbounded array. */ memcpy (a, a_, _a_high+1); - Storage_ALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); s->contents.len = 0; s->contents.next = NULL; ConcatContents (&s->contents, (const char *) a, _a_high, StrLib_StrLen ((const char *) a, _a_high), 0); - Storage_ALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head->charStarUsed = FALSE; s->head->charStar = NULL; s->head->charStarSize = 0; s->head->charStarValid = FALSE; s->head->garbage = NULL; - s->head->state = inuse; + s->head->state = DynamicStrings_inuse; AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 758, (const char *) "InitString", 10); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 758, (const char *) "InitString", 10); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1578,7 +1578,7 @@ extern "C" DynamicStrings_String DynamicStrings_KillString (DynamicStrings_Strin } if (s->head != NULL) { - s->head->state = poisoned; + s->head->state = DynamicStrings_poisoned; s->head->garbage = DynamicStrings_KillString (s->head->garbage); if (! PoisonOn) { @@ -1586,14 +1586,14 @@ extern "C" DynamicStrings_String DynamicStrings_KillString (DynamicStrings_Strin } if (! PoisonOn) { - Storage_DEALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_DEALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head = NULL; } } t = DynamicStrings_KillString (s->contents.next); if (! PoisonOn) { - Storage_DEALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_DEALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); } } return NULL; @@ -1626,24 +1626,24 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) { DynamicStrings_String s; - Storage_ALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); s->contents.len = 0; s->contents.next = NULL; if (a != NULL) { ConcatContentsAddress (&s->contents, a, static_cast (libc_strlen (a))); } - Storage_ALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head->charStarUsed = FALSE; s->head->charStar = NULL; s->head->charStarSize = 0; s->head->charStarValid = FALSE; s->head->garbage = NULL; - s->head->state = inuse; + s->head->state = DynamicStrings_inuse; AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 957, (const char *) "InitStringCharStar", 18); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 957, (const char *) "InitStringCharStar", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1657,10 +1657,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) { - typedef struct _T4_a _T4; + typedef struct InitStringChar__T4_a InitStringChar__T4; - struct _T4_a { char array[1+1]; }; - _T4 a; + struct InitStringChar__T4_a { char array[1+1]; }; + InitStringChar__T4 a; DynamicStrings_String s; a.array[0] = ch; @@ -1668,7 +1668,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) s = DynamicStrings_InitString ((const char *) &a.array[0], 1); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 977, (const char *) "InitStringChar", 14); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 977, (const char *) "InitStringChar", 14); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1686,9 +1686,9 @@ extern "C" DynamicStrings_String DynamicStrings_Mark (DynamicStrings_String s) { s = CheckPoisoned (s); } - if ((s != NULL) && (s->head->state == inuse)) + if ((s != NULL) && (s->head->state == DynamicStrings_inuse)) { - s->head->state = marked; + s->head->state = DynamicStrings_marked; } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1765,10 +1765,10 @@ extern "C" DynamicStrings_String DynamicStrings_ConCat (DynamicStrings_String a, extern "C" DynamicStrings_String DynamicStrings_ConCatChar (DynamicStrings_String a, char ch) { - typedef struct _T5_a _T5; + typedef struct ConCatChar__T5_a ConCatChar__T5; - struct _T5_a { char array[1+1]; }; - _T5 b; + struct ConCatChar__T5_a { char array[1+1]; }; + ConCatChar__T5 b; DynamicStrings_String t; if (PoisonOn) @@ -1826,7 +1826,7 @@ extern "C" DynamicStrings_String DynamicStrings_Dup (DynamicStrings_String s) s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1173, (const char *) "Dup", 3); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1173, (const char *) "Dup", 3); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1848,7 +1848,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b); if (TraceOn) { - a = AssignDebug (a, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1193, (const char *) "Add", 3); + a = AssignDebug (a, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1193, (const char *) "Add", 3); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1923,7 +1923,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v t = DynamicStrings_InitStringCharStar (a); if (TraceOn) { - t = AssignDebug (t, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1258, (const char *) "EqualCharStar", 13); + t = AssignDebug (t, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1258, (const char *) "EqualCharStar", 13); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1961,7 +1961,7 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons t = DynamicStrings_InitString ((const char *) a, _a_high); if (TraceOn) { - t = AssignDebug (t, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1288, (const char *) "EqualArray", 10); + t = AssignDebug (t, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1288, (const char *) "EqualArray", 10); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1999,7 +1999,7 @@ extern "C" DynamicStrings_String DynamicStrings_Mult (DynamicStrings_String s, u } if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1320, (const char *) "Mult", 4); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1320, (const char *) "Mult", 4); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2072,13 +2072,13 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, { if (t->contents.next == NULL) { - Storage_ALLOCATE ((void **) &t->contents.next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &t->contents.next, sizeof (DynamicStrings_stringRecord)); t->contents.next->head = NULL; t->contents.next->contents.len = 0; AddDebugInfo (t->contents.next); if (TraceOn) { - t->contents.next = AssignDebug (t->contents.next, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1388, (const char *) "Slice", 5); + t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1388, (const char *) "Slice", 5); } } t = t->contents.next; @@ -2096,7 +2096,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, } if (TraceOn) { - d = AssignDebug (d, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1405, (const char *) "Slice", 5); + d = AssignDebug (d, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1405, (const char *) "Slice", 5); } return d; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2224,7 +2224,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveComment (DynamicStrings_St } if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1517, (const char *) "RemoveComment", 13); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1517, (const char *) "RemoveComment", 13); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2249,7 +2249,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePrefix (DynamicString s = DynamicStrings_Slice (s, (int ) (i), 0); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1629, (const char *) "RemoveWhitePrefix", 17); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1629, (const char *) "RemoveWhitePrefix", 17); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2274,7 +2274,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePostfix (DynamicStrin s = DynamicStrings_Slice (s, 0, i+1); if (TraceOn) { - s = AssignDebug (s, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 1651, (const char *) "RemoveWhitePostfix", 18); + s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1651, (const char *) "RemoveWhitePostfix", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2423,12 +2423,12 @@ extern "C" char DynamicStrings_char (DynamicStrings_String s, int i) extern "C" void * DynamicStrings_string (DynamicStrings_String s) { - typedef char *_T2; + typedef char *string__T2; DynamicStrings_String a; unsigned int l; unsigned int i; - _T2 p; + string__T2 p; if (PoisonOn) { @@ -2450,7 +2450,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s) s->head->charStarSize = l+1; s->head->charStarUsed = TRUE; } - p = static_cast<_T2> (s->head->charStar); + p = static_cast (s->head->charStar); a = s; while (a != NULL) { @@ -2586,12 +2586,12 @@ extern "C" DynamicStrings_String DynamicStrings_SliceDB (DynamicStrings_String s extern "C" void DynamicStrings_PushAllocation (void) { - frame f; + DynamicStrings_frame f; if (CheckOn) { Init (); - Storage_ALLOCATE ((void **) &f, sizeof (frameRec)); + Storage_ALLOCATE ((void **) &f, sizeof (DynamicStrings_frameRec)); f->next = frameHead; f->alloc = NULL; f->dealloc = NULL; @@ -2632,7 +2632,7 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt) extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e) { DynamicStrings_String s; - frame f; + DynamicStrings_frame f; unsigned int b; Init (); @@ -2643,7 +2643,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned { stop (); /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's") */ - M2RTS_Halt ((const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 86, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); + M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); } else { @@ -2678,12 +2678,12 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned __builtin_unreachable (); } -extern "C" void _M2_DynamicStrings_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_DynamicStrings_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Initialized = FALSE; Init (); } -extern "C" void _M2_DynamicStrings_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_DynamicStrings_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GFIO.c b/gcc/m2/pge-boot/GFIO.c index a3436943249..536828ed96a 100644 --- a/gcc/m2/pge-boot/GFIO.c +++ b/gcc/m2/pge-boot/GFIO.c @@ -74,50 +74,50 @@ FIO_File FIO_StdIn; # define CreatePermissions 0666 # define MaxBufferLength (1024*16) # define MaxErrorString (1024*8) -typedef struct NameInfo_r NameInfo; +typedef struct FIO_NameInfo_r FIO_NameInfo; -typedef struct buf_r buf; +typedef struct FIO_buf_r FIO_buf; -typedef buf *Buffer; +typedef FIO_buf *FIO_Buffer; -typedef struct fds_r fds; +typedef struct FIO_fds_r FIO_fds; -typedef fds *FileDescriptor; +typedef FIO_fds *FIO_FileDescriptor; -typedef struct _T7_a _T7; +typedef struct FIO__T7_a FIO__T7; -typedef char *PtrToChar; +typedef char *FIO_PtrToChar; -typedef enum {successful, outofmemory, toomanyfilesopen, failed, connectionfailure, endofline, endoffile} FileStatus; +typedef enum {FIO_successful, FIO_outofmemory, FIO_toomanyfilesopen, FIO_failed, FIO_connectionfailure, FIO_endofline, FIO_endoffile} FIO_FileStatus; -typedef enum {unused, openedforread, openedforwrite, openedforrandom} FileUsage; +typedef enum {FIO_unused, FIO_openedforread, FIO_openedforwrite, FIO_openedforrandom} FIO_FileUsage; -struct NameInfo_r { - void *address; - unsigned int size; - }; +struct FIO_NameInfo_r { + void *address; + unsigned int size; + }; -struct buf_r { - unsigned int valid; - long int bufstart; - unsigned int position; - void *address; - unsigned int filled; - unsigned int size; - unsigned int left; - _T7 *contents; - }; +struct FIO_buf_r { + unsigned int valid; + long int bufstart; + unsigned int position; + void *address; + unsigned int filled; + unsigned int size; + unsigned int left; + FIO__T7 *contents; + }; -struct _T7_a { char array[MaxBufferLength+1]; }; -struct fds_r { - int unixfd; - NameInfo name; - FileStatus state; - FileUsage usage; - unsigned int output; - Buffer buffer; - long int abspos; - }; +struct FIO__T7_a { char array[MaxBufferLength+1]; }; +struct FIO_fds_r { + int unixfd; + FIO_NameInfo name; + FIO_FileStatus state; + FIO_FileUsage usage; + unsigned int output; + FIO_Buffer buffer; + long int abspos; + }; static Indexing_Index FileInfo; static FIO_File Error; @@ -248,7 +248,7 @@ extern "C" unsigned int FIO_EOLN (FIO_File f); extern "C" unsigned int FIO_WasEOLN (FIO_File f); /* - ReadChar - returns a character read from file, f. + ReadChar - returns a character read from file f. Sensible to check with IsNoError or EOF after calling this function. */ @@ -256,7 +256,7 @@ extern "C" unsigned int FIO_WasEOLN (FIO_File f); extern "C" char FIO_ReadChar (FIO_File f); /* - UnReadChar - replaces a character, ch, back into file, f. + UnReadChar - replaces a character, ch, back into file f. This character must have been read by ReadChar and it does not allow successive calls. It may only be called if the previous read was successful @@ -378,13 +378,13 @@ static FIO_File GetNextFreeDescriptor (void); SetState - sets the field, state, of file, f, to, s. */ -static void SetState (FIO_File f, FileStatus s); +static void SetState (FIO_File f, FIO_FileStatus s); /* InitializeFile - initialize a file descriptor */ -static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FileStatus fstate, FileUsage use, unsigned int towrite, unsigned int buflength); +static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength); /* ConnectToUnix - connects a FIO file to a UNIX file descriptor. @@ -441,23 +441,25 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_ static void FormatError (const char *a_, unsigned int _a_high); /* - FormatError1 - fairly generic error procedure. + FormatError1 - generic error procedure taking standard format string + and single parameter. */ static void FormatError1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high); /* - FormatError2 - fairly generic error procedure. + FormatError2 - generic error procedure taking standard format string + and two parameters. */ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high); /* - CheckAccess - checks to see whether a file, f, has been + CheckAccess - checks to see whether a file f has been opened for read/write. */ -static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite); +static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite); /* SetEndOfLine - @@ -479,7 +481,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a); PreInitialize - preinitialize the file descriptor. */ -static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FileStatus state, FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize); +static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize); /* Init - initialize the modules, global variables. @@ -535,7 +537,7 @@ static FIO_File GetNextFreeDescriptor (void) { FIO_File f; FIO_File h; - FileDescriptor fd; + FIO_FileDescriptor fd; f = Error+1; h = Indexing_HighIndice (FileInfo); @@ -543,7 +545,7 @@ static FIO_File GetNextFreeDescriptor (void) { if (f <= h) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { return f; @@ -556,7 +558,7 @@ static FIO_File GetNextFreeDescriptor (void) return f; /* create new slot */ } } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } @@ -565,11 +567,11 @@ static FIO_File GetNextFreeDescriptor (void) SetState - sets the field, state, of file, f, to, s. */ -static void SetState (FIO_File f, FileStatus s) +static void SetState (FIO_File f, FIO_FileStatus s) { - FileDescriptor fd; + FIO_FileDescriptor fd; - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); fd->state = s; } @@ -578,15 +580,15 @@ static void SetState (FIO_File f, FileStatus s) InitializeFile - initialize a file descriptor */ -static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FileStatus fstate, FileUsage use, unsigned int towrite, unsigned int buflength) +static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength) { - PtrToChar p; - FileDescriptor fd; + FIO_PtrToChar p; + FIO_FileDescriptor fd; - Storage_ALLOCATE ((void **) &fd, sizeof (fds)); + Storage_ALLOCATE ((void **) &fd, sizeof (FIO_fds)); if (fd == NULL) { - SetState (Error, outofmemory); + SetState (Error, FIO_outofmemory); return Error; } else @@ -598,20 +600,20 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, Storage_ALLOCATE (&fd->name.address, fd->name.size); if (fd->name.address == NULL) { - fd->state = outofmemory; + fd->state = FIO_outofmemory; return f; } fd->name.address = libc_strncpy (fd->name.address, fname, flength); /* and assign nul to the last byte */ - p = static_cast (fd->name.address); + p = static_cast (fd->name.address); p += flength; (*p) = ASCII_nul; fd->abspos = 0; /* now for the buffer */ - Storage_ALLOCATE ((void **) &fd->buffer, sizeof (buf)); + Storage_ALLOCATE ((void **) &fd->buffer, sizeof (FIO_buf)); if (fd->buffer == NULL) { - SetState (Error, outofmemory); + SetState (Error, FIO_outofmemory); return Error; } else @@ -630,7 +632,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, Storage_ALLOCATE (&fd->buffer->address, fd->buffer->size); if (fd->buffer->address == NULL) { - fd->state = outofmemory; + fd->state = FIO_outofmemory; return f; } } @@ -642,7 +644,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, { fd->buffer->left = 0; } - fd->buffer->contents = reinterpret_cast<_T7 *> (fd->buffer->address); /* provides easy access for reading characters */ + fd->buffer->contents = reinterpret_cast (fd->buffer->address); /* provides easy access for reading characters */ fd->state = fstate; /* provides easy access for reading characters */ } } @@ -658,11 +660,11 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if (towrite) @@ -682,7 +684,7 @@ static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfil } if (fd->unixfd < 0) { - fd->state = connectionfailure; + fd->state = FIO_connectionfailure; } } } @@ -701,19 +703,19 @@ static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfil static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) { - typedef unsigned char *_T1; + typedef unsigned char *ReadFromBuffer__T1; void * t; int result; unsigned int total; unsigned int n; - _T1 p; - FileDescriptor fd; + ReadFromBuffer__T1 p; + FIO_FileDescriptor fd; if (f != Error) { total = 0; /* how many bytes have we read */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* how many bytes have we read */ + fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* how many bytes have we read */ /* extract from the buffer first */ if ((fd->buffer != NULL) && fd->buffer->valid) { @@ -723,7 +725,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T1> (a); + p = static_cast (a); (*p) = static_cast ((*fd->buffer->contents).array[fd->buffer->position]); fd->buffer->left -= 1; /* remove consumed bytes */ fd->buffer->position += 1; /* move onwards n bytes */ @@ -736,7 +738,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T1> (libc_memcpy (a, t, static_cast (n))); + p = static_cast (libc_memcpy (a, t, static_cast (n))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move onwards ready for direct reads */ @@ -770,11 +772,11 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) if (result == 0) { /* eof reached */ - fd->state = endoffile; + fd->state = FIO_endoffile; } else { - fd->state = failed; + fd->state = FIO_failed; } /* indicate buffer is empty */ if (fd->buffer != NULL) @@ -811,19 +813,19 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) { - typedef unsigned char *_T3; + typedef unsigned char *BufferedRead__T3; void * t; int result; int total; int n; - _T3 p; - FileDescriptor fd; + BufferedRead__T3 p; + FIO_FileDescriptor fd; if (f != Error) { /* avoid dangling else. */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); total = 0; /* how many bytes have we read */ if (fd != NULL) /* how many bytes have we read */ { @@ -837,7 +839,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T3> (a); + p = static_cast (a); (*p) = static_cast ((*fd->buffer->contents).array[fd->buffer->position]); fd->buffer->left -= 1; /* remove consumed byte */ fd->buffer->position += 1; /* move onwards n byte */ @@ -849,7 +851,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T3> (libc_memcpy (a, t, static_cast (n))); + p = static_cast (libc_memcpy (a, t, static_cast (n))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move onwards ready for direct reads */ @@ -875,7 +877,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) if (n == 0) { /* eof reached */ - fd->state = endoffile; + fd->state = FIO_endoffile; return -1; } } @@ -885,7 +887,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) fd->buffer->position = 0; fd->buffer->left = 0; fd->buffer->filled = 0; - fd->state = failed; + fd->state = FIO_failed; return total; } } @@ -983,18 +985,18 @@ static void Cast (unsigned char *a, unsigned int _a_high, const unsigned char *b static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_, unsigned int _src_high, const unsigned char *w_, unsigned int _w_high) { - typedef struct _T8_a _T8; + typedef struct StringFormat1__T8_a StringFormat1__T8; - typedef char *_T4; + typedef char *StringFormat1__T4; - struct _T8_a { char array[MaxErrorString+1]; }; + struct StringFormat1__T8_a { char array[MaxErrorString+1]; }; unsigned int HighSrc; unsigned int HighDest; unsigned int c; unsigned int i; unsigned int j; - _T8 str; - _T4 p; + StringFormat1__T8 str; + StringFormat1__T4 p; char src[_src_high+1]; unsigned char w[_w_high+1]; @@ -1004,6 +1006,8 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_ HighSrc = StrLib_StrLen ((const char *) src, _src_high); HighDest = _dest_high; + p = NULL; + c = 0; i = 0; j = 0; while ((((i < HighSrc) && (src[i] != ASCII_nul)) && (j < HighDest)) && (src[i] != '%')) @@ -1093,15 +1097,16 @@ static void FormatError (const char *a_, unsigned int _a_high) /* - FormatError1 - fairly generic error procedure. + FormatError1 - generic error procedure taking standard format string + and single parameter. */ static void FormatError1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high) { - typedef struct _T9_a _T9; + typedef struct FormatError1__T9_a FormatError1__T9; - struct _T9_a { char array[MaxErrorString+1]; }; - _T9 s; + struct FormatError1__T9_a { char array[MaxErrorString+1]; }; + FormatError1__T9 s; char a[_a_high+1]; unsigned char w[_w_high+1]; @@ -1115,15 +1120,16 @@ static void FormatError1 (const char *a_, unsigned int _a_high, const unsigned c /* - FormatError2 - fairly generic error procedure. + FormatError2 - generic error procedure taking standard format string + and two parameters. */ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high) { - typedef struct _T10_a _T10; + typedef struct FormatError2__T10_a FormatError2__T10; - struct _T10_a { char array[MaxErrorString+1]; }; - _T10 s; + struct FormatError2__T10_a { char array[MaxErrorString+1]; }; + FormatError2__T10 s; char a[_a_high+1]; unsigned char w1[_w1_high+1]; unsigned char w2[_w2_high+1]; @@ -1139,18 +1145,18 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c /* - CheckAccess - checks to see whether a file, f, has been + CheckAccess - checks to see whether a file f has been opened for read/write. */ -static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) +static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { /* avoid dangling else. */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { if (f != FIO_StdErr) @@ -1162,20 +1168,20 @@ static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) } else { - if ((use == openedforwrite) && (fd->usage == openedforread)) + if ((use == FIO_openedforwrite) && (fd->usage == FIO_openedforread)) { FormatError1 ((const char *) "this file (%s) has been opened for reading but is now being written\\n", 69, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); M2RTS_HALT (-1); __builtin_unreachable (); } - else if ((use == openedforread) && (fd->usage == openedforwrite)) + else if ((use == FIO_openedforread) && (fd->usage == FIO_openedforwrite)) { /* avoid dangling else. */ FormatError1 ((const char *) "this file (%s) has been opened for writing but is now being read\\n", 66, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); M2RTS_HALT (-1); __builtin_unreachable (); } - else if (fd->state == connectionfailure) + else if (fd->state == FIO_connectionfailure) { /* avoid dangling else. */ FormatError1 ((const char *) "this file (%s) was not successfully opened\\n", 44, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); @@ -1215,19 +1221,19 @@ static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) static void SetEndOfLine (FIO_File f, char ch) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (ch == ASCII_nl) { - fd->state = endofline; + fd->state = FIO_endofline; } else { - fd->state = successful; + fd->state = FIO_successful; } } } @@ -1243,18 +1249,18 @@ static void SetEndOfLine (FIO_File f, char ch) static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) { - typedef unsigned char *_T5; + typedef unsigned char *BufferedWrite__T5; void * t; int result; int total; int n; - _T5 p; - FileDescriptor fd; + BufferedWrite__T5 p; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { total = 0; /* how many bytes have we read */ @@ -1268,7 +1274,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T5> (a); + p = static_cast (a); (*fd->buffer->contents).array[fd->buffer->position] = static_cast ((*p)); fd->buffer->left -= 1; /* reduce space */ fd->buffer->position += 1; /* move onwards n byte */ @@ -1280,7 +1286,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T5> (libc_memcpy (a, t, static_cast ((unsigned int ) (n)))); + p = static_cast (libc_memcpy (a, t, static_cast ((unsigned int ) (n)))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move ready for further writes */ @@ -1292,7 +1298,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) else { FIO_FlushBuffer (f); - if ((fd->state != successful) && (fd->state != endofline)) + if ((fd->state != FIO_successful) && (fd->state != FIO_endofline)) { nBytes = 0; } @@ -1312,10 +1318,10 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) PreInitialize - preinitialize the file descriptor. */ -static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FileStatus state, FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize) +static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize) { - FileDescriptor fd; - FileDescriptor fe; + FIO_FileDescriptor fd; + FIO_FileDescriptor fe; char fname[_fname_high+1]; /* make a local copy of each unbounded array. */ @@ -1323,10 +1329,10 @@ static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_h if ((InitializeFile (f, &fname, StrLib_StrLen ((const char *) fname, _fname_high), state, use, towrite, bufsize)) == f) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (f == Error) { - fe = static_cast (Indexing_GetIndice (FileInfo, FIO_StdErr)); + fe = static_cast (Indexing_GetIndice (FileInfo, FIO_StdErr)); if (fe == NULL) { M2RTS_HALT (-1); @@ -1358,13 +1364,13 @@ static void Init (void) { FileInfo = Indexing_InitIndex (0); Error = 0; - PreInitialize (Error, (const char *) "error", 5, toomanyfilesopen, unused, FALSE, -1, 0); + PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, FALSE, -1, 0); FIO_StdIn = 1; - PreInitialize (FIO_StdIn, (const char *) "", 7, successful, openedforread, FALSE, 0, MaxBufferLength); + PreInitialize (FIO_StdIn, (const char *) "", 7, FIO_successful, FIO_openedforread, FALSE, 0, MaxBufferLength); FIO_StdOut = 2; - PreInitialize (FIO_StdOut, (const char *) "", 8, successful, openedforwrite, TRUE, 1, MaxBufferLength); + PreInitialize (FIO_StdOut, (const char *) "", 8, FIO_successful, FIO_openedforwrite, TRUE, 1, MaxBufferLength); FIO_StdErr = 3; - PreInitialize (FIO_StdErr, (const char *) "", 8, successful, openedforwrite, TRUE, 2, MaxBufferLength); + PreInitialize (FIO_StdErr, (const char *) "", 8, FIO_successful, FIO_openedforwrite, TRUE, 2, MaxBufferLength); if (! (M2RTS_InstallTerminationProcedure ((PROC ) {(PROC_t) FIO_FlushOutErr}))) { M2RTS_HALT (-1); @@ -1379,7 +1385,7 @@ static void Init (void) extern "C" unsigned int FIO_IsNoError (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f == Error) { @@ -1387,8 +1393,8 @@ extern "C" unsigned int FIO_IsNoError (FIO_File f) } else { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - return (fd != NULL) && (((fd->state == successful) || (fd->state == endoffile)) || (fd->state == endofline)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + return (fd != NULL) && (((fd->state == FIO_successful) || (fd->state == FIO_endoffile)) || (fd->state == FIO_endofline)); } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -1473,11 +1479,11 @@ extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_h extern "C" void FIO_Close (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* we allow users to close files which have an error status */ @@ -1489,7 +1495,7 @@ extern "C" void FIO_Close (FIO_File f) if ((libc_close (fd->unixfd)) != 0) { FormatError1 ((const char *) "failed to close file (%s)\\n", 27, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); - fd->state = failed; /* --fixme-- too late to notify user (unless we return a BOOLEAN) */ + fd->state = FIO_failed; /* --fixme-- too late to notify user (unless we return a BOOLEAN) */ } } if (fd->name.address != NULL) @@ -1502,10 +1508,10 @@ extern "C" void FIO_Close (FIO_File f) { Storage_DEALLOCATE (&fd->buffer->address, fd->buffer->size); } - Storage_DEALLOCATE ((void **) &fd->buffer, sizeof (buf)); + Storage_DEALLOCATE ((void **) &fd->buffer, sizeof (FIO_buf)); fd->buffer = NULL; } - Storage_DEALLOCATE ((void **) &fd, sizeof (fds)); + Storage_DEALLOCATE ((void **) &fd, sizeof (FIO_fds)); Indexing_PutIndice (FileInfo, f, NULL); } } @@ -1550,11 +1556,11 @@ extern "C" FIO_File FIO_openToRead (void * fname, unsigned int flength) f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforread, FALSE, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, FALSE, MaxBufferLength); ConnectToUnix (f, FALSE, FALSE); } return f; @@ -1577,11 +1583,11 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength) f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforwrite, TRUE, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, TRUE, MaxBufferLength); ConnectToUnix (f, TRUE, TRUE); } return f; @@ -1606,11 +1612,11 @@ extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsig f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforrandom, towrite, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforrandom, towrite, MaxBufferLength); ConnectToUnix (f, towrite, newfile); } return f; @@ -1625,11 +1631,11 @@ extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsig extern "C" void FIO_FlushBuffer (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if (fd->output && (fd->buffer != NULL)) @@ -1644,7 +1650,7 @@ extern "C" void FIO_FlushBuffer (FIO_File f) } else { - fd->state = failed; + fd->state = FIO_failed; } } } @@ -1661,14 +1667,14 @@ extern "C" void FIO_FlushBuffer (FIO_File f) extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * dest) { - typedef char *_T2; + typedef char *ReadNBytes__T2; int n; - _T2 p; + ReadNBytes__T2 p; if (f != Error) { - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); n = ReadFromBuffer (f, dest, nBytes); if (n <= 0) { @@ -1676,7 +1682,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * } else { - p = static_cast<_T2> (dest); + p = static_cast (dest); p += n-1; SetEndOfLine (f, (*p)); return n; @@ -1699,8 +1705,8 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high) { - CheckAccess (f, openedforread, FALSE); - if ((BufferedRead (f, _a_high, a)) == _a_high) + CheckAccess (f, FIO_openedforread, FALSE); + if ((BufferedRead (f, _a_high, a)) == ((int ) (_a_high))) { SetEndOfLine (f, static_cast (a[_a_high])); } @@ -1718,19 +1724,19 @@ extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high) extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * src) { int total; - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforwrite, TRUE); + CheckAccess (f, FIO_openedforwrite, TRUE); FIO_FlushBuffer (f); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { total = static_cast (libc_write (fd->unixfd, src, static_cast ((int ) (nBytes)))); if (total < 0) { - fd->state = failed; + fd->state = FIO_failed; return 0; } else @@ -1758,8 +1764,8 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high) { - CheckAccess (f, openedforwrite, TRUE); - if ((BufferedWrite (f, _a_high, a)) == _a_high) + CheckAccess (f, FIO_openedforwrite, TRUE); + if ((BufferedWrite (f, _a_high, a)) == ((int ) (_a_high))) {} /* empty. */ } @@ -1770,8 +1776,8 @@ extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high extern "C" void FIO_WriteChar (FIO_File f, char ch) { - CheckAccess (f, openedforwrite, TRUE); - if ((BufferedWrite (f, sizeof (ch), &ch)) == sizeof (ch)) + CheckAccess (f, FIO_openedforwrite, TRUE); + if ((BufferedWrite (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch)))) {} /* empty. */ } @@ -1782,15 +1788,15 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch) extern "C" unsigned int FIO_EOF (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { - return fd->state == endoffile; + return fd->state == FIO_endoffile; } } return TRUE; @@ -1807,22 +1813,22 @@ extern "C" unsigned int FIO_EOF (FIO_File f) extern "C" unsigned int FIO_EOLN (FIO_File f) { char ch; - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); /* we will read a character and then push it back onto the input stream, having noted the file status, we also reset the status. */ if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { - if ((fd->state == successful) || (fd->state == endofline)) + if ((fd->state == FIO_successful) || (fd->state == FIO_endofline)) { ch = FIO_ReadChar (f); - if ((fd->state == successful) || (fd->state == endofline)) + if ((fd->state == FIO_successful) || (fd->state == FIO_endofline)) { FIO_UnReadChar (f, ch); } @@ -1842,17 +1848,17 @@ extern "C" unsigned int FIO_EOLN (FIO_File f) extern "C" unsigned int FIO_WasEOLN (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f == Error) { return FALSE; } else { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - return (fd != NULL) && (fd->state == endofline); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + return (fd != NULL) && (fd->state == FIO_endofline); } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -1860,7 +1866,7 @@ extern "C" unsigned int FIO_WasEOLN (FIO_File f) /* - ReadChar - returns a character read from file, f. + ReadChar - returns a character read from file f. Sensible to check with IsNoError or EOF after calling this function. */ @@ -1869,8 +1875,8 @@ extern "C" char FIO_ReadChar (FIO_File f) { char ch; - CheckAccess (f, openedforread, FALSE); - if ((BufferedRead (f, sizeof (ch), &ch)) == sizeof (ch)) + CheckAccess (f, FIO_openedforread, FALSE); + if ((BufferedRead (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch)))) { SetEndOfLine (f, ch); return ch; @@ -1885,7 +1891,7 @@ extern "C" char FIO_ReadChar (FIO_File f) /* - UnReadChar - replaces a character, ch, back into file, f. + UnReadChar - replaces a character, ch, back into file f. This character must have been read by ReadChar and it does not allow successive calls. It may only be called if the previous read was successful @@ -1897,27 +1903,27 @@ extern "C" char FIO_ReadChar (FIO_File f) extern "C" void FIO_UnReadChar (FIO_File f, char ch) { - FileDescriptor fd; + FIO_FileDescriptor fd; unsigned int n; void * a; void * b; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - if (((fd->state == successful) || (fd->state == endoffile)) || (fd->state == endofline)) + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + if (((fd->state == FIO_successful) || (fd->state == FIO_endoffile)) || (fd->state == FIO_endofline)) { /* avoid dangling else. */ if ((fd->buffer != NULL) && fd->buffer->valid) { /* we assume that a ReadChar has occurred, we will check just in case. */ - if (fd->state == endoffile) + if (fd->state == FIO_endoffile) { fd->buffer->position = MaxBufferLength; fd->buffer->left = 0; fd->buffer->filled = 0; - fd->state = successful; + fd->state = FIO_successful; } if (fd->buffer->position > 0) { @@ -1992,7 +1998,7 @@ extern "C" void FIO_ReadString (FIO_File f, char *a, unsigned int _a_high) unsigned int i; char ch; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); high = _a_high; i = 0; do { @@ -2050,11 +2056,11 @@ extern "C" unsigned int FIO_ReadCardinal (FIO_File f) extern "C" int FIO_GetUnixFileDescriptor (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { return fd->unixfd; @@ -2074,11 +2080,11 @@ extern "C" int FIO_GetUnixFileDescriptor (FIO_File f) extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) { long int offset; - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { /* always force the lseek, until we are confident that abspos is always correct, @@ -2106,7 +2112,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) } else { - fd->state = failed; + fd->state = FIO_failed; fd->abspos = 0; } if (fd->buffer != NULL) @@ -2127,11 +2133,11 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) { long int offset; - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { FIO_FlushBuffer (f); @@ -2155,7 +2161,7 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) } else { - fd->state = failed; + fd->state = FIO_failed; fd->abspos = 0; offset = 0; } @@ -2175,11 +2181,11 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) extern "C" long int FIO_FindPosition (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if ((fd->buffer == NULL) || ! fd->buffer->valid) @@ -2204,15 +2210,15 @@ extern "C" long int FIO_FindPosition (FIO_File f) extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) { - typedef char *_T6; + typedef char *GetFileName__T6; unsigned int i; - _T6 p; - FileDescriptor fd; + GetFileName__T6 p; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); @@ -2227,7 +2233,7 @@ extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) } else { - p = static_cast<_T6> (fd->name.address); + p = static_cast (fd->name.address); i = 0; while (((*p) != ASCII_nul) && (i <= _a_high)) { @@ -2247,11 +2253,11 @@ extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) extern "C" void * FIO_getFileName (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); @@ -2263,7 +2269,7 @@ extern "C" void * FIO_getFileName (FIO_File f) return fd->name.address; } } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } @@ -2274,11 +2280,11 @@ extern "C" void * FIO_getFileName (FIO_File f) extern "C" unsigned int FIO_getFileNameLength (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); @@ -2290,7 +2296,7 @@ extern "C" unsigned int FIO_getFileNameLength (FIO_File f) return fd->name.size; } } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } @@ -2314,12 +2320,12 @@ extern "C" void FIO_FlushOutErr (void) } } -extern "C" void _M2_FIO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_FIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Init (); } -extern "C" void _M2_FIO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_FIO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { FIO_FlushOutErr (); } diff --git a/gcc/m2/pge-boot/GIO.c b/gcc/m2/pge-boot/GIO.c index e8221fcebca..de62c058838 100644 --- a/gcc/m2/pge-boot/GIO.c +++ b/gcc/m2/pge-boot/GIO.c @@ -53,17 +53,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # include "Gtermios.h" # define MaxDefaultFd 2 -typedef struct BasicFds_r BasicFds; +typedef struct IO_BasicFds_r IO_BasicFds; -typedef struct _T1_a _T1; +typedef struct IO__T1_a IO__T1; -struct BasicFds_r { - unsigned int IsEof; - unsigned int IsRaw; - }; +struct IO_BasicFds_r { + unsigned int IsEof; + unsigned int IsRaw; + }; -struct _T1_a { BasicFds array[MaxDefaultFd+1]; }; -static _T1 fdState; +struct IO__T1_a { IO_BasicFds array[MaxDefaultFd+1]; }; +static IO__T1 fdState; /* IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2. @@ -469,11 +469,11 @@ extern "C" void IO_EchoOff (int fd, unsigned int input) term = termios_KillTermios (term); } -extern "C" void _M2_IO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_IO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Init (); } -extern "C" void _M2_IO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_IO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GIndexing.c b/gcc/m2/pge-boot/GIndexing.c index ae13d4443d0..02e0c3d6ec4 100644 --- a/gcc/m2/pge-boot/GIndexing.c +++ b/gcc/m2/pge-boot/GIndexing.c @@ -58,26 +58,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct Indexing_IndexProcedure_p Indexing_IndexProcedure; # define MinSize 128 -typedef struct _T2_r _T2; +typedef struct Indexing__T2_r Indexing__T2; -typedef void * *PtrToAddress; +typedef void * *Indexing_PtrToAddress; -typedef _T2 *Indexing_Index; +typedef Indexing__T2 *Indexing_Index; -typedef unsigned char *PtrToByte; +typedef unsigned char *Indexing_PtrToByte; typedef void (*Indexing_IndexProcedure_t) (void *); struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; }; -struct _T2_r { - void *ArrayStart; - unsigned int ArraySize; - unsigned int Used; - unsigned int Low; - unsigned int High; - unsigned int Debug; - unsigned int Map; - }; +struct Indexing__T2_r { + void *ArrayStart; + unsigned int ArraySize; + unsigned int Used; + unsigned int Low; + unsigned int High; + unsigned int Debug; + unsigned int Map; + }; /* @@ -169,7 +169,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low) { Indexing_Index i; - Storage_ALLOCATE ((void **) &i, sizeof (_T2)); + Storage_ALLOCATE ((void **) &i, sizeof (Indexing__T2)); i->Low = low; i->High = 0; i->ArraySize = MinSize; @@ -191,7 +191,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low) extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index i) { Storage_DEALLOCATE (&i->ArrayStart, i->ArraySize); - Storage_DEALLOCATE ((void **) &i, sizeof (_T2)); + Storage_DEALLOCATE ((void **) &i, sizeof (Indexing__T2)); return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -227,7 +227,7 @@ extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n) { return (n >= i->Low) && (n <= i->High); } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } @@ -247,7 +247,7 @@ extern "C" unsigned int Indexing_HighIndice (Indexing_Index i) { return i->High; } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } @@ -267,7 +267,7 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) { return i->Low; } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/Indexing.def", 25, 1); __builtin_unreachable (); } @@ -278,11 +278,11 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) { - typedef unsigned int * *_T1; + typedef unsigned int * *PutIndice__T1; unsigned int oldSize; void * b; - _T1 p; + PutIndice__T1 p; if (! (Indexing_InBounds (i, n))) { @@ -320,7 +320,7 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) } b = i->ArrayStart; b = reinterpret_cast (reinterpret_cast (b)+(n-i->Low)*sizeof (void *)); - p = static_cast<_T1> (b); + p = static_cast (b); (*p) = reinterpret_cast (a); i->Used += 1; if (i->Debug) @@ -339,17 +339,17 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n) { - PtrToByte b; - PtrToAddress p; + Indexing_PtrToByte b; + Indexing_PtrToAddress p; if (! (Indexing_InBounds (i, n))) { M2RTS_HALT (-1); __builtin_unreachable (); } - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); b += (n-i->Low)*sizeof (void *); - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); if (i->Debug) { if (((n < 32) && (! ((((1 << (n)) & (i->Map)) != 0)))) && ((*p) != NULL)) @@ -371,14 +371,14 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n) extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a) { unsigned int j; - PtrToByte b; - PtrToAddress p; + Indexing_PtrToByte b; + Indexing_PtrToAddress p; j = i->Low; - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); while (j <= i->High) { - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); if ((*p) == a) { return TRUE; @@ -401,14 +401,14 @@ extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a) { unsigned int j; unsigned int k; - PtrToAddress p; - PtrToByte b; + Indexing_PtrToAddress p; + Indexing_PtrToByte b; j = i->Low; - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); while (j <= i->High) { - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); b += sizeof (void *); if ((*p) == a) { @@ -425,16 +425,16 @@ extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a) extern "C" void Indexing_DeleteIndice (Indexing_Index i, unsigned int j) { - PtrToAddress p; - PtrToByte b; + Indexing_PtrToAddress p; + Indexing_PtrToByte b; if (Indexing_InBounds (i, j)) { - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); b += sizeof (void *)*(j-i->Low); - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); b += sizeof (void *); - p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((i->High-j)*sizeof (void *)))); + p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((i->High-j)*sizeof (void *)))); i->High -= 1; i->Used -= 1; } @@ -484,10 +484,10 @@ extern "C" void Indexing_ForeachIndiceInIndexDo (Indexing_Index i, Indexing_Inde } } -extern "C" void _M2_Indexing_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Indexing_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Indexing_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Indexing_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GLists.c b/gcc/m2/pge-boot/GLists.c index 972b535937a..14b93c2c6c4 100644 --- a/gcc/m2/pge-boot/GLists.c +++ b/gcc/m2/pge-boot/GLists.c @@ -48,21 +48,21 @@ along with GNU Modula-2; see the file COPYING3. If not see typedef struct SymbolKey_PerformOperation_p SymbolKey_PerformOperation; # define MaxNoOfElements 5 -typedef struct list_r list; +typedef struct Lists_list_r Lists_list; -typedef struct _T1_a _T1; +typedef struct Lists__T1_a Lists__T1; -typedef list *Lists_List; +typedef Lists_list *Lists_List; typedef void (*SymbolKey_PerformOperation_t) (unsigned int); struct SymbolKey_PerformOperation_p { SymbolKey_PerformOperation_t proc; }; -struct _T1_a { unsigned int array[MaxNoOfElements-1+1]; }; -struct list_r { - unsigned int NoOfElements; - _T1 Elements; - Lists_List Next; - }; +struct Lists__T1_a { unsigned int array[MaxNoOfElements-1+1]; }; +struct Lists_list_r { + unsigned int NoOfElements; + Lists__T1 Elements; + Lists_List Next; + }; /* @@ -153,7 +153,7 @@ static void RemoveItem (Lists_List p, Lists_List l, unsigned int i) if ((l->NoOfElements == 0) && (p != NULL)) { p->Next = l->Next; - Storage_DEALLOCATE ((void **) &l, sizeof (list)); + Storage_DEALLOCATE ((void **) &l, sizeof (Lists_list)); } } @@ -164,7 +164,7 @@ static void RemoveItem (Lists_List p, Lists_List l, unsigned int i) extern "C" void Lists_InitList (Lists_List *l) { - Storage_ALLOCATE ((void **) &(*l), sizeof (list)); + Storage_ALLOCATE ((void **) &(*l), sizeof (Lists_list)); (*l)->NoOfElements = 0; (*l)->Next = NULL; } @@ -182,7 +182,7 @@ extern "C" void Lists_KillList (Lists_List *l) { Lists_KillList (&(*l)->Next); } - Storage_DEALLOCATE ((void **) &(*l), sizeof (list)); + Storage_DEALLOCATE ((void **) &(*l), sizeof (Lists_list)); } } @@ -418,10 +418,10 @@ extern "C" Lists_List Lists_DuplicateList (Lists_List l) __builtin_unreachable (); } -extern "C" void _M2_Lists_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Lists_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Lists_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Lists_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GM2Dependent.c b/gcc/m2/pge-boot/GM2Dependent.c index f78e771e1c3..227a551fb0a 100644 --- a/gcc/m2/pge-boot/GM2Dependent.c +++ b/gcc/m2/pge-boot/GM2Dependent.c @@ -60,38 +60,38 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP; -typedef struct DependencyList_r DependencyList; +typedef struct M2Dependent_DependencyList_r M2Dependent_DependencyList; -typedef struct _T2_r _T2; +typedef struct M2Dependent__T2_r M2Dependent__T2; -typedef _T2 *ModuleChain; +typedef M2Dependent__T2 *M2Dependent_ModuleChain; -typedef struct _T3_a _T3; +typedef struct M2Dependent__T3_a M2Dependent__T3; -typedef enum {unregistered, unordered, started, ordered, user} DependencyState; +typedef enum {M2Dependent_unregistered, M2Dependent_unordered, M2Dependent_started, M2Dependent_ordered, M2Dependent_user} M2Dependent_DependencyState; typedef void (*M2Dependent_ArgCVEnvP_t) (int, void *, void *); struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; }; -struct DependencyList_r { - PROC proc; - unsigned int forced; - unsigned int forc; - unsigned int appl; - DependencyState state; - }; - -struct _T3_a { ModuleChain array[user-unregistered+1]; }; -struct _T2_r { - void *name; - M2Dependent_ArgCVEnvP init; - M2Dependent_ArgCVEnvP fini; - DependencyList dependency; - ModuleChain prev; - ModuleChain next; - }; - -static _T3 Modules; +struct M2Dependent_DependencyList_r { + PROC proc; + unsigned int forced; + unsigned int forc; + unsigned int appl; + M2Dependent_DependencyState state; + }; + +struct M2Dependent__T3_a { M2Dependent_ModuleChain array[M2Dependent_user-M2Dependent_unregistered+1]; }; +struct M2Dependent__T2_r { + void *name; + M2Dependent_ArgCVEnvP init; + M2Dependent_ArgCVEnvP fini; + M2Dependent_DependencyList dependency; + M2Dependent_ModuleChain prev; + M2Dependent_ModuleChain next; + }; + +static M2Dependent__T3 Modules; static unsigned int Initialized; static unsigned int ModuleTrace; static unsigned int DependencyTrace; @@ -134,39 +134,39 @@ extern "C" void M2Dependent_RequestDependant (void * modulename, void * dependan ModuleChain. */ -static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies); +static M2Dependent_ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies); /* AppendModule - append chain to end of the list. */ -static void AppendModule (ModuleChain *head, ModuleChain chain); +static void AppendModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain); /* RemoveModule - remove chain from double linked list head. */ -static void RemoveModule (ModuleChain *head, ModuleChain chain); +static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain); /* onChain - returns TRUE if mptr is on the Modules[state] list. */ -static unsigned int onChain (DependencyState state, ModuleChain mptr); +static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr); /* LookupModuleN - lookup module from the state list. The string is limited to nchar. */ -static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned int nchar); +static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state, void * name, unsigned int nchar); /* LookupModule - lookup and return the ModuleChain pointer containing module name from a particular list. */ -static ModuleChain LookupModule (DependencyState state, void * name); +static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name); /* toCString - replace any character sequence @@ -212,13 +212,13 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str It updates the mptr state appropriately. */ -static void moveTo (DependencyState newstate, ModuleChain mptr); +static void moveTo (M2Dependent_DependencyState newstate, M2Dependent_ModuleChain mptr); /* ResolveDependant - */ -static void ResolveDependant (ModuleChain mptr, void * currentmodule); +static void ResolveDependant (M2Dependent_ModuleChain mptr, void * currentmodule); /* PerformRequestDependant - the current modulename has a dependancy upon @@ -239,7 +239,7 @@ static void ResolveDependencies (void * currentmodule); DisplayModuleInfo - displays all module in the state. */ -static void DisplayModuleInfo (DependencyState state, const char *name_, unsigned int _name_high); +static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *name_, unsigned int _name_high); /* DumpModuleData - @@ -254,7 +254,7 @@ static void DumpModuleData (unsigned int flag); src := NIL. */ -static void combine (DependencyState src, DependencyState dest); +static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyState dest); /* ForceDependencies - if the user has specified a forced order then we override @@ -263,6 +263,13 @@ static void combine (DependencyState src, DependencyState dest); static void ForceDependencies (void); +/* + CheckApplication - check to see that the application is the last entry in the list. + This might happen if the application only imports FOR C modules. +*/ + +static void CheckApplication (void); + /* equal - return TRUE if C string cstr is equal to str. */ @@ -310,16 +317,16 @@ static void CheckInitialized (void); ModuleChain. */ -static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies) +static M2Dependent_ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; - Storage_ALLOCATE ((void **) &mptr, sizeof (_T2)); + Storage_ALLOCATE ((void **) &mptr, sizeof (M2Dependent__T2)); mptr->name = name; mptr->init = init; mptr->fini = fini; mptr->dependency.proc = dependencies; - mptr->dependency.state = unregistered; + mptr->dependency.state = M2Dependent_unregistered; mptr->prev = NULL; mptr->next = NULL; return mptr; @@ -332,7 +339,7 @@ static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Depe AppendModule - append chain to end of the list. */ -static void AppendModule (ModuleChain *head, ModuleChain chain) +static void AppendModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain) { if ((*head) == NULL) { @@ -354,7 +361,7 @@ static void AppendModule (ModuleChain *head, ModuleChain chain) RemoveModule - remove chain from double linked list head. */ -static void RemoveModule (ModuleChain *head, ModuleChain chain) +static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain) { if ((chain->next == (*head)) && (chain == (*head))) { @@ -376,20 +383,20 @@ static void RemoveModule (ModuleChain *head, ModuleChain chain) onChain - returns TRUE if mptr is on the Modules[state] list. */ -static unsigned int onChain (DependencyState state, ModuleChain mptr) +static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr) { - ModuleChain ptr; + M2Dependent_ModuleChain ptr; - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { - ptr = Modules.array[state-unregistered]; + ptr = Modules.array[state-M2Dependent_unregistered]; do { if (ptr == mptr) { return TRUE; } ptr = ptr->next; - } while (! (ptr == Modules.array[state-unregistered])); + } while (! (ptr == Modules.array[state-M2Dependent_unregistered])); } return FALSE; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -402,20 +409,20 @@ static unsigned int onChain (DependencyState state, ModuleChain mptr) to nchar. */ -static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned int nchar) +static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state, void * name, unsigned int nchar) { - ModuleChain ptr; + M2Dependent_ModuleChain ptr; - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { - ptr = Modules.array[state-unregistered]; + ptr = Modules.array[state-M2Dependent_unregistered]; do { if ((strncmp (reinterpret_cast (ptr->name), reinterpret_cast (name), nchar)) == 0) { return ptr; } ptr = ptr->next; - } while (! (ptr == Modules.array[state-unregistered])); + } while (! (ptr == Modules.array[state-M2Dependent_unregistered])); } return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -428,7 +435,7 @@ static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned i module name from a particular list. */ -static ModuleChain LookupModule (DependencyState state, void * name) +static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name) { return LookupModuleN (state, name, static_cast (strlen_ (reinterpret_cast (name)))); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -606,14 +613,14 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str It updates the mptr state appropriately. */ -static void moveTo (DependencyState newstate, ModuleChain mptr) +static void moveTo (M2Dependent_DependencyState newstate, M2Dependent_ModuleChain mptr) { if (onChain (mptr->dependency.state, mptr)) { - RemoveModule (&Modules.array[mptr->dependency.state-unregistered], mptr); + RemoveModule (&Modules.array[mptr->dependency.state-M2Dependent_unregistered], mptr); } mptr->dependency.state = newstate; - AppendModule (&Modules.array[mptr->dependency.state-unregistered], mptr); + AppendModule (&Modules.array[mptr->dependency.state-M2Dependent_unregistered], mptr); } @@ -621,7 +628,7 @@ static void moveTo (DependencyState newstate, ModuleChain mptr) ResolveDependant - */ -static void ResolveDependant (ModuleChain mptr, void * currentmodule) +static void ResolveDependant (M2Dependent_ModuleChain mptr, void * currentmodule) { if (mptr == NULL) { @@ -629,17 +636,17 @@ static void ResolveDependant (ModuleChain mptr, void * currentmodule) } else { - if (onChain (started, mptr)) + if (onChain (M2Dependent_started, mptr)) { traceprintf (DependencyTrace, (const char *) " processing...\\n", 18); } else { - moveTo (started, mptr); + moveTo (M2Dependent_started, mptr); traceprintf2 (DependencyTrace, (const char *) " starting: %s\\n", 17, currentmodule); (*mptr->dependency.proc.proc) (); /* Invoke and process the dependency graph. */ traceprintf2 (DependencyTrace, (const char *) " finished: %s\\n", 17, currentmodule); /* Invoke and process the dependency graph. */ - moveTo (ordered, mptr); + moveTo (M2Dependent_ordered, mptr); } } } @@ -654,32 +661,32 @@ static void ResolveDependant (ModuleChain mptr, void * currentmodule) static void PerformRequestDependant (void * modulename, void * dependantmodule) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; traceprintf2 (DependencyTrace, (const char *) " module %s", 11, modulename); if (dependantmodule == NULL) { /* avoid dangling else. */ traceprintf2 (DependencyTrace, (const char *) " has finished its import graph\\n", 32, modulename); - mptr = LookupModule (unordered, modulename); + mptr = LookupModule (M2Dependent_unordered, modulename); if (mptr != NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is now ordered\\n", 28, modulename); - moveTo (ordered, mptr); + moveTo (M2Dependent_ordered, mptr); } } else { traceprintf2 (DependencyTrace, (const char *) " imports from %s\\n", 18, dependantmodule); - mptr = LookupModule (ordered, dependantmodule); + mptr = LookupModule (M2Dependent_ordered, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is not ordered\\n", 28, dependantmodule); - mptr = LookupModule (unordered, dependantmodule); + mptr = LookupModule (M2Dependent_unordered, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is not unordered\\n", 30, dependantmodule); - mptr = LookupModule (started, dependantmodule); + mptr = LookupModule (M2Dependent_started, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s has not started\\n", 29, dependantmodule); @@ -712,14 +719,14 @@ static void PerformRequestDependant (void * modulename, void * dependantmodule) static void ResolveDependencies (void * currentmodule) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; - mptr = LookupModule (unordered, currentmodule); + mptr = LookupModule (M2Dependent_unordered, currentmodule); while (mptr != NULL) { traceprintf2 (DependencyTrace, (const char *) " attempting to resolve the dependants for %s\\n", 48, currentmodule); ResolveDependant (mptr, currentmodule); - mptr = Modules.array[unordered-unregistered]; + mptr = Modules.array[M2Dependent_unordered-M2Dependent_unregistered]; } } @@ -728,20 +735,23 @@ static void ResolveDependencies (void * currentmodule) DisplayModuleInfo - displays all module in the state. */ -static void DisplayModuleInfo (DependencyState state, const char *name_, unsigned int _name_high) +static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *name_, unsigned int _name_high) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; + unsigned int count; char name[_name_high+1]; /* make a local copy of each unbounded array. */ memcpy (name, name_, _name_high+1); - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { libc_printf ((const char *) "%s modules\\n", 12, &name); - mptr = Modules.array[state-unregistered]; + mptr = Modules.array[state-M2Dependent_unregistered]; + count = 0; do { - libc_printf ((const char *) " %s", 4, mptr->name); + libc_printf ((const char *) " %d %s", 8, count, mptr->name); + count += 1; if (mptr->dependency.appl) { libc_printf ((const char *) " application", 12); @@ -756,7 +766,7 @@ static void DisplayModuleInfo (DependencyState state, const char *name_, unsigne } libc_printf ((const char *) "\\n", 2); mptr = mptr->next; - } while (! (mptr == Modules.array[state-unregistered])); + } while (! (mptr == Modules.array[state-M2Dependent_unregistered])); } } @@ -767,14 +777,14 @@ static void DisplayModuleInfo (DependencyState state, const char *name_, unsigne static void DumpModuleData (unsigned int flag) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; if (flag) { - DisplayModuleInfo (unregistered, (const char *) "unregistered", 12); - DisplayModuleInfo (unordered, (const char *) "unordered", 9); - DisplayModuleInfo (started, (const char *) "started", 7); - DisplayModuleInfo (ordered, (const char *) "ordered", 7); + DisplayModuleInfo (M2Dependent_unregistered, (const char *) "unregistered", 12); + DisplayModuleInfo (M2Dependent_unordered, (const char *) "unordered", 9); + DisplayModuleInfo (M2Dependent_started, (const char *) "started", 7); + DisplayModuleInfo (M2Dependent_ordered, (const char *) "ordered", 7); } } @@ -786,15 +796,15 @@ static void DumpModuleData (unsigned int flag) src := NIL. */ -static void combine (DependencyState src, DependencyState dest) +static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyState dest) { - ModuleChain last; + M2Dependent_ModuleChain last; - while (Modules.array[src-unregistered] != NULL) + while (Modules.array[src-M2Dependent_unregistered] != NULL) { - last = Modules.array[src-unregistered]->prev; - moveTo (ordered, last); - Modules.array[dest-unregistered] = last; /* New item is at the head. */ + last = Modules.array[src-M2Dependent_unregistered]->prev; + moveTo (M2Dependent_ordered, last); + Modules.array[dest-M2Dependent_unregistered] = last; /* New item is at the head. */ } } @@ -806,8 +816,8 @@ static void combine (DependencyState src, DependencyState dest) static void ForceDependencies (void) { - ModuleChain mptr; - ModuleChain userChain; + M2Dependent_ModuleChain mptr; + M2Dependent_ModuleChain userChain; unsigned int count; M2LINK_PtrToChar pc; M2LINK_PtrToChar start; @@ -822,11 +832,11 @@ static void ForceDependencies (void) { if ((*pc) == ',') { - mptr = LookupModuleN (ordered, reinterpret_cast (start), count); + mptr = LookupModuleN (M2Dependent_ordered, reinterpret_cast (start), count); if (mptr != NULL) { mptr->dependency.forced = TRUE; - moveTo (user, mptr); + moveTo (M2Dependent_user, mptr); } pc += 1; start = pc; @@ -840,14 +850,46 @@ static void ForceDependencies (void) } if (start != pc) { - mptr = LookupModuleN (ordered, reinterpret_cast (start), count); + mptr = LookupModuleN (M2Dependent_ordered, reinterpret_cast (start), count); if (mptr != NULL) { mptr->dependency.forced = TRUE; - moveTo (user, mptr); + moveTo (M2Dependent_user, mptr); } } - combine (user, ordered); + combine (M2Dependent_user, M2Dependent_ordered); + } +} + + +/* + CheckApplication - check to see that the application is the last entry in the list. + This might happen if the application only imports FOR C modules. +*/ + +static void CheckApplication (void) +{ + M2Dependent_ModuleChain mptr; + M2Dependent_ModuleChain appl; + + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]; + if (mptr != NULL) + { + appl = NULL; + do { + if (mptr->dependency.appl) + { + appl = mptr; + } + else + { + mptr = mptr->next; + } + } while (! ((appl != NULL) || (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered]))); + if (appl != NULL) + { + Modules.array[M2Dependent_ordered-M2Dependent_unregistered] = appl->next; + } } } @@ -889,16 +931,16 @@ static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high static void SetupDebugFlags (void) { - typedef char *_T1; + typedef char *SetupDebugFlags__T1; - _T1 pc; + SetupDebugFlags__T1 pc; ModuleTrace = FALSE; DependencyTrace = FALSE; PostTrace = FALSE; PreTrace = FALSE; ForceTrace = FALSE; - pc = static_cast<_T1> (libc_getenv (const_cast (reinterpret_cast("GCC_M2LINK_RTFLAG")))); + pc = static_cast (libc_getenv (const_cast (reinterpret_cast("GCC_M2LINK_RTFLAG")))); while ((pc != NULL) && ((*pc) != ASCII_nul)) { if (equal (reinterpret_cast (pc), (const char *) "all", 3)) @@ -955,12 +997,12 @@ static void SetupDebugFlags (void) static void Init (void) { - DependencyState state; + M2Dependent_DependencyState state; SetupDebugFlags (); - for (state=unregistered; state<=user; state= static_cast(static_cast(state+1))) + for (state=M2Dependent_unregistered; state<=M2Dependent_user; state= static_cast(static_cast(state+1))) { - Modules.array[state-unregistered] = NULL; + Modules.array[state-M2Dependent_unregistered] = NULL; } } @@ -989,12 +1031,12 @@ static void CheckInitialized (void) extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc, void * argv, void * envp) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; M2Dependent_ArgCVEnvP nulp; CheckInitialized (); traceprintf2 (ModuleTrace, (const char *) "application module: %s\\n", 24, applicationmodule); - mptr = LookupModule (unordered, applicationmodule); + mptr = LookupModule (M2Dependent_unordered, applicationmodule); if (mptr != NULL) { mptr->dependency.appl = TRUE; @@ -1007,7 +1049,10 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc ForceDependencies (); traceprintf (ForceTrace, (const char *) "After user forcing ordering\\n", 29); DumpModuleData (ForceTrace); - if (Modules.array[ordered-unregistered] == NULL) + CheckApplication (); + traceprintf (ForceTrace, (const char *) "After runtime forces application to the end\\n", 45); + DumpModuleData (ForceTrace); + if (Modules.array[M2Dependent_ordered-M2Dependent_unregistered] == NULL) { traceprintf2 (ModuleTrace, (const char *) " module: %s has not registered itself using a global constructor\\n", 67, applicationmodule); traceprintf2 (ModuleTrace, (const char *) " hint try compile and linking using: gm2 %s.mod\\n", 50, applicationmodule); @@ -1015,7 +1060,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc } else { - mptr = Modules.array[ordered-unregistered]; + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]; do { if (mptr->dependency.forc) { @@ -1034,7 +1079,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc } (*mptr->init.proc) (argc, argv, envp); mptr = mptr->next; - } while (! (mptr == Modules.array[ordered-unregistered])); + } while (! (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered])); } } @@ -1046,10 +1091,10 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int argc, void * argv, void * envp) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; traceprintf2 (ModuleTrace, (const char *) "application module finishing: %s\\n", 34, applicationmodule); - if (Modules.array[ordered-unregistered] == NULL) + if (Modules.array[M2Dependent_ordered-M2Dependent_unregistered] == NULL) { traceprintf (ModuleTrace, (const char *) " no ordered modules found during finishing\\n", 45); } @@ -1058,7 +1103,7 @@ extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int ar traceprintf (ModuleTrace, (const char *) "ExecuteTerminationProcedures\\n", 30); M2RTS_ExecuteTerminationProcedures (); traceprintf (ModuleTrace, (const char *) "terminating modules in sequence\\n", 33); - mptr = Modules.array[ordered-unregistered]->prev; + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]->prev; do { if (mptr->dependency.forc) { @@ -1070,7 +1115,7 @@ extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int ar } (*mptr->fini.proc) (argc, argv, envp); mptr = mptr->prev; - } while (! (mptr == Modules.array[ordered-unregistered]->prev)); + } while (! (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered]->prev)); } } @@ -1087,7 +1132,7 @@ extern "C" void M2Dependent_RegisterModule (void * name, M2Dependent_ArgCVEnvP i if (! M2LINK_StaticInitialization) { traceprintf2 (ModuleTrace, (const char *) "module: %s registering\\n", 24, name); - moveTo (unordered, CreateModule (name, init, fini, dependencies)); + moveTo (M2Dependent_unordered, CreateModule (name, init, fini, dependencies)); } } @@ -1107,11 +1152,11 @@ extern "C" void M2Dependent_RequestDependant (void * modulename, void * dependan } } -extern "C" void _M2_M2Dependent_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2Dependent_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { CheckInitialized (); } -extern "C" void _M2_M2Dependent_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2Dependent_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.c b/gcc/m2/pge-boot/GM2EXCEPTION.c index 4dc9a3fade8..8c341514555 100644 --- a/gcc/m2/pge-boot/GM2EXCEPTION.c +++ b/gcc/m2/pge-boot/GM2EXCEPTION.c @@ -56,13 +56,13 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void) n = RTExceptions_GetNumber (e); if (n == (UINT_MAX)) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); } else { return (M2EXCEPTION_M2Exceptions) (n); } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); __builtin_unreachable (); } @@ -78,11 +78,11 @@ extern "C" unsigned int M2EXCEPTION_IsM2Exception (void) __builtin_unreachable (); } -extern "C" void _M2_M2EXCEPTION_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2EXCEPTION_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { RTExceptions_SetExceptionBlock (RTExceptions_InitExceptionBlock ()); } -extern "C" void _M2_M2EXCEPTION_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2EXCEPTION_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GM2RTS.c b/gcc/m2/pge-boot/GM2RTS.c index cb27377bb43..adeb301db59 100644 --- a/gcc/m2/pge-boot/GM2RTS.c +++ b/gcc/m2/pge-boot/GM2RTS.c @@ -64,30 +64,30 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP; -typedef struct ProcedureList_r ProcedureList; +typedef struct M2RTS_ProcedureList_r M2RTS_ProcedureList; -typedef char *PtrToChar; +typedef char *M2RTS_PtrToChar; -typedef struct _T1_r _T1; +typedef struct M2RTS__T1_r M2RTS__T1; -typedef _T1 *ProcedureChain; +typedef M2RTS__T1 *M2RTS_ProcedureChain; typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *); struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; }; -struct ProcedureList_r { - ProcedureChain head; - ProcedureChain tail; - }; +struct M2RTS_ProcedureList_r { + M2RTS_ProcedureChain head; + M2RTS_ProcedureChain tail; + }; -struct _T1_r { - PROC p; - ProcedureChain prev; - ProcedureChain next; - }; +struct M2RTS__T1_r { + PROC p; + M2RTS_ProcedureChain prev; + M2RTS_ProcedureChain next; + }; -static ProcedureList InitialProc; -static ProcedureList TerminateProc; +static M2RTS_ProcedureList InitialProc; +static M2RTS_ProcedureList TerminateProc; static int ExitValue; static unsigned int isHalting; static unsigned int CallExit; @@ -233,14 +233,14 @@ extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned procedures in the chain. */ -static void ExecuteReverse (ProcedureChain procptr); +static void ExecuteReverse (M2RTS_ProcedureChain procptr); /* AppendProc - append proc to the end of the procedure list defined by proclist. */ -static unsigned int AppendProc (ProcedureList *proclist, PROC proc); +static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc); /* ErrorString - writes a string to stderr. @@ -252,7 +252,7 @@ static void ErrorString (const char *a_, unsigned int _a_high); InitProcList - initialize the head and tail pointers to NIL. */ -static void InitProcList (ProcedureList *p); +static void InitProcList (M2RTS_ProcedureList *p); /* Init - initialize the initial, terminate procedure lists and booleans. @@ -276,7 +276,7 @@ static void CheckInitialized (void); procedures in the chain. */ -static void ExecuteReverse (ProcedureChain procptr) +static void ExecuteReverse (M2RTS_ProcedureChain procptr) { while (procptr != NULL) { @@ -291,11 +291,11 @@ static void ExecuteReverse (ProcedureChain procptr) defined by proclist. */ -static unsigned int AppendProc (ProcedureList *proclist, PROC proc) +static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc) { - ProcedureChain pdes; + M2RTS_ProcedureChain pdes; - Storage_ALLOCATE ((void **) &pdes, sizeof (_T1)); + Storage_ALLOCATE ((void **) &pdes, sizeof (M2RTS__T1)); pdes->p = proc; pdes->prev = (*proclist).tail; pdes->next = NULL; @@ -330,7 +330,7 @@ static void ErrorString (const char *a_, unsigned int _a_high) InitProcList - initialize the head and tail pointers to NIL. */ -static void InitProcList (ProcedureList *p) +static void InitProcList (M2RTS_ProcedureList *p) { (*p).head = NULL; (*p).tail = NULL; @@ -556,10 +556,10 @@ extern "C" void M2RTS_ExitOnHalt (int e) extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high) { - typedef struct _T2_a _T2; + typedef struct ErrorMessage__T2_a ErrorMessage__T2; - struct _T2_a { char array[10+1]; }; - _T2 LineNo; + struct ErrorMessage__T2_a { char array[10+1]; }; + ErrorMessage__T2 LineNo; char message[_message_high+1]; char file[_file_high+1]; char function[_function_high+1]; @@ -737,11 +737,11 @@ extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), filename, line, column, scope, message); } -extern "C" void _M2_M2RTS_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2RTS_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { CheckInitialized (); } -extern "C" void _M2_M2RTS_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_M2RTS_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GNameKey.c b/gcc/m2/pge-boot/GNameKey.c index 5c5e42194b6..491c310e721 100644 --- a/gcc/m2/pge-boot/GNameKey.c +++ b/gcc/m2/pge-boot/GNameKey.c @@ -60,22 +60,22 @@ along with GNU Modula-2; see the file COPYING3. If not see # define NameKey_NulName 0 typedef unsigned int NameKey_Name; -typedef struct Node_r Node; +typedef struct NameKey_Node_r NameKey_Node; -typedef char *PtrToChar; +typedef char *NameKey_PtrToChar; -typedef Node *NameNode; +typedef NameKey_Node *NameKey_NameNode; -typedef enum {less, equal, greater} Comparison; +typedef enum {NameKey_less, NameKey_equal, NameKey_greater} NameKey_Comparison; -struct Node_r { - PtrToChar Data; - NameKey_Name Key; - NameNode Left; - NameNode Right; - }; +struct NameKey_Node_r { + NameKey_PtrToChar Data; + NameKey_Name Key; + NameKey_NameNode Left; + NameKey_NameNode Right; + }; -static NameNode BinaryTree; +static NameKey_NameNode BinaryTree; static Indexing_Index KeyIndex; static unsigned int LastIndice; @@ -149,13 +149,13 @@ extern "C" char NameKey_CharKey (NameKey_Name key, unsigned int i); If a name is found then the string, n, is deallocated. */ -static NameKey_Name DoMakeKey (PtrToChar n, unsigned int higha); +static NameKey_Name DoMakeKey (NameKey_PtrToChar n, unsigned int higha); /* Compare - return the result of Names[i] with Names[j] */ -static Comparison Compare (PtrToChar pi, NameKey_Name j); +static NameKey_Comparison Compare (NameKey_PtrToChar pi, NameKey_Name j); /* FindNodeAndParentInTree - search BinaryTree for a name. @@ -164,7 +164,7 @@ static Comparison Compare (PtrToChar pi, NameKey_Name j); A comparison is returned to assist adding entries into this tree. */ -static Comparison FindNodeAndParentInTree (PtrToChar n, NameNode *child, NameNode *father); +static NameKey_Comparison FindNodeAndParentInTree (NameKey_PtrToChar n, NameKey_NameNode *child, NameKey_NameNode *father); /* @@ -172,25 +172,25 @@ static Comparison FindNodeAndParentInTree (PtrToChar n, NameNode *child, NameNod If a name is found then the string, n, is deallocated. */ -static NameKey_Name DoMakeKey (PtrToChar n, unsigned int higha) +static NameKey_Name DoMakeKey (NameKey_PtrToChar n, unsigned int higha) { - Comparison result; - NameNode father; - NameNode child; + NameKey_Comparison result; + NameKey_NameNode father; + NameKey_NameNode child; NameKey_Name k; result = FindNodeAndParentInTree (n, &child, &father); if (child == NULL) { - if (result == less) + if (result == NameKey_less) { - Storage_ALLOCATE ((void **) &child, sizeof (Node)); + Storage_ALLOCATE ((void **) &child, sizeof (NameKey_Node)); father->Left = child; } - else if (result == greater) + else if (result == NameKey_greater) { /* avoid dangling else. */ - Storage_ALLOCATE ((void **) &child, sizeof (Node)); + Storage_ALLOCATE ((void **) &child, sizeof (NameKey_Node)); father->Right = child; } child->Right = NULL; @@ -216,25 +216,25 @@ static NameKey_Name DoMakeKey (PtrToChar n, unsigned int higha) Compare - return the result of Names[i] with Names[j] */ -static Comparison Compare (PtrToChar pi, NameKey_Name j) +static NameKey_Comparison Compare (NameKey_PtrToChar pi, NameKey_Name j) { - PtrToChar pj; + NameKey_PtrToChar pj; char c1; char c2; - pj = static_cast (NameKey_KeyToCharStar (j)); + pj = static_cast (NameKey_KeyToCharStar (j)); c1 = (*pi); c2 = (*pj); while ((c1 != ASCII_nul) || (c2 != ASCII_nul)) { if (c1 < c2) { - return less; + return NameKey_less; } else if (c1 > c2) { /* avoid dangling else. */ - return greater; + return NameKey_greater; } else { @@ -245,7 +245,7 @@ static Comparison Compare (PtrToChar pi, NameKey_Name j) c2 = (*pj); } } - return equal; + return NameKey_equal; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -258,33 +258,33 @@ static Comparison Compare (PtrToChar pi, NameKey_Name j) A comparison is returned to assist adding entries into this tree. */ -static Comparison FindNodeAndParentInTree (PtrToChar n, NameNode *child, NameNode *father) +static NameKey_Comparison FindNodeAndParentInTree (NameKey_PtrToChar n, NameKey_NameNode *child, NameKey_NameNode *father) { - Comparison result; + NameKey_Comparison result; /* firstly set up the initial values of child and father, using sentinal node */ (*father) = BinaryTree; (*child) = BinaryTree->Left; if ((*child) == NULL) { - return less; + return NameKey_less; } else { do { result = Compare (n, (*child)->Key); - if (result == less) + if (result == NameKey_less) { (*father) = (*child); (*child) = (*child)->Left; } - else if (result == greater) + else if (result == NameKey_greater) { /* avoid dangling else. */ (*father) = (*child); (*child) = (*child)->Right; } - } while (! (((*child) == NULL) || (result == equal))); + } while (! (((*child) == NULL) || (result == NameKey_equal))); return result; } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -301,8 +301,8 @@ static Comparison FindNodeAndParentInTree (PtrToChar n, NameNode *child, NameNod extern "C" NameKey_Name NameKey_MakeKey (const char *a_, unsigned int _a_high) { - PtrToChar n; - PtrToChar p; + NameKey_PtrToChar n; + NameKey_PtrToChar p; unsigned int i; unsigned int higha; char a[_a_high+1]; @@ -330,7 +330,7 @@ extern "C" NameKey_Name NameKey_MakeKey (const char *a_, unsigned int _a_high) (*p) = ASCII_nul; return DoMakeKey (n, higha); } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-compiler/NameKey.def", 20, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-compiler/NameKey.def", 20, 1); __builtin_unreachable (); } @@ -345,9 +345,9 @@ extern "C" NameKey_Name NameKey_MakeKey (const char *a_, unsigned int _a_high) extern "C" NameKey_Name NameKey_makekey (void * a) { - PtrToChar n; - PtrToChar p; - PtrToChar pa; + NameKey_PtrToChar n; + NameKey_PtrToChar p; + NameKey_PtrToChar pa; unsigned int i; unsigned int higha; @@ -367,7 +367,7 @@ extern "C" NameKey_Name NameKey_makekey (void * a) else { n = p; - pa = static_cast (a); + pa = static_cast (a); i = 0; while (i < higha) { @@ -380,7 +380,7 @@ extern "C" NameKey_Name NameKey_makekey (void * a) return DoMakeKey (n, higha); } } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-compiler/NameKey.def", 20, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-compiler/NameKey.def", 20, 1); __builtin_unreachable (); } @@ -391,11 +391,11 @@ extern "C" NameKey_Name NameKey_makekey (void * a) extern "C" void NameKey_GetKey (NameKey_Name key, char *a, unsigned int _a_high) { - PtrToChar p; + NameKey_PtrToChar p; unsigned int i; unsigned int higha; - p = static_cast (NameKey_KeyToCharStar (key)); + p = static_cast (NameKey_KeyToCharStar (key)); i = 0; higha = _a_high; while (((p != NULL) && (i <= higha)) && ((*p) != ASCII_nul)) @@ -418,9 +418,9 @@ extern "C" void NameKey_GetKey (NameKey_Name key, char *a, unsigned int _a_high) extern "C" unsigned int NameKey_LengthKey (NameKey_Name Key) { unsigned int i; - PtrToChar p; + NameKey_PtrToChar p; - p = static_cast (NameKey_KeyToCharStar (Key)); + p = static_cast (NameKey_KeyToCharStar (Key)); i = 0; while ((*p) != ASCII_nul) { @@ -441,8 +441,8 @@ extern "C" unsigned int NameKey_LengthKey (NameKey_Name Key) extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high) { - NameNode child; - PtrToChar p; + NameKey_NameNode child; + NameKey_PtrToChar p; unsigned int i; unsigned int higha; char a[_a_high+1]; @@ -457,7 +457,7 @@ extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high) do { i = 0; higha = _a_high; - p = static_cast (NameKey_KeyToCharStar (child->Key)); + p = static_cast (NameKey_KeyToCharStar (child->Key)); while ((i <= higha) && (a[i] != ASCII_nul)) { if (a[i] < (*p)) @@ -504,9 +504,9 @@ extern "C" unsigned int NameKey_IsKey (const char *a_, unsigned int _a_high) extern "C" void NameKey_WriteKey (NameKey_Name key) { - PtrToChar s; + NameKey_PtrToChar s; - s = static_cast (NameKey_KeyToCharStar (key)); + s = static_cast (NameKey_KeyToCharStar (key)); while ((s != NULL) && ((*s) != ASCII_nul)) { StdIO_Write ((*s)); @@ -523,8 +523,8 @@ extern "C" void NameKey_WriteKey (NameKey_Name key) extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2) { - PtrToChar pi; - PtrToChar pj; + NameKey_PtrToChar pi; + NameKey_PtrToChar pj; char c1; char c2; @@ -534,8 +534,8 @@ extern "C" unsigned int NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_ } else { - pi = static_cast (NameKey_KeyToCharStar (key1)); - pj = static_cast (NameKey_KeyToCharStar (key2)); + pi = static_cast (NameKey_KeyToCharStar (key1)); + pj = static_cast (NameKey_KeyToCharStar (key2)); c1 = (*pi); c2 = (*pj); while ((c1 != ASCII_nul) && (c2 != ASCII_nul)) @@ -585,28 +585,28 @@ extern "C" void * NameKey_KeyToCharStar (NameKey_Name key) extern "C" char NameKey_CharKey (NameKey_Name key, unsigned int i) { - PtrToChar p; + NameKey_PtrToChar p; if (i >= (NameKey_LengthKey (key))) { M2RTS_HALT (-1); __builtin_unreachable (); } - p = static_cast (NameKey_KeyToCharStar (key)); + p = static_cast (NameKey_KeyToCharStar (key)); p += i; return (*p); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } -extern "C" void _M2_NameKey_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_NameKey_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { LastIndice = 0; KeyIndex = Indexing_InitIndex (1); - Storage_ALLOCATE ((void **) &BinaryTree, sizeof (Node)); + Storage_ALLOCATE ((void **) &BinaryTree, sizeof (NameKey_Node)); BinaryTree->Left = NULL; } -extern "C" void _M2_NameKey_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_NameKey_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GNumberIO.c b/gcc/m2/pge-boot/GNumberIO.c index 93e009e5ece..fb02da9115c 100644 --- a/gcc/m2/pge-boot/GNumberIO.c +++ b/gcc/m2/pge-boot/GNumberIO.c @@ -81,10 +81,10 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int extern "C" void NumberIO_ReadCard (unsigned int *x) { - typedef struct _T1_a _T1; + typedef struct ReadCard__T1_a ReadCard__T1; - struct _T1_a { char array[MaxLineLength+1]; }; - _T1 a; + struct ReadCard__T1_a { char array[MaxLineLength+1]; }; + ReadCard__T1 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToCard ((const char *) &a.array[0], MaxLineLength, x); @@ -92,10 +92,10 @@ extern "C" void NumberIO_ReadCard (unsigned int *x) extern "C" void NumberIO_WriteCard (unsigned int x, unsigned int n) { - typedef struct _T2_a _T2; + typedef struct WriteCard__T2_a WriteCard__T2; - struct _T2_a { char array[MaxLineLength+1]; }; - _T2 a; + struct WriteCard__T2_a { char array[MaxLineLength+1]; }; + WriteCard__T2 a; NumberIO_CardToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -103,10 +103,10 @@ extern "C" void NumberIO_WriteCard (unsigned int x, unsigned int n) extern "C" void NumberIO_ReadHex (unsigned int *x) { - typedef struct _T3_a _T3; + typedef struct ReadHex__T3_a ReadHex__T3; - struct _T3_a { char array[MaxLineLength+1]; }; - _T3 a; + struct ReadHex__T3_a { char array[MaxLineLength+1]; }; + ReadHex__T3 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToHex ((const char *) &a.array[0], MaxLineLength, x); @@ -114,10 +114,10 @@ extern "C" void NumberIO_ReadHex (unsigned int *x) extern "C" void NumberIO_WriteHex (unsigned int x, unsigned int n) { - typedef struct _T4_a _T4; + typedef struct WriteHex__T4_a WriteHex__T4; - struct _T4_a { char array[MaxLineLength+1]; }; - _T4 a; + struct WriteHex__T4_a { char array[MaxLineLength+1]; }; + WriteHex__T4 a; NumberIO_HexToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -125,10 +125,10 @@ extern "C" void NumberIO_WriteHex (unsigned int x, unsigned int n) extern "C" void NumberIO_ReadInt (int *x) { - typedef struct _T5_a _T5; + typedef struct ReadInt__T5_a ReadInt__T5; - struct _T5_a { char array[MaxLineLength+1]; }; - _T5 a; + struct ReadInt__T5_a { char array[MaxLineLength+1]; }; + ReadInt__T5 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToInt ((const char *) &a.array[0], MaxLineLength, x); @@ -136,10 +136,10 @@ extern "C" void NumberIO_ReadInt (int *x) extern "C" void NumberIO_WriteInt (int x, unsigned int n) { - typedef struct _T6_a _T6; + typedef struct WriteInt__T6_a WriteInt__T6; - struct _T6_a { char array[MaxLineLength+1]; }; - _T6 a; + struct WriteInt__T6_a { char array[MaxLineLength+1]; }; + WriteInt__T6 a; NumberIO_IntToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -147,13 +147,13 @@ extern "C" void NumberIO_WriteInt (int x, unsigned int n) extern "C" void NumberIO_CardToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T7_a _T7; + typedef struct CardToStr__T7_a CardToStr__T7; - struct _T7_a { unsigned int array[MaxDigits-1+1]; }; + struct CardToStr__T7_a { unsigned int array[MaxDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T7 buf; + CardToStr__T7 buf; i = 0; do { @@ -245,13 +245,13 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign extern "C" void NumberIO_HexToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T8_a _T8; + typedef struct HexToStr__T8_a HexToStr__T8; - struct _T8_a { unsigned int array[MaxHexDigits-1+1]; }; + struct HexToStr__T8_a { unsigned int array[MaxHexDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T8 buf; + HexToStr__T8 buf; i = 0; do { @@ -307,14 +307,14 @@ extern "C" void NumberIO_StrToHex (const char *a_, unsigned int _a_high, unsigne extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T9_a _T9; + typedef struct IntToStr__T9_a IntToStr__T9; - struct _T9_a { unsigned int array[MaxDigits-1+1]; }; + struct IntToStr__T9_a { unsigned int array[MaxDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int c; unsigned int Higha; - _T9 buf; + IntToStr__T9 buf; unsigned int Negative; if (x < 0) @@ -443,10 +443,10 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x) extern "C" void NumberIO_ReadOct (unsigned int *x) { - typedef struct _T10_a _T10; + typedef struct ReadOct__T10_a ReadOct__T10; - struct _T10_a { char array[MaxLineLength+1]; }; - _T10 a; + struct ReadOct__T10_a { char array[MaxLineLength+1]; }; + ReadOct__T10 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToOct ((const char *) &a.array[0], MaxLineLength, x); @@ -454,10 +454,10 @@ extern "C" void NumberIO_ReadOct (unsigned int *x) extern "C" void NumberIO_WriteOct (unsigned int x, unsigned int n) { - typedef struct _T11_a _T11; + typedef struct WriteOct__T11_a WriteOct__T11; - struct _T11_a { char array[MaxLineLength+1]; }; - _T11 a; + struct WriteOct__T11_a { char array[MaxLineLength+1]; }; + WriteOct__T11 a; NumberIO_OctToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -465,13 +465,13 @@ extern "C" void NumberIO_WriteOct (unsigned int x, unsigned int n) extern "C" void NumberIO_OctToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T12_a _T12; + typedef struct OctToStr__T12_a OctToStr__T12; - struct _T12_a { unsigned int array[MaxOctDigits-1+1]; }; + struct OctToStr__T12_a { unsigned int array[MaxOctDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T12 buf; + OctToStr__T12 buf; i = 0; do { @@ -520,10 +520,10 @@ extern "C" void NumberIO_StrToOct (const char *a_, unsigned int _a_high, unsigne extern "C" void NumberIO_ReadBin (unsigned int *x) { - typedef struct _T13_a _T13; + typedef struct ReadBin__T13_a ReadBin__T13; - struct _T13_a { char array[MaxLineLength+1]; }; - _T13 a; + struct ReadBin__T13_a { char array[MaxLineLength+1]; }; + ReadBin__T13 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToBin ((const char *) &a.array[0], MaxLineLength, x); @@ -531,10 +531,10 @@ extern "C" void NumberIO_ReadBin (unsigned int *x) extern "C" void NumberIO_WriteBin (unsigned int x, unsigned int n) { - typedef struct _T14_a _T14; + typedef struct WriteBin__T14_a WriteBin__T14; - struct _T14_a { char array[MaxLineLength+1]; }; - _T14 a; + struct WriteBin__T14_a { char array[MaxLineLength+1]; }; + WriteBin__T14 a; NumberIO_BinToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -542,13 +542,13 @@ extern "C" void NumberIO_WriteBin (unsigned int x, unsigned int n) extern "C" void NumberIO_BinToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T15_a _T15; + typedef struct BinToStr__T15_a BinToStr__T15; - struct _T15_a { unsigned int array[MaxBits-1+1]; }; + struct BinToStr__T15_a { unsigned int array[MaxBits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T15 buf; + BinToStr__T15 buf; i = 0; do { @@ -768,10 +768,10 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int } } -extern "C" void _M2_NumberIO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_NumberIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_NumberIO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_NumberIO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GOutput.c b/gcc/m2/pge-boot/GOutput.c index ee7fbc648ba..f2aa3f3d465 100644 --- a/gcc/m2/pge-boot/GOutput.c +++ b/gcc/m2/pge-boot/GOutput.c @@ -264,10 +264,10 @@ extern "C" void Output_WriteLn (void) extern "C" void Output_WriteCard (unsigned int card, unsigned int fieldlength) { - typedef struct _T1_a _T1; + typedef struct WriteCard__T1_a WriteCard__T1; - struct _T1_a { char array[20+1]; }; - _T1 s; + struct WriteCard__T1_a { char array[20+1]; }; + WriteCard__T1 s; NumberIO_CardToStr (card, fieldlength, (char *) &s.array[0], 20); Output_WriteString ((const char *) &s.array[0], 20); @@ -303,13 +303,13 @@ extern "C" DynamicStrings_String Output_EndBuffer (void) __builtin_unreachable (); } -extern "C" void _M2_Output_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Output_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { stdout_ = TRUE; buffer = static_cast (NULL); outputFile = FIO_StdOut; } -extern "C" void _M2_Output_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Output_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GPushBackInput.c b/gcc/m2/pge-boot/GPushBackInput.c index e491de6f29e..835dfe96a4c 100644 --- a/gcc/m2/pge-boot/GPushBackInput.c +++ b/gcc/m2/pge-boot/GPushBackInput.c @@ -57,14 +57,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define MaxPushBackStack 8192 # define MaxFileName 4096 -typedef struct _T2_a _T2; +typedef struct PushBackInput__T2_a PushBackInput__T2; -typedef struct _T3_a _T3; +typedef struct PushBackInput__T3_a PushBackInput__T3; -struct _T2_a { char array[MaxFileName+1]; }; -struct _T3_a { char array[MaxPushBackStack+1]; }; -static _T2 FileName; -static _T3 CharStack; +struct PushBackInput__T2_a { char array[MaxFileName+1]; }; +struct PushBackInput__T3_a { char array[MaxPushBackStack+1]; }; +static PushBackInput__T2 FileName; +static PushBackInput__T3 CharStack; static unsigned int ExitStatus; static unsigned int Column; static unsigned int StackPtr; @@ -275,7 +275,7 @@ extern "C" char PushBackInput_PutCh (char ch) } else { - Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, 150, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 85); + Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, 150, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); } return ch; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -301,7 +301,7 @@ extern "C" void PushBackInput_PutString (const char *a_, unsigned int _a_high) l -= 1; if ((PushBackInput_PutCh (a[l])) != a[l]) { - Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 85); + Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); } } } @@ -322,7 +322,7 @@ extern "C" void PushBackInput_PutStr (DynamicStrings_String s) i -= 1; if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast (i)))) != (DynamicStrings_char (s, static_cast (i)))) { - Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 85); + Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); } } } @@ -385,11 +385,11 @@ extern "C" void PushBackInput_WarnError (const char *a_, unsigned int _a_high) extern "C" void PushBackInput_WarnString (DynamicStrings_String s) { - typedef char *_T1; + typedef char *WarnString__T1; - _T1 p; + WarnString__T1 p; - p = static_cast<_T1> (DynamicStrings_string (s)); + p = static_cast (DynamicStrings_string (s)); StrIO_WriteString ((const char *) &FileName.array[0], MaxFileName); StdIO_Write (':'); NumberIO_WriteCard (LineNo, 0); @@ -478,12 +478,12 @@ extern "C" unsigned int PushBackInput_GetCurrentLine (void) __builtin_unreachable (); } -extern "C" void _M2_PushBackInput_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_PushBackInput_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { PushBackInput_SetDebug (FALSE); Init (); } -extern "C" void _M2_PushBackInput_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_PushBackInput_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GRTExceptions.c b/gcc/m2/pge-boot/GRTExceptions.c index d6412cbdf88..4ab1379af83 100644 --- a/gcc/m2/pge-boot/GRTExceptions.c +++ b/gcc/m2/pge-boot/GRTExceptions.c @@ -64,39 +64,39 @@ extern void throw (unsigned int); typedef struct RTExceptions_ProcedureHandler_p RTExceptions_ProcedureHandler; # define MaxBuffer 4096 -typedef struct _T1_r _T1; +typedef struct RTExceptions__T1_r RTExceptions__T1; -typedef char *PtrToChar; +typedef char *RTExceptions_PtrToChar; -typedef struct _T2_a _T2; +typedef struct RTExceptions__T2_a RTExceptions__T2; -typedef struct _T3_r _T3; +typedef struct RTExceptions__T3_r RTExceptions__T3; -typedef _T3 *Handler; +typedef RTExceptions__T3 *RTExceptions_Handler; -typedef _T1 *RTExceptions_EHBlock; +typedef RTExceptions__T1 *RTExceptions_EHBlock; typedef void (*RTExceptions_ProcedureHandler_t) (void); struct RTExceptions_ProcedureHandler_p { RTExceptions_ProcedureHandler_t proc; }; -struct _T2_a { char array[MaxBuffer+1]; }; -struct _T1_r { - _T2 buffer; - unsigned int number; - Handler handlers; - RTExceptions_EHBlock right; - }; - -struct _T3_r { - RTExceptions_ProcedureHandler p; - unsigned int n; - Handler right; - Handler left; - Handler stack; - }; +struct RTExceptions__T2_a { char array[MaxBuffer+1]; }; +struct RTExceptions__T1_r { + RTExceptions__T2 buffer; + unsigned int number; + RTExceptions_Handler handlers; + RTExceptions_EHBlock right; + }; + +struct RTExceptions__T3_r { + RTExceptions_ProcedureHandler p; + unsigned int n; + RTExceptions_Handler right; + RTExceptions_Handler left; + RTExceptions_Handler stack; + }; static unsigned int inException; -static Handler freeHandler; +static RTExceptions_Handler freeHandler; static RTExceptions_EHBlock freeEHB; static RTExceptions_EHBlock currentEHB; static void * currentSource; @@ -235,7 +235,7 @@ static void ErrorString (const char *a_, unsigned int _a_high); findHandler - */ -static Handler findHandler (RTExceptions_EHBlock e, unsigned int number); +static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number); /* InvokeHandler - invokes the associated handler for the current @@ -294,37 +294,37 @@ static RTExceptions_EHBlock New (void); NewHandler - returns a new handler. */ -static Handler NewHandler (void); +static RTExceptions_Handler NewHandler (void); /* KillHandler - returns, NIL, and places, h, onto the free list. */ -static Handler KillHandler (Handler h); +static RTExceptions_Handler KillHandler (RTExceptions_Handler h); /* KillHandlers - kills all handlers in the list. */ -static Handler KillHandlers (Handler h); +static RTExceptions_Handler KillHandlers (RTExceptions_Handler h); /* InitHandler - */ -static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned int number, RTExceptions_ProcedureHandler proc); +static RTExceptions_Handler InitHandler (RTExceptions_Handler h, RTExceptions_Handler l, RTExceptions_Handler r, RTExceptions_Handler s, unsigned int number, RTExceptions_ProcedureHandler proc); /* SubHandler - */ -static void SubHandler (Handler h); +static void SubHandler (RTExceptions_Handler h); /* AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, Handler h); +static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h); /* indexf - raise an index out of bounds exception. @@ -449,9 +449,9 @@ static void ErrorString (const char *a_, unsigned int _a_high) findHandler - */ -static Handler findHandler (RTExceptions_EHBlock e, unsigned int number) +static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number) { - Handler h; + RTExceptions_Handler h; h = e->handlers->right; while ((h != e->handlers) && (number != h->n)) @@ -478,7 +478,7 @@ static Handler findHandler (RTExceptions_EHBlock e, unsigned int number) static void InvokeHandler (void) { - Handler h; + RTExceptions_Handler h; h = findHandler (currentEHB, currentEHB->number); if (h == NULL) @@ -523,11 +523,11 @@ static void addChar (char ch, unsigned int *i) static void * stripPath (void * s) { - PtrToChar f; - PtrToChar p; + RTExceptions_PtrToChar f; + RTExceptions_PtrToChar p; - p = static_cast (s); - f = static_cast (s); + p = static_cast (s); + f = static_cast (s); while ((*p) != ASCII_nul) { if ((*p) == '/') @@ -553,9 +553,9 @@ static void * stripPath (void * s) static void addFile (void * s, unsigned int *i) { - PtrToChar p; + RTExceptions_PtrToChar p; - p = static_cast (stripPath (s)); + p = static_cast (stripPath (s)); while ((p != NULL) && ((*p) != ASCII_nul)) { addChar ((*p), i); @@ -571,9 +571,9 @@ static void addFile (void * s, unsigned int *i) static void addStr (void * s, unsigned int *i) { - PtrToChar p; + RTExceptions_PtrToChar p; - p = static_cast (s); + p = static_cast (s); while ((p != NULL) && ((*p) != ASCII_nul)) { addChar ((*p), i); @@ -611,7 +611,7 @@ static RTExceptions_EHBlock New (void) if (freeEHB == NULL) { - Storage_ALLOCATE ((void **) &e, sizeof (_T1)); + Storage_ALLOCATE ((void **) &e, sizeof (RTExceptions__T1)); } else { @@ -628,13 +628,13 @@ static RTExceptions_EHBlock New (void) NewHandler - returns a new handler. */ -static Handler NewHandler (void) +static RTExceptions_Handler NewHandler (void) { - Handler h; + RTExceptions_Handler h; if (freeHandler == NULL) { - Storage_ALLOCATE ((void **) &h, sizeof (_T3)); + Storage_ALLOCATE ((void **) &h, sizeof (RTExceptions__T3)); } else { @@ -651,7 +651,7 @@ static Handler NewHandler (void) KillHandler - returns, NIL, and places, h, onto the free list. */ -static Handler KillHandler (Handler h) +static RTExceptions_Handler KillHandler (RTExceptions_Handler h) { h->right = freeHandler; freeHandler = h; @@ -665,7 +665,7 @@ static Handler KillHandler (Handler h) KillHandlers - kills all handlers in the list. */ -static Handler KillHandlers (Handler h) +static RTExceptions_Handler KillHandlers (RTExceptions_Handler h) { h->left->right = freeHandler; freeHandler = h; @@ -679,7 +679,7 @@ static Handler KillHandlers (Handler h) InitHandler - */ -static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned int number, RTExceptions_ProcedureHandler proc) +static RTExceptions_Handler InitHandler (RTExceptions_Handler h, RTExceptions_Handler l, RTExceptions_Handler r, RTExceptions_Handler s, unsigned int number, RTExceptions_ProcedureHandler proc) { h->p = proc; h->n = number; @@ -696,7 +696,7 @@ static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned SubHandler - */ -static void SubHandler (Handler h) +static void SubHandler (RTExceptions_Handler h) { h->right->left = h->left; h->left->right = h->right; @@ -707,7 +707,7 @@ static void SubHandler (Handler h) AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, Handler h) +static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) { h->right = e->handlers; h->left = e->handlers->left; @@ -722,7 +722,7 @@ static void AddHandler (RTExceptions_EHBlock e, Handler h) static void indexf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 612, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 612, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); } @@ -732,7 +732,7 @@ static void indexf (void * a) static void range (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 624, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 624, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); } @@ -742,7 +742,7 @@ static void range (void * a) static void casef (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 636, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 636, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); } @@ -752,7 +752,7 @@ static void casef (void * a) static void invalidloc (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 648, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 648, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); } @@ -762,7 +762,7 @@ static void invalidloc (void * a) static void function (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 660, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 660, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ } @@ -772,7 +772,7 @@ static void function (void * a) static void wholevalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 672, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 672, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -782,7 +782,7 @@ static void wholevalue (void * a) static void wholediv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 684, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 684, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -792,7 +792,7 @@ static void wholediv (void * a) static void realvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 696, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 696, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); } @@ -802,7 +802,7 @@ static void realvalue (void * a) static void realdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 708, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 708, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); } @@ -812,7 +812,7 @@ static void realdiv (void * a) static void complexvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 720, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 720, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); } @@ -822,7 +822,7 @@ static void complexvalue (void * a) static void complexdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 732, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 732, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); } @@ -832,7 +832,7 @@ static void complexdiv (void * a) static void protection (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 744, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 744, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); } @@ -842,7 +842,7 @@ static void protection (void * a) static void systemf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 756, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 756, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); } @@ -852,7 +852,7 @@ static void systemf (void * a) static void coroutine (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 768, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 768, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); } @@ -862,7 +862,7 @@ static void coroutine (void * a) static void exception (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 780, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 780, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); } @@ -888,7 +888,7 @@ static void Init (void) static void TidyUp (void) { - Handler f; + RTExceptions_Handler f; RTExceptions_EHBlock e; if (currentEHB != NULL) @@ -899,13 +899,13 @@ static void TidyUp (void) { f = freeHandler; freeHandler = freeHandler->right; - Storage_DEALLOCATE ((void **) &f, sizeof (_T3)); + Storage_DEALLOCATE ((void **) &f, sizeof (RTExceptions__T3)); } while (freeEHB != NULL) { e = freeEHB; freeEHB = freeEHB->right; - Storage_DEALLOCATE ((void **) &e, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &e, sizeof (RTExceptions__T1)); } } @@ -1047,8 +1047,8 @@ extern "C" RTExceptions_EHBlock RTExceptions_KillExceptionBlock (RTExceptions_EH extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int number, RTExceptions_ProcedureHandler p) { - Handler h; - Handler i; + RTExceptions_Handler h; + RTExceptions_Handler i; h = findHandler (e, number); if (h == NULL) @@ -1074,8 +1074,8 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int number) { - Handler h; - Handler i; + RTExceptions_Handler h; + RTExceptions_Handler i; h = findHandler (e, number); if (h != NULL) @@ -1181,13 +1181,13 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void) { if (currentEHB == NULL) { - M2RTS_Halt ((const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod", 84, 598, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); + M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod", 60, 598, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); } else { return currentEHB; } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); __builtin_unreachable (); } @@ -1213,12 +1213,12 @@ extern "C" void * RTExceptions_GetExceptionSource (void) __builtin_unreachable (); } -extern "C" void _M2_RTExceptions_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_RTExceptions_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Init (); } -extern "C" void _M2_RTExceptions_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_RTExceptions_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { TidyUp (); } diff --git a/gcc/m2/pge-boot/GSFIO.c b/gcc/m2/pge-boot/GSFIO.c index 552ca612fde..7d204de5305 100644 --- a/gcc/m2/pge-boot/GSFIO.c +++ b/gcc/m2/pge-boot/GSFIO.c @@ -206,10 +206,10 @@ extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file) __builtin_unreachable (); } -extern "C" void _M2_SFIO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SFIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_SFIO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SFIO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GStdIO.c b/gcc/m2/pge-boot/GStdIO.c index 28a991d270e..2d630868597 100644 --- a/gcc/m2/pge-boot/GStdIO.c +++ b/gcc/m2/pge-boot/GStdIO.c @@ -43,9 +43,9 @@ typedef struct StdIO_ProcWrite_p StdIO_ProcWrite; typedef struct StdIO_ProcRead_p StdIO_ProcRead; # define MaxStack 40 -typedef struct _T1_a _T1; +typedef struct StdIO__T1_a StdIO__T1; -typedef struct _T2_a _T2; +typedef struct StdIO__T2_a StdIO__T2; typedef void (*StdIO_ProcWrite_t) (char); struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; @@ -53,11 +53,11 @@ struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; typedef void (*StdIO_ProcRead_t) (char *); struct StdIO_ProcRead_p { StdIO_ProcRead_t proc; }; -struct _T1_a { StdIO_ProcWrite array[MaxStack+1]; }; -struct _T2_a { StdIO_ProcRead array[MaxStack+1]; }; -static _T1 StackW; +struct StdIO__T1_a { StdIO_ProcWrite array[MaxStack+1]; }; +struct StdIO__T2_a { StdIO_ProcRead array[MaxStack+1]; }; +static StdIO__T1 StackW; static unsigned int StackWPtr; -static _T2 StackR; +static StdIO__T2 StackR; static unsigned int StackRPtr; /* @@ -191,7 +191,7 @@ extern "C" StdIO_ProcWrite StdIO_GetCurrentOutput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } @@ -250,11 +250,11 @@ extern "C" StdIO_ProcRead StdIO_GetCurrentInput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } -extern "C" void _M2_StdIO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StdIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { StackWPtr = 0; StackRPtr = 0; @@ -262,6 +262,6 @@ extern "C" void _M2_StdIO_init (__attribute__((unused)) int argc, __attribute__( StdIO_PushInput ((StdIO_ProcRead) {(StdIO_ProcRead_t) IO_Read}); } -extern "C" void _M2_StdIO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StdIO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GStorage.c b/gcc/m2/pge-boot/GStorage.c index 6f0df166407..e0e18f3ec10 100644 --- a/gcc/m2/pge-boot/GStorage.c +++ b/gcc/m2/pge-boot/GStorage.c @@ -63,10 +63,10 @@ extern "C" unsigned int Storage_Available (unsigned int Size) __builtin_unreachable (); } -extern "C" void _M2_Storage_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Storage_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_Storage_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_Storage_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GStrCase.c b/gcc/m2/pge-boot/GStrCase.c index 6e3f7ef7358..6e8003a9af0 100644 --- a/gcc/m2/pge-boot/GStrCase.c +++ b/gcc/m2/pge-boot/GStrCase.c @@ -166,10 +166,10 @@ extern "C" char StrCase_Lower (char ch) __builtin_unreachable (); } -extern "C" void _M2_StrCase_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrCase_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_StrCase_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrCase_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GStrIO.c b/gcc/m2/pge-boot/GStrIO.c index 1ff812c7e3c..180bdb07de5 100644 --- a/gcc/m2/pge-boot/GStrIO.c +++ b/gcc/m2/pge-boot/GStrIO.c @@ -266,12 +266,12 @@ extern "C" void StrIO_WriteString (const char *a_, unsigned int _a_high) } } -extern "C" void _M2_StrIO_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { /* IsATTY := isatty() */ IsATTY = FALSE; } -extern "C" void _M2_StrIO_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrIO_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GStrLib.c b/gcc/m2/pge-boot/GStrLib.c index eee535069c4..c2c7921c6dd 100644 --- a/gcc/m2/pge-boot/GStrLib.c +++ b/gcc/m2/pge-boot/GStrLib.c @@ -337,10 +337,10 @@ extern "C" void StrLib_StrRemoveWhitePrefix (const char *a_, unsigned int _a_hig } } -extern "C" void _M2_StrLib_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrLib_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_StrLib_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_StrLib_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GSymbolKey.c b/gcc/m2/pge-boot/GSymbolKey.c index 7719a233aa6..f164265373e 100644 --- a/gcc/m2/pge-boot/GSymbolKey.c +++ b/gcc/m2/pge-boot/GSymbolKey.c @@ -51,9 +51,9 @@ typedef struct SymbolKey_IsSymbol_p SymbolKey_IsSymbol; typedef struct SymbolKey_PerformOperation_p SymbolKey_PerformOperation; -typedef struct Node_r Node; +typedef struct SymbolKey_Node_r SymbolKey_Node; -typedef Node *SymbolKey_SymbolTree; +typedef SymbolKey_Node *SymbolKey_SymbolTree; typedef unsigned int (*SymbolKey_IsSymbol_t) (unsigned int); struct SymbolKey_IsSymbol_p { SymbolKey_IsSymbol_t proc; }; @@ -61,12 +61,12 @@ struct SymbolKey_IsSymbol_p { SymbolKey_IsSymbol_t proc; }; typedef void (*SymbolKey_PerformOperation_t) (unsigned int); struct SymbolKey_PerformOperation_p { SymbolKey_PerformOperation_t proc; }; -struct Node_r { - NameKey_Name KeyName; - unsigned int KeySym; - SymbolKey_SymbolTree Left; - SymbolKey_SymbolTree Right; - }; +struct SymbolKey_Node_r { + NameKey_Name KeyName; + unsigned int KeySym; + SymbolKey_SymbolTree Left; + SymbolKey_SymbolTree Right; + }; extern "C" void SymbolKey_InitTree (SymbolKey_SymbolTree *t); extern "C" void SymbolKey_KillTree (SymbolKey_SymbolTree *t); @@ -183,7 +183,7 @@ static void FindNodeParentInTree (SymbolKey_SymbolTree t, NameKey_Name n, Symbol (*parent) = t; if (t == NULL) { - Debug_Halt ((const char *) "parameter t should never be NIL", 31, 240, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 85); + Debug_Halt ((const char *) "parameter t should never be NIL", 31, 240, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 61); } Assertion_Assert (t->Right == NULL); (*child) = t->Left; @@ -284,7 +284,7 @@ static void SearchConditional (SymbolKey_SymbolTree t, SymbolKey_IsSymbol condit extern "C" void SymbolKey_InitTree (SymbolKey_SymbolTree *t) { - Storage_ALLOCATE ((void **) &(*t), sizeof (Node)); /* The value entity */ + Storage_ALLOCATE ((void **) &(*t), sizeof (SymbolKey_Node)); /* The value entity */ (*t)->Left = NULL; (*t)->Right = NULL; } @@ -323,7 +323,7 @@ END Kill ; { SymbolKey_KillTree (&(*t)->Left); SymbolKey_KillTree (&(*t)->Right); - Storage_DEALLOCATE ((void **) &(*t), sizeof (Node)); + Storage_DEALLOCATE ((void **) &(*t), sizeof (SymbolKey_Node)); (*t) = NULL; } } @@ -368,20 +368,20 @@ extern "C" void SymbolKey_PutSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe if (father == t) { /* empty tree, add it to the left branch of t */ - Storage_ALLOCATE ((void **) &child, sizeof (Node)); + Storage_ALLOCATE ((void **) &child, sizeof (SymbolKey_Node)); father->Left = child; } else { if (NameKey < father->KeyName) { - Storage_ALLOCATE ((void **) &child, sizeof (Node)); + Storage_ALLOCATE ((void **) &child, sizeof (SymbolKey_Node)); father->Left = child; } else if (NameKey > father->KeyName) { /* avoid dangling else. */ - Storage_ALLOCATE ((void **) &child, sizeof (Node)); + Storage_ALLOCATE ((void **) &child, sizeof (SymbolKey_Node)); father->Right = child; } } @@ -392,7 +392,7 @@ extern "C" void SymbolKey_PutSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe } else { - Debug_Halt ((const char *) "symbol already stored", 21, 156, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 85); + Debug_Halt ((const char *) "symbol already stored", 21, 156, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 61); } } @@ -433,7 +433,7 @@ extern "C" void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe /* (as in a single linked list) to child^.Right */ father->Right = child->Right; } - Storage_DEALLOCATE ((void **) &child, sizeof (Node)); + Storage_DEALLOCATE ((void **) &child, sizeof (SymbolKey_Node)); } else { @@ -454,12 +454,12 @@ extern "C" void SymbolKey_DelSymKey (SymbolKey_SymbolTree t, NameKey_Name NameKe /* (as in a single linked list) to child^.Left. */ father->Left = child->Left; } - Storage_DEALLOCATE ((void **) &child, sizeof (Node)); + Storage_DEALLOCATE ((void **) &child, sizeof (SymbolKey_Node)); } } else { - Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 223, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 85); + Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 223, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-compiler/SymbolKey.mod", 61); } } @@ -547,10 +547,10 @@ extern "C" void SymbolKey_ForeachNodeConditionDo (SymbolKey_SymbolTree t, Symbol } } -extern "C" void _M2_SymbolKey_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SymbolKey_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } -extern "C" void _M2_SymbolKey_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SymbolKey_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/GSysStorage.c b/gcc/m2/pge-boot/GSysStorage.c index b1424428058..fe74700ecab 100644 --- a/gcc/m2/pge-boot/GSysStorage.c +++ b/gcc/m2/pge-boot/GSysStorage.c @@ -93,7 +93,7 @@ extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size) (*a) = libc_malloc (static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 82); + Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); } if (enableTrace && trace) { @@ -118,7 +118,7 @@ extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size) } if ((libc_memset ((*a), 0, static_cast (size))) != (*a)) { - Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 82); + Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); } } if (enableDeallocation) @@ -163,7 +163,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size) (*a) = libc_realloc ((*a), static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "/home/gaius/GM2/graft-combine/gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 82); + Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); } if (enableTrace && trace) { @@ -223,7 +223,7 @@ extern "C" void SysStorage_Init (void) { } -extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { callno = 0; if (enableTrace) @@ -244,6 +244,6 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc, __attribu } } -extern "C" void _M2_SysStorage_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_SysStorage_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/Gbnflex.c b/gcc/m2/pge-boot/Gbnflex.c index 0958f153999..8272826f946 100644 --- a/gcc/m2/pge-boot/Gbnflex.c +++ b/gcc/m2/pge-boot/Gbnflex.c @@ -251,10 +251,10 @@ static void WriteToken (void) static void Init (void) { - typedef struct _T1_a _T1; + typedef struct Init__T1_a Init__T1; - struct _T1_a { char array[1+1]; }; - _T1 a; + struct Init__T1_a { char array[1+1]; }; + Init__T1 a; SymbolKey_InitTree (&ReservedWords); Debugging = FALSE; @@ -456,10 +456,10 @@ extern "C" void bnflex_SkipUntilEoln (void) extern "C" void bnflex_AdvanceToken (void) { - typedef struct _T2_a _T2; + typedef struct AdvanceToken__T2_a AdvanceToken__T2; - struct _T2_a { char array[MaxNameLength+1]; }; - _T2 a; + struct AdvanceToken__T2_a { char array[MaxNameLength+1]; }; + AdvanceToken__T2 a; unsigned int i; i = 0; @@ -573,10 +573,10 @@ extern "C" unsigned int bnflex_IsReserved (NameKey_Name name) extern "C" void bnflex_PushBackToken (NameKey_Name t) { - typedef struct _T3_a _T3; + typedef struct PushBackToken__T3_a PushBackToken__T3; - struct _T3_a { char array[MaxNameLength+1]; }; - _T3 a; + struct PushBackToken__T3_a { char array[MaxNameLength+1]; }; + PushBackToken__T3 a; NameKey_GetKey (t, (char *) &a.array[0], MaxNameLength); PushBackInput_PutString ((const char *) &a.array[0], MaxNameLength); @@ -592,11 +592,11 @@ extern "C" void bnflex_SetDebugging (unsigned int flag) Debugging = flag; } -extern "C" void _M2_bnflex_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_bnflex_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Init (); } -extern "C" void _M2_bnflex_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_bnflex_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/Gpge.c b/gcc/m2/pge-boot/Gpge.c index b4b3c94a83b..bd986846bed 100644 --- a/gcc/m2/pge-boot/Gpge.c +++ b/gcc/m2/pge-boot/Gpge.c @@ -70,144 +70,144 @@ along with GNU Modula-2; see the file COPYING3. If not see # define BaseRightLimit 75 # define BaseRightMargin 50 # define BaseNewLine 3 -typedef struct termdesc_r termdesc; +typedef struct pge_termdesc_r pge_termdesc; -typedef termdesc *TermDesc; +typedef pge_termdesc *pge_TermDesc; -typedef struct DoProcedure_p DoProcedure; +typedef struct pge_DoProcedure_p pge_DoProcedure; -typedef unsigned int SetOfStop; +typedef unsigned int pge_SetOfStop; -typedef struct _T1_r _T1; +typedef struct pge__T1_r pge__T1; -typedef _T1 *IdentDesc; +typedef pge__T1 *pge_IdentDesc; -typedef struct _T2_r _T2; +typedef struct pge__T2_r pge__T2; -typedef _T2 *ProductionDesc; +typedef pge__T2 *pge_ProductionDesc; -typedef struct _T3_r _T3; +typedef struct pge__T3_r pge__T3; -typedef _T3 *StatementDesc; +typedef pge__T3 *pge_StatementDesc; -typedef struct _T4_r _T4; +typedef struct pge__T4_r pge__T4; -typedef _T4 *ExpressionDesc; +typedef pge__T4 *pge_ExpressionDesc; -typedef struct _T5_r _T5; +typedef struct pge__T5_r pge__T5; -typedef struct _T6_r _T6; +typedef struct pge__T6_r pge__T6; -typedef _T6 *FollowDesc; +typedef pge__T6 *pge_FollowDesc; -typedef struct _T7_r _T7; +typedef struct pge__T7_r pge__T7; -typedef _T7 *SetDesc; +typedef pge__T7 *pge_SetDesc; -typedef struct _T8_r _T8; +typedef struct pge__T8_r pge__T8; -typedef _T8 *CodeDesc; +typedef pge__T8 *pge_CodeDesc; -typedef struct _T9_r _T9; +typedef struct pge__T9_r pge__T9; -typedef _T9 *CodeHunk; +typedef pge__T9 *pge_CodeHunk; -typedef struct _T10_a _T10; +typedef struct pge__T10_a pge__T10; -typedef struct _T11_a _T11; +typedef struct pge__T11_a pge__T11; -typedef enum {idel, tokel, litel} ElementType; +typedef enum {pge_idel, pge_tokel, pge_litel} pge_ElementType; -typedef enum {m2none, m2if, m2elsif, m2while} m2condition; +typedef enum {pge_m2none, pge_m2if, pge_m2elsif, pge_m2while} pge_m2condition; -typedef enum {unknown, true_, false_} TraverseResult; +typedef enum {pge_unknown, pge_true, pge_false} pge_TraverseResult; -typedef enum {id, lit, sub, opt, mult, m2} FactorType; +typedef enum {pge_id, pge_lit, pge_sub, pge_opt, pge_mult, pge_m2} pge_FactorType; -typedef _T5 *FactorDesc; +typedef pge__T5 *pge_FactorDesc; -struct termdesc_r { - FactorDesc factor; - TermDesc next; - FollowDesc followinfo; - unsigned int line; - }; +struct pge_termdesc_r { + pge_FactorDesc factor; + pge_TermDesc next; + pge_FollowDesc followinfo; + unsigned int line; + }; -typedef void (*DoProcedure_t) (ProductionDesc); -struct DoProcedure_p { DoProcedure_t proc; }; +typedef void (*pge_DoProcedure_t) (pge_ProductionDesc); +struct pge_DoProcedure_p { pge_DoProcedure_t proc; }; -struct _T1_r { - ProductionDesc definition; - NameKey_Name name; - unsigned int line; - }; +struct pge__T1_r { + pge_ProductionDesc definition; + NameKey_Name name; + unsigned int line; + }; -struct _T2_r { - ProductionDesc next; - StatementDesc statement; - SetDesc first; - unsigned int firstsolved; - FollowDesc followinfo; - unsigned int line; - NameKey_Name description; - }; +struct pge__T2_r { + pge_ProductionDesc next; + pge_StatementDesc statement; + pge_SetDesc first; + unsigned int firstsolved; + pge_FollowDesc followinfo; + unsigned int line; + NameKey_Name description; + }; -struct _T3_r { - IdentDesc ident; - ExpressionDesc expr; - FollowDesc followinfo; - unsigned int line; - }; +struct pge__T3_r { + pge_IdentDesc ident; + pge_ExpressionDesc expr; + pge_FollowDesc followinfo; + unsigned int line; + }; -struct _T4_r { - TermDesc term; - FollowDesc followinfo; - unsigned int line; - }; +struct pge__T4_r { + pge_TermDesc term; + pge_FollowDesc followinfo; + unsigned int line; + }; -struct _T5_r { - FollowDesc followinfo; - FactorDesc next; - unsigned int line; - FactorDesc pushed; - FactorType type; /* case tag */ - union { - IdentDesc ident; - NameKey_Name string; - ExpressionDesc expr; - CodeDesc code; - }; - }; +struct pge__T5_r { + pge_FollowDesc followinfo; + pge_FactorDesc next; + unsigned int line; + pge_FactorDesc pushed; + pge_FactorType type; /* case tag */ + union { + pge_IdentDesc ident; + NameKey_Name string; + pge_ExpressionDesc expr; + pge_CodeDesc code; + }; + }; -struct _T6_r { - unsigned int calcfollow; - SetDesc follow; - TraverseResult reachend; - TraverseResult epsilon; - unsigned int line; - }; +struct pge__T6_r { + unsigned int calcfollow; + pge_SetDesc follow; + pge_TraverseResult reachend; + pge_TraverseResult epsilon; + unsigned int line; + }; -struct _T7_r { - SetDesc next; - ElementType type; /* case tag */ - union { - IdentDesc ident; - NameKey_Name string; - }; - }; - -struct _T8_r { - CodeHunk code; - unsigned int indent; - unsigned int line; - }; - -struct _T10_a { char array[MaxCodeHunkLength+1]; }; -struct _T11_a { char array[MaxFileName+1]; }; -struct _T9_r { - _T10 codetext; - CodeHunk next; - }; +struct pge__T7_r { + pge_SetDesc next; + pge_ElementType type; /* case tag */ + union { + pge_IdentDesc ident; + NameKey_Name string; + }; + }; + +struct pge__T8_r { + pge_CodeHunk code; + unsigned int indent; + unsigned int line; + }; + +struct pge__T10_a { char array[MaxCodeHunkLength+1]; }; +struct pge__T11_a { char array[MaxFileName+1]; }; +struct pge__T9_r { + pge__T10 codetext; + pge_CodeHunk next; + }; static unsigned int LastLineNo; static unsigned int Finished; @@ -216,24 +216,25 @@ static unsigned int KeywordFormatting; static unsigned int PrettyPrint; static unsigned int EmitCode; static unsigned int Texinfo; +static unsigned int Sphinx; static unsigned int FreeDocLicense; static unsigned int Debugging; static unsigned int WasNoError; static unsigned int LinePrologue; static unsigned int LineEpilogue; static unsigned int LineDeclaration; -static CodeHunk CodePrologue; -static CodeHunk CodeEpilogue; -static CodeHunk CodeDeclaration; -static ProductionDesc CurrentProduction; -static ProductionDesc TailProduction; -static ProductionDesc HeadProduction; -static ExpressionDesc CurrentExpression; -static TermDesc CurrentTerm; -static FactorDesc CurrentFactor; -static IdentDesc CurrentIdent; -static StatementDesc CurrentStatement; -static SetDesc CurrentSetDesc; +static pge_CodeHunk CodePrologue; +static pge_CodeHunk CodeEpilogue; +static pge_CodeHunk CodeDeclaration; +static pge_ProductionDesc CurrentProduction; +static pge_ProductionDesc TailProduction; +static pge_ProductionDesc HeadProduction; +static pge_ExpressionDesc CurrentExpression; +static pge_TermDesc CurrentTerm; +static pge_FactorDesc CurrentFactor; +static pge_IdentDesc CurrentIdent; +static pge_StatementDesc CurrentStatement; +static pge_SetDesc CurrentSetDesc; static SymbolKey_SymbolTree ReverseValues; static SymbolKey_SymbolTree Values; static SymbolKey_SymbolTree ReverseAliases; @@ -245,8 +246,8 @@ static NameKey_Name SymIsProc; static NameKey_Name TokenTypeProc; static NameKey_Name ErrorProcArray; static NameKey_Name ErrorProcString; -static _T11 ArgName; -static _T11 FileName; +static pge__T11 ArgName; +static pge__T11 FileName; static unsigned int OnLineStart; static unsigned int BeginningOfLine; static unsigned int Indent; @@ -260,7 +261,7 @@ static unsigned int ParametersUsed; DescribeStop - issues a message explaining what tokens were expected */ -static DynamicStrings_String DescribeStop (SetOfStop stopset); +static DynamicStrings_String DescribeStop (pge_SetOfStop stopset); /* DescribeError - issues a message explaining what tokens were expected @@ -291,92 +292,92 @@ static void WarnError1 (const char *a_, unsigned int _a_high, unsigned int n); PrettyFollow - */ -static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, FollowDesc f); +static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, pge_FollowDesc f); /* NewFollow - creates a new follow descriptor and returns the data structure. */ -static FollowDesc NewFollow (void); +static pge_FollowDesc NewFollow (void); /* AssignEpsilon - assigns the epsilon value and sets the epsilon to value, providing condition is TRUE. */ -static void AssignEpsilon (unsigned int condition, FollowDesc f, TraverseResult value); +static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value); /* GetEpsilon - returns the value of epsilon */ -static TraverseResult GetEpsilon (FollowDesc f); +static pge_TraverseResult GetEpsilon (pge_FollowDesc f); /* AssignReachEnd - assigns the reachend value providing that, condition, is TRUE. */ -static void AssignReachEnd (unsigned int condition, FollowDesc f, TraverseResult value); +static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value); /* GetReachEnd - returns the value of reachend */ -static TraverseResult GetReachEnd (FollowDesc f); +static pge_TraverseResult GetReachEnd (pge_FollowDesc f); /* AssignFollow - assigns the follow set and sets the calcfollow to TRUE. */ -static void AssignFollow (FollowDesc f, SetDesc s); +static void AssignFollow (pge_FollowDesc f, pge_SetDesc s); /* GetFollow - returns the follow set. */ -static SetDesc GetFollow (FollowDesc f); +static pge_SetDesc GetFollow (pge_FollowDesc f); /* NewProduction - creates a new production and returns the data structure. */ -static ProductionDesc NewProduction (void); +static pge_ProductionDesc NewProduction (void); /* NewFactor - */ -static FactorDesc NewFactor (void); +static pge_FactorDesc NewFactor (void); /* NewTerm - returns a new term. */ -static TermDesc NewTerm (void); +static pge_TermDesc NewTerm (void); /* NewExpression - returns a new expression. */ -static ExpressionDesc NewExpression (void); +static pge_ExpressionDesc NewExpression (void); /* NewStatement - returns a new statement. */ -static StatementDesc NewStatement (void); +static pge_StatementDesc NewStatement (void); /* NewSetDesc - creates a new set description and returns the data structure. */ -static SetDesc NewSetDesc (void); +static pge_SetDesc NewSetDesc (void); /* NewCodeDesc - creates a new code descriptor and initializes all fields to zero. */ -static CodeDesc NewCodeDesc (void); +static pge_CodeDesc NewCodeDesc (void); /* CodeFragmentPrologue - consumes code text up to a "%" after a newline. @@ -400,13 +401,13 @@ static void CodeFragmentDeclaration (void); GetCodeFragment - collects the code fragment up until ^ % */ -static void GetCodeFragment (CodeHunk *h); +static void GetCodeFragment (pge_CodeHunk *h); /* WriteCodeHunkList - writes the CodeHunk list in the correct order. */ -static void WriteCodeHunkList (CodeHunk l); +static void WriteCodeHunkList (pge_CodeHunk l); /* WriteIndent - writes, n, spaces. @@ -432,19 +433,19 @@ static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned in but it removes up to indent spaces if they exist. */ -static void WriteCodeHunkListIndent (CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext); +static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext); /* Add - adds a character to a code hunk and creates another code hunk if necessary. */ -static CodeHunk Add (CodeHunk *p, char ch, unsigned int *i); +static pge_CodeHunk Add (pge_CodeHunk *p, char ch, unsigned int *i); /* ConsHunk - combine two possible code hunks. */ -static void ConsHunk (CodeHunk *p, CodeHunk q); +static void ConsHunk (pge_CodeHunk *p, pge_CodeHunk q); /* GetName - returns the next symbol which is checked for a legal name. @@ -457,49 +458,49 @@ static NameKey_Name GetName (void); a stop symbol. */ -static void SyntaxError (SetOfStop stop); +static void SyntaxError (pge_SetOfStop stop); /* SyntaxCheck - */ -static void SyntaxCheck (SetOfStop stop); +static void SyntaxCheck (pge_SetOfStop stop); /* Expect - */ -static void Expect (bnflex_TokenType t, SetOfStop stop); +static void Expect (bnflex_TokenType t, pge_SetOfStop stop); /* Ident - error checking varient of Ident */ -static void Ident (SetOfStop stop); +static void Ident (pge_SetOfStop stop); /* Modula2Code - error checking varient of Modula2Code */ -static void Modula2Code (SetOfStop stop); +static void Modula2Code (pge_SetOfStop stop); /* StartModName := % ModuleName := GetName() ; ignore begintok CodeFragmentPrologue % =: */ -static void StartModName (SetOfStop stop); +static void StartModName (pge_SetOfStop stop); /* EndModName := */ -static void EndModName (SetOfStop stop); +static void EndModName (pge_SetOfStop stop); /* DoDeclaration := % CodeFragmentDeclaration % =: */ -static void DoDeclaration (SetOfStop stop); +static void DoDeclaration (pge_SetOfStop stop); /* CollectLiteral := @@ -512,7 +513,7 @@ static void DoDeclaration (SetOfStop stop); cannot reachend */ -static void CollectLiteral (SetOfStop stopset); +static void CollectLiteral (pge_SetOfStop stopset); /* CollectTok := @@ -537,7 +538,7 @@ static void CollectLiteral (SetOfStop stopset); cannot reachend */ -static void CollectTok (SetOfStop stopset); +static void CollectTok (pge_SetOfStop stopset); /* DefineToken := @@ -554,7 +555,7 @@ static void CollectTok (SetOfStop stopset); cannot reachend */ -static void DefineToken (SetOfStop stopset); +static void DefineToken (pge_SetOfStop stopset); /* Rules := '%' 'rules' { Defs } ExtBNF @@ -564,7 +565,7 @@ static void DefineToken (SetOfStop stopset); cannot reachend */ -static void Rules (SetOfStop stopset); +static void Rules (pge_SetOfStop stopset); /* Special := Ident @@ -596,7 +597,7 @@ static void Rules (SetOfStop stopset); cannot reachend */ -static void Special (SetOfStop stopset); +static void Special (pge_SetOfStop stopset); /* Factor := '%' Modula2Code '%' | @@ -639,7 +640,7 @@ static void Special (SetOfStop stopset); cannot reachend */ -static void Factor (SetOfStop stopset); +static void Factor (pge_SetOfStop stopset); /* Statement := @@ -680,7 +681,7 @@ static void Factor (SetOfStop stopset); cannot reachend */ -static void Statement (SetOfStop stopset); +static void Statement (pge_SetOfStop stopset); /* Defs := 'special' Special | 'token' Token | @@ -693,7 +694,7 @@ static void Statement (SetOfStop stopset); cannot reachend */ -static void Defs (SetOfStop stopset); +static void Defs (pge_SetOfStop stopset); /* ExtBNF := 'BNF' { Production } 'FNB' @@ -703,7 +704,7 @@ static void Defs (SetOfStop stopset); cannot reachend */ -static void ExtBNF (SetOfStop stopset); +static void ExtBNF (pge_SetOfStop stopset); /* Main := Header Decls Footer Rules @@ -713,7 +714,7 @@ static void ExtBNF (SetOfStop stopset); cannot reachend */ -static void Main (SetOfStop stopset); +static void Main (pge_SetOfStop stopset); /* Header := '%' 'module' StartModName @@ -723,7 +724,7 @@ static void Main (SetOfStop stopset); cannot reachend */ -static void Header (SetOfStop stopset); +static void Header (pge_SetOfStop stopset); /* Decls := '%' 'declaration' DoDeclaration @@ -733,7 +734,7 @@ static void Header (SetOfStop stopset); cannot reachend */ -static void Decls (SetOfStop stopset); +static void Decls (pge_SetOfStop stopset); /* Footer := '%' 'module' EndModName @@ -743,7 +744,7 @@ static void Decls (SetOfStop stopset); cannot reachend */ -static void Footer (SetOfStop stopset); +static void Footer (pge_SetOfStop stopset); /* First := 'first' '{' { LitOrTokenOrIdent @@ -759,7 +760,7 @@ static void Footer (SetOfStop stopset); cannot reachend */ -static void First (SetOfStop stopset); +static void First (pge_SetOfStop stopset); /* Follow := 'follow' '{' { LitOrTokenOrIdent @@ -775,7 +776,7 @@ static void First (SetOfStop stopset); cannot reachend */ -static void Follow (SetOfStop stopset); +static void Follow (pge_SetOfStop stopset); /* LitOrTokenOrIdent := Literal @@ -800,7 +801,7 @@ static void Follow (SetOfStop stopset); cannot reachend */ -static void LitOrTokenOrIdent (SetOfStop stopset); +static void LitOrTokenOrIdent (pge_SetOfStop stopset); /* Literal := '"' CollectLiteral '"' | @@ -811,7 +812,7 @@ static void LitOrTokenOrIdent (SetOfStop stopset); cannot reachend */ -static void Literal (SetOfStop stopset); +static void Literal (pge_SetOfStop stopset); /* Token := Literal DefineToken @@ -821,7 +822,7 @@ static void Literal (SetOfStop stopset); cannot reachend */ -static void Token (SetOfStop stopset); +static void Token (pge_SetOfStop stopset); /* ErrorProcedures := Literal @@ -835,7 +836,7 @@ static void Token (SetOfStop stopset); cannot reachend */ -static void ErrorProcedures (SetOfStop stopset); +static void ErrorProcedures (pge_SetOfStop stopset); /* TokenProcedure := Literal @@ -847,7 +848,7 @@ static void ErrorProcedures (SetOfStop stopset); cannot reachend */ -static void TokenProcedure (SetOfStop stopset); +static void TokenProcedure (pge_SetOfStop stopset); /* SymProcedure := Literal @@ -859,7 +860,7 @@ static void TokenProcedure (SetOfStop stopset); cannot reachend */ -static void SymProcedure (SetOfStop stopset); +static void SymProcedure (pge_SetOfStop stopset); /* Production := Statement @@ -869,7 +870,7 @@ static void SymProcedure (SetOfStop stopset); cannot reachend */ -static void Production (SetOfStop stopset); +static void Production (pge_SetOfStop stopset); /* Expression := @@ -894,7 +895,7 @@ static void Production (SetOfStop stopset); cannot reachend */ -static void Expression (SetOfStop stopset); +static void Expression (pge_SetOfStop stopset); /* Term := @@ -919,75 +920,75 @@ static void Expression (SetOfStop stopset); cannot reachend */ -static void Term (SetOfStop stopset); +static void Term (pge_SetOfStop stopset); /* GetDefinitionName - returns the name of the rule inside, p. */ -static NameKey_Name GetDefinitionName (ProductionDesc p); +static NameKey_Name GetDefinitionName (pge_ProductionDesc p); /* FindDefinition - searches and returns the rule which defines, n. */ -static ProductionDesc FindDefinition (NameKey_Name n); +static pge_ProductionDesc FindDefinition (NameKey_Name n); /* BackPatchIdent - found an ident, i, we must look for the corresponding rule and set the definition accordingly. */ -static void BackPatchIdent (IdentDesc i); +static void BackPatchIdent (pge_IdentDesc i); /* BackPatchFactor - runs through the factor looking for an ident */ -static void BackPatchFactor (FactorDesc f); +static void BackPatchFactor (pge_FactorDesc f); /* BackPatchTerm - runs through all terms to find idents. */ -static void BackPatchTerm (TermDesc t); +static void BackPatchTerm (pge_TermDesc t); /* BackPatchExpression - runs through the term to find any idents. */ -static void BackPatchExpression (ExpressionDesc e); +static void BackPatchExpression (pge_ExpressionDesc e); /* BackPatchSet - */ -static void BackPatchSet (SetDesc s); +static void BackPatchSet (pge_SetDesc s); /* BackPatchIdentToDefinitions - search through all the rules and add a link from any ident to the definition. */ -static void BackPatchIdentToDefinitions (ProductionDesc d); +static void BackPatchIdentToDefinitions (pge_ProductionDesc d); /* CalculateFirstAndFollow - */ -static void CalculateFirstAndFollow (ProductionDesc p); +static void CalculateFirstAndFollow (pge_ProductionDesc p); /* ForeachRuleDo - */ -static void ForeachRuleDo (DoProcedure p); +static void ForeachRuleDo (pge_DoProcedure p); /* WhileNotCompleteDo - */ -static void WhileNotCompleteDo (DoProcedure p); +static void WhileNotCompleteDo (pge_DoProcedure p); /* NewLine - generate a newline and indent. @@ -1017,7 +1018,7 @@ static void KeyWord (NameKey_Name n); PrettyPara - */ -static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, ExpressionDesc e, unsigned int Left); +static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, pge_ExpressionDesc e, unsigned int Left); /* WriteKeyTexinfo - @@ -1029,55 +1030,55 @@ static void WriteKeyTexinfo (NameKey_Name s); PrettyCommentFactor - */ -static void PrettyCommentFactor (FactorDesc f, unsigned int Left); +static void PrettyCommentFactor (pge_FactorDesc f, unsigned int Left); /* PeepTerm - returns the length of characters in term. */ -static unsigned int PeepTerm (TermDesc t); +static unsigned int PeepTerm (pge_TermDesc t); /* PeepExpression - returns the length of the expression. */ -static unsigned int PeepExpression (ExpressionDesc e); +static unsigned int PeepExpression (pge_ExpressionDesc e); /* PeepFactor - returns the length of character in the factor */ -static unsigned int PeepFactor (FactorDesc f); +static unsigned int PeepFactor (pge_FactorDesc f); /* PrettyCommentTerm - */ -static void PrettyCommentTerm (TermDesc t, unsigned int Left); +static void PrettyCommentTerm (pge_TermDesc t, unsigned int Left); /* PrettyCommentExpression - */ -static void PrettyCommentExpression (ExpressionDesc e, unsigned int Left); +static void PrettyCommentExpression (pge_ExpressionDesc e, unsigned int Left); /* PrettyCommentStatement - */ -static void PrettyCommentStatement (StatementDesc s, unsigned int Left); +static void PrettyCommentStatement (pge_StatementDesc s, unsigned int Left); /* PrettyCommentProduction - generates the comment for rule, p. */ -static void PrettyCommentProduction (ProductionDesc p); +static void PrettyCommentProduction (pge_ProductionDesc p); /* PrettyPrintProduction - pretty prints the ebnf rule, p. */ -static void PrettyPrintProduction (ProductionDesc p); +static void PrettyPrintProduction (pge_ProductionDesc p); /* EmitFileLineTag - emits a line and file tag using the C preprocessor syntax. @@ -1089,91 +1090,91 @@ static void EmitFileLineTag (unsigned int line); EmitRule - generates a comment and code for rule, p. */ -static void EmitRule (ProductionDesc p); +static void EmitRule (pge_ProductionDesc p); /* CodeCondition - */ -static void CodeCondition (m2condition m); +static void CodeCondition (pge_m2condition m); /* CodeThenDo - codes a "THEN" or "DO" depending upon, m. */ -static void CodeThenDo (m2condition m); +static void CodeThenDo (pge_m2condition m); /* CodeElseEnd - builds an ELSE END statement using string, end. */ -static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, FactorDesc f, unsigned int inopt); +static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt); /* CodeEnd - codes a "END" depending upon, m. */ -static void CodeEnd (m2condition m, TermDesc t, unsigned int consumed, FactorDesc f, unsigned int inopt); +static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt); /* EmitNonVarCode - writes out, code, providing it is not a variable declaration. */ -static void EmitNonVarCode (CodeDesc code, unsigned int curpos, unsigned int left); +static void EmitNonVarCode (pge_CodeDesc code, unsigned int curpos, unsigned int left); /* ChainOn - */ -static FactorDesc ChainOn (FactorDesc codeStack, FactorDesc f); +static pge_FactorDesc ChainOn (pge_FactorDesc codeStack, pge_FactorDesc f); /* FlushCode - */ -static void FlushCode (FactorDesc *codeStack); +static void FlushCode (pge_FactorDesc *codeStack); /* CodeFactor - */ -static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeTerm - */ -static void CodeTerm (TermDesc t, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeExpression - */ -static void CodeExpression (ExpressionDesc e, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeStatement - */ -static void CodeStatement (StatementDesc s, m2condition m); +static void CodeStatement (pge_StatementDesc s, pge_m2condition m); /* CodeProduction - only encode grammer rules which are not special. */ -static void CodeProduction (ProductionDesc p); +static void CodeProduction (pge_ProductionDesc p); /* RecoverCondition - */ -static void RecoverCondition (m2condition m); +static void RecoverCondition (pge_m2condition m); /* ConditionIndent - returns the number of spaces indentation created via, m. */ -static unsigned int ConditionIndent (m2condition m); +static unsigned int ConditionIndent (pge_m2condition m); /* WriteGetTokenType - writes out the method of determining the token type. @@ -1185,7 +1186,7 @@ static void WriteGetTokenType (void); NumberOfElements - returns the number of elements in set, to, which lie between low..high */ -static unsigned int NumberOfElements (SetDesc to, unsigned int low, unsigned int high); +static unsigned int NumberOfElements (pge_SetDesc to, unsigned int low, unsigned int high); /* WriteElement - writes the literal name for element, e. @@ -1197,26 +1198,26 @@ static void WriteElement (unsigned int e); EmitIsInSet - writes out the equivalent of GetTokenType() IN { toset } */ -static void EmitIsInSet (SetDesc to, NameKey_Name low, NameKey_Name high); +static void EmitIsInSet (pge_SetDesc to, NameKey_Name low, NameKey_Name high); /* EmitIsInSubSet - writes out a test to see whether GetTokenype() is in { subset } */ -static void EmitIsInSubSet (SetDesc to, unsigned int low, unsigned int high); +static void EmitIsInSubSet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitIsInFirst - */ -static void EmitIsInFirst (SetDesc to, m2condition m); -static void FlushRecoverCode (FactorDesc *codeStack); +static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m); +static void FlushRecoverCode (pge_FactorDesc *codeStack); /* RecoverFactor - */ -static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack); +static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc codeStack); /* OptExpSeen - returns TRUE if we can see an optional expression in the factor. @@ -1225,31 +1226,31 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack); and FALSE in the first. */ -static unsigned int OptExpSeen (FactorDesc f); +static unsigned int OptExpSeen (pge_FactorDesc f); /* RecoverTerm - */ -static void RecoverTerm (TermDesc t, m2condition new_, m2condition old); +static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition old); /* RecoverExpression - */ -static void RecoverExpression (ExpressionDesc e, m2condition new_, m2condition old); +static void RecoverExpression (pge_ExpressionDesc e, pge_m2condition new_, pge_m2condition old); /* RecoverStatement - */ -static void RecoverStatement (StatementDesc s, m2condition m); +static void RecoverStatement (pge_StatementDesc s, pge_m2condition m); /* EmitFirstFactor - generate a list of all first tokens between the range: low..high. */ -static void EmitFirstFactor (FactorDesc f, unsigned int low, unsigned int high); +static void EmitFirstFactor (pge_FactorDesc f, unsigned int low, unsigned int high); /* EmitUsed - @@ -1274,33 +1275,33 @@ static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned i IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high. */ -static unsigned int IsEmptySet (SetDesc to, unsigned int low, unsigned int high); +static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitSet - emits the tokens in the set, to, which have values low..high */ -static void EmitSet (SetDesc to, unsigned int low, unsigned int high); +static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitSetName - emits the tokens in the set, to, which have values low..high, using their names. */ -static void EmitSetName (SetDesc to, unsigned int low, unsigned int high); +static void EmitSetName (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitStopParametersAndSet - generates the stop parameters together with a set inclusion of all the symbols in set, to. */ -static void EmitStopParametersAndSet (SetDesc to); +static void EmitStopParametersAndSet (pge_SetDesc to); /* EmitSetAsParameters - generates the first symbols as parameters to a set function. */ -static void EmitSetAsParameters (SetDesc to); +static void EmitSetAsParameters (pge_SetDesc to); /* EmitStopParametersAndFollow - generates the stop parameters together with a set @@ -1308,20 +1309,20 @@ static void EmitSetAsParameters (SetDesc to); sentances. */ -static void EmitStopParametersAndFollow (FactorDesc f, m2condition m); +static void EmitStopParametersAndFollow (pge_FactorDesc f, pge_m2condition m); /* EmitFirstAsParameters - */ -static void EmitFirstAsParameters (FactorDesc f); +static void EmitFirstAsParameters (pge_FactorDesc f); /* RecoverProduction - only encode grammer rules which are not special. Generate error recovery code. */ -static void RecoverProduction (ProductionDesc p); +static void RecoverProduction (pge_ProductionDesc p); /* IsWhite - returns TRUE if, ch, is a space or a tab. @@ -1333,208 +1334,208 @@ static unsigned int IsWhite (char ch); FindStr - returns TRUE if, str, was seen inside the code hunk */ -static unsigned int FindStr (CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high); +static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high); /* WriteUpto - */ -static void WriteUpto (CodeHunk code, CodeHunk upto, unsigned int limit); +static void WriteUpto (pge_CodeHunk code, pge_CodeHunk upto, unsigned int limit); /* CheckForVar - checks for any local variables which need to be emitted during this production. */ -static void CheckForVar (CodeHunk code); +static void CheckForVar (pge_CodeHunk code); /* VarFactor - */ -static void VarFactor (FactorDesc f); +static void VarFactor (pge_FactorDesc f); /* VarTerm - */ -static void VarTerm (TermDesc t); +static void VarTerm (pge_TermDesc t); /* VarExpression - */ -static void VarExpression (ExpressionDesc e); +static void VarExpression (pge_ExpressionDesc e); /* VarStatement - */ -static void VarStatement (StatementDesc s); +static void VarStatement (pge_StatementDesc s); /* VarProduction - writes out all variable declarations. */ -static void VarProduction (ProductionDesc p); +static void VarProduction (pge_ProductionDesc p); /* In - returns TRUE if token, s, is already in the set, to. */ -static unsigned int In (SetDesc to, NameKey_Name s); +static unsigned int In (pge_SetDesc to, NameKey_Name s); /* IntersectionIsNil - given two set lists, s1, s2, return TRUE if the s1 * s2 = {} */ -static unsigned int IntersectionIsNil (SetDesc s1, SetDesc s2); +static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2); /* AddSet - adds a first symbol to a production. */ -static void AddSet (SetDesc *to, NameKey_Name s); +static void AddSet (pge_SetDesc *to, NameKey_Name s); /* OrSet - */ -static void OrSet (SetDesc *to, SetDesc from); +static void OrSet (pge_SetDesc *to, pge_SetDesc from); /* CalcFirstFactor - */ -static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to); +static void CalcFirstFactor (pge_FactorDesc f, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstTerm - */ -static void CalcFirstTerm (TermDesc t, ProductionDesc from, SetDesc *to); +static void CalcFirstTerm (pge_TermDesc t, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstExpression - */ -static void CalcFirstExpression (ExpressionDesc e, ProductionDesc from, SetDesc *to); +static void CalcFirstExpression (pge_ExpressionDesc e, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstStatement - */ -static void CalcFirstStatement (StatementDesc s, ProductionDesc from, SetDesc *to); +static void CalcFirstStatement (pge_StatementDesc s, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstProduction - calculates all of the first symbols for the grammer */ -static void CalcFirstProduction (ProductionDesc p, ProductionDesc from, SetDesc *to); -static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after); +static void CalcFirstProduction (pge_ProductionDesc p, pge_ProductionDesc from, pge_SetDesc *to); +static void WorkOutFollowFactor (pge_FactorDesc f, pge_SetDesc *followset, pge_SetDesc after); /* WorkOutFollowTerm - */ -static void WorkOutFollowTerm (TermDesc t, SetDesc *followset, SetDesc after); +static void WorkOutFollowTerm (pge_TermDesc t, pge_SetDesc *followset, pge_SetDesc after); /* WorkOutFollowExpression - */ -static void WorkOutFollowExpression (ExpressionDesc e, SetDesc *followset, SetDesc after); +static void WorkOutFollowExpression (pge_ExpressionDesc e, pge_SetDesc *followset, pge_SetDesc after); /* CollectFollow - collects the follow set from, f, into, to. */ -static void CollectFollow (SetDesc *to, FollowDesc f); +static void CollectFollow (pge_SetDesc *to, pge_FollowDesc f); /* CalcFollowFactor - */ -static void CalcFollowFactor (FactorDesc f, SetDesc after); +static void CalcFollowFactor (pge_FactorDesc f, pge_SetDesc after); /* CalcFollowTerm - */ -static void CalcFollowTerm (TermDesc t, SetDesc after); +static void CalcFollowTerm (pge_TermDesc t, pge_SetDesc after); /* CalcFollowExpression - */ -static void CalcFollowExpression (ExpressionDesc e, SetDesc after); +static void CalcFollowExpression (pge_ExpressionDesc e, pge_SetDesc after); /* CalcFollowStatement - given a bnf statement generate the follow set. */ -static void CalcFollowStatement (StatementDesc s); +static void CalcFollowStatement (pge_StatementDesc s); /* CalcFollowProduction - */ -static void CalcFollowProduction (ProductionDesc p); +static void CalcFollowProduction (pge_ProductionDesc p); /* CalcEpsilonFactor - */ -static void CalcEpsilonFactor (FactorDesc f); +static void CalcEpsilonFactor (pge_FactorDesc f); /* CalcEpsilonTerm - */ -static void CalcEpsilonTerm (TermDesc t); +static void CalcEpsilonTerm (pge_TermDesc t); /* CalcEpsilonExpression - */ -static void CalcEpsilonExpression (ExpressionDesc e); +static void CalcEpsilonExpression (pge_ExpressionDesc e); /* CalcEpsilonStatement - given a bnf statement generate the follow set. */ -static void CalcEpsilonStatement (StatementDesc s); +static void CalcEpsilonStatement (pge_StatementDesc s); /* CalcEpsilonProduction - */ -static void CalcEpsilonProduction (ProductionDesc p); +static void CalcEpsilonProduction (pge_ProductionDesc p); /* CalcReachEndFactor - */ -static TraverseResult CalcReachEndFactor (FactorDesc f); +static pge_TraverseResult CalcReachEndFactor (pge_FactorDesc f); /* CalcReachEndTerm - */ -static TraverseResult CalcReachEndTerm (TermDesc t); +static pge_TraverseResult CalcReachEndTerm (pge_TermDesc t); /* CalcReachEndExpression - */ -static void CalcReachEndExpression (ExpressionDesc e); +static void CalcReachEndExpression (pge_ExpressionDesc e); /* CalcReachEndStatement - */ -static void CalcReachEndStatement (StatementDesc s); +static void CalcReachEndStatement (pge_StatementDesc s); /* CalcReachEndStatement - @@ -1546,37 +1547,37 @@ static void stop (void); CalcReachEndProduction - */ -static void CalcReachEndProduction (ProductionDesc p); +static void CalcReachEndProduction (pge_ProductionDesc p); /* EmptyFactor - */ -static unsigned int EmptyFactor (FactorDesc f); +static unsigned int EmptyFactor (pge_FactorDesc f); /* EmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int EmptyTerm (TermDesc t); +static unsigned int EmptyTerm (pge_TermDesc t); /* EmptyExpression - */ -static unsigned int EmptyExpression (ExpressionDesc e); +static unsigned int EmptyExpression (pge_ExpressionDesc e); /* EmptyStatement - returns TRUE if statement, s, is empty. */ -static unsigned int EmptyStatement (StatementDesc s); +static unsigned int EmptyStatement (pge_StatementDesc s); /* EmptyProduction - returns if production, p, maybe empty. */ -static unsigned int EmptyProduction (ProductionDesc p); +static unsigned int EmptyProduction (pge_ProductionDesc p); /* EmitFDLNotice - @@ -1636,91 +1637,91 @@ static void EmitSupport (void); DisposeSetDesc - dispose of the set list, s. */ -static void DisposeSetDesc (SetDesc *s); +static void DisposeSetDesc (pge_SetDesc *s); /* OptionalFactor - */ -static unsigned int OptionalFactor (FactorDesc f); +static unsigned int OptionalFactor (pge_FactorDesc f); /* OptionalTerm - returns TRUE if the term maybe empty. */ -static unsigned int OptionalTerm (TermDesc t); +static unsigned int OptionalTerm (pge_TermDesc t); /* OptionalExpression - */ -static unsigned int OptionalExpression (ExpressionDesc e); +static unsigned int OptionalExpression (pge_ExpressionDesc e); /* OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int OptionalStatement (StatementDesc s); +static unsigned int OptionalStatement (pge_StatementDesc s); /* OptionalProduction - */ -static unsigned int OptionalProduction (ProductionDesc p); +static unsigned int OptionalProduction (pge_ProductionDesc p); /* CheckFirstFollow - */ -static unsigned int CheckFirstFollow (FactorDesc f, FactorDesc after); +static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after); /* ConstrainedEmptyFactor - */ -static unsigned int ConstrainedEmptyFactor (FactorDesc f); +static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f); /* ConstrainedEmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int ConstrainedEmptyTerm (TermDesc t); +static unsigned int ConstrainedEmptyTerm (pge_TermDesc t); /* ConstrainedEmptyExpression - */ -static unsigned int ConstrainedEmptyExpression (ExpressionDesc e); +static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e); /* ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int ConstrainedEmptyStatement (StatementDesc s); +static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s); /* ConstrainedEmptyProduction - returns TRUE if a problem exists with, p. */ -static unsigned int ConstrainedEmptyProduction (ProductionDesc p); +static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p); /* TestForLALR1 - */ -static void TestForLALR1 (ProductionDesc p); +static void TestForLALR1 (pge_ProductionDesc p); /* DoEpsilon - runs the epsilon interrelated rules */ -static void DoEpsilon (ProductionDesc p); +static void DoEpsilon (pge_ProductionDesc p); /* CheckComplete - checks that production, p, is complete. */ -static void CheckComplete (ProductionDesc p); +static void CheckComplete (pge_ProductionDesc p); /* PostProcessRules - backpatch the ident to rule definitions and emit comments and code. @@ -1750,7 +1751,7 @@ static void Init (void); DescribeStop - issues a message explaining what tokens were expected */ -static DynamicStrings_String DescribeStop (SetOfStop stopset); +static DynamicStrings_String DescribeStop (pge_SetOfStop stopset); /* DescribeError - issues a message explaining what tokens were expected @@ -1781,92 +1782,92 @@ static void WarnError1 (const char *a_, unsigned int _a_high, unsigned int n); PrettyFollow - */ -static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, FollowDesc f); +static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, pge_FollowDesc f); /* NewFollow - creates a new follow descriptor and returns the data structure. */ -static FollowDesc NewFollow (void); +static pge_FollowDesc NewFollow (void); /* AssignEpsilon - assigns the epsilon value and sets the epsilon to value, providing condition is TRUE. */ -static void AssignEpsilon (unsigned int condition, FollowDesc f, TraverseResult value); +static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value); /* GetEpsilon - returns the value of epsilon */ -static TraverseResult GetEpsilon (FollowDesc f); +static pge_TraverseResult GetEpsilon (pge_FollowDesc f); /* AssignReachEnd - assigns the reachend value providing that, condition, is TRUE. */ -static void AssignReachEnd (unsigned int condition, FollowDesc f, TraverseResult value); +static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value); /* GetReachEnd - returns the value of reachend */ -static TraverseResult GetReachEnd (FollowDesc f); +static pge_TraverseResult GetReachEnd (pge_FollowDesc f); /* AssignFollow - assigns the follow set and sets the calcfollow to TRUE. */ -static void AssignFollow (FollowDesc f, SetDesc s); +static void AssignFollow (pge_FollowDesc f, pge_SetDesc s); /* GetFollow - returns the follow set. */ -static SetDesc GetFollow (FollowDesc f); +static pge_SetDesc GetFollow (pge_FollowDesc f); /* NewProduction - creates a new production and returns the data structure. */ -static ProductionDesc NewProduction (void); +static pge_ProductionDesc NewProduction (void); /* NewFactor - */ -static FactorDesc NewFactor (void); +static pge_FactorDesc NewFactor (void); /* NewTerm - returns a new term. */ -static TermDesc NewTerm (void); +static pge_TermDesc NewTerm (void); /* NewExpression - returns a new expression. */ -static ExpressionDesc NewExpression (void); +static pge_ExpressionDesc NewExpression (void); /* NewStatement - returns a new statement. */ -static StatementDesc NewStatement (void); +static pge_StatementDesc NewStatement (void); /* NewSetDesc - creates a new set description and returns the data structure. */ -static SetDesc NewSetDesc (void); +static pge_SetDesc NewSetDesc (void); /* NewCodeDesc - creates a new code descriptor and initializes all fields to zero. */ -static CodeDesc NewCodeDesc (void); +static pge_CodeDesc NewCodeDesc (void); /* CodeFragmentPrologue - consumes code text up to a "%" after a newline. @@ -1890,13 +1891,13 @@ static void CodeFragmentDeclaration (void); GetCodeFragment - collects the code fragment up until ^ % */ -static void GetCodeFragment (CodeHunk *h); +static void GetCodeFragment (pge_CodeHunk *h); /* WriteCodeHunkList - writes the CodeHunk list in the correct order. */ -static void WriteCodeHunkList (CodeHunk l); +static void WriteCodeHunkList (pge_CodeHunk l); /* WriteIndent - writes, n, spaces. @@ -1922,19 +1923,19 @@ static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned in but it removes up to indent spaces if they exist. */ -static void WriteCodeHunkListIndent (CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext); +static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext); /* Add - adds a character to a code hunk and creates another code hunk if necessary. */ -static CodeHunk Add (CodeHunk *p, char ch, unsigned int *i); +static pge_CodeHunk Add (pge_CodeHunk *p, char ch, unsigned int *i); /* ConsHunk - combine two possible code hunks. */ -static void ConsHunk (CodeHunk *p, CodeHunk q); +static void ConsHunk (pge_CodeHunk *p, pge_CodeHunk q); /* GetName - returns the next symbol which is checked for a legal name. @@ -1947,49 +1948,49 @@ static NameKey_Name GetName (void); a stop symbol. */ -static void SyntaxError (SetOfStop stop); +static void SyntaxError (pge_SetOfStop stop); /* SyntaxCheck - */ -static void SyntaxCheck (SetOfStop stop); +static void SyntaxCheck (pge_SetOfStop stop); /* Expect - */ -static void Expect (bnflex_TokenType t, SetOfStop stop); +static void Expect (bnflex_TokenType t, pge_SetOfStop stop); /* Ident - error checking varient of Ident */ -static void Ident (SetOfStop stop); +static void Ident (pge_SetOfStop stop); /* Modula2Code - error checking varient of Modula2Code */ -static void Modula2Code (SetOfStop stop); +static void Modula2Code (pge_SetOfStop stop); /* StartModName := % ModuleName := GetName() ; ignore begintok CodeFragmentPrologue % =: */ -static void StartModName (SetOfStop stop); +static void StartModName (pge_SetOfStop stop); /* EndModName := */ -static void EndModName (SetOfStop stop); +static void EndModName (pge_SetOfStop stop); /* DoDeclaration := % CodeFragmentDeclaration % =: */ -static void DoDeclaration (SetOfStop stop); +static void DoDeclaration (pge_SetOfStop stop); /* CollectLiteral := @@ -2002,7 +2003,7 @@ static void DoDeclaration (SetOfStop stop); cannot reachend */ -static void CollectLiteral (SetOfStop stopset); +static void CollectLiteral (pge_SetOfStop stopset); /* CollectTok := @@ -2027,7 +2028,7 @@ static void CollectLiteral (SetOfStop stopset); cannot reachend */ -static void CollectTok (SetOfStop stopset); +static void CollectTok (pge_SetOfStop stopset); /* DefineToken := @@ -2044,7 +2045,7 @@ static void CollectTok (SetOfStop stopset); cannot reachend */ -static void DefineToken (SetOfStop stopset); +static void DefineToken (pge_SetOfStop stopset); /* Rules := '%' 'rules' { Defs } ExtBNF @@ -2054,7 +2055,7 @@ static void DefineToken (SetOfStop stopset); cannot reachend */ -static void Rules (SetOfStop stopset); +static void Rules (pge_SetOfStop stopset); /* Special := Ident @@ -2086,7 +2087,7 @@ static void Rules (SetOfStop stopset); cannot reachend */ -static void Special (SetOfStop stopset); +static void Special (pge_SetOfStop stopset); /* Factor := '%' Modula2Code '%' | @@ -2129,7 +2130,7 @@ static void Special (SetOfStop stopset); cannot reachend */ -static void Factor (SetOfStop stopset); +static void Factor (pge_SetOfStop stopset); /* Statement := @@ -2170,7 +2171,7 @@ static void Factor (SetOfStop stopset); cannot reachend */ -static void Statement (SetOfStop stopset); +static void Statement (pge_SetOfStop stopset); /* Defs := 'special' Special | 'token' Token | @@ -2183,7 +2184,7 @@ static void Statement (SetOfStop stopset); cannot reachend */ -static void Defs (SetOfStop stopset); +static void Defs (pge_SetOfStop stopset); /* ExtBNF := 'BNF' { Production } 'FNB' @@ -2193,7 +2194,7 @@ static void Defs (SetOfStop stopset); cannot reachend */ -static void ExtBNF (SetOfStop stopset); +static void ExtBNF (pge_SetOfStop stopset); /* Main := Header Decls Footer Rules @@ -2203,7 +2204,7 @@ static void ExtBNF (SetOfStop stopset); cannot reachend */ -static void Main (SetOfStop stopset); +static void Main (pge_SetOfStop stopset); /* Header := '%' 'module' StartModName @@ -2213,7 +2214,7 @@ static void Main (SetOfStop stopset); cannot reachend */ -static void Header (SetOfStop stopset); +static void Header (pge_SetOfStop stopset); /* Decls := '%' 'declaration' DoDeclaration @@ -2223,7 +2224,7 @@ static void Header (SetOfStop stopset); cannot reachend */ -static void Decls (SetOfStop stopset); +static void Decls (pge_SetOfStop stopset); /* Footer := '%' 'module' EndModName @@ -2233,7 +2234,7 @@ static void Decls (SetOfStop stopset); cannot reachend */ -static void Footer (SetOfStop stopset); +static void Footer (pge_SetOfStop stopset); /* First := 'first' '{' { LitOrTokenOrIdent @@ -2249,7 +2250,7 @@ static void Footer (SetOfStop stopset); cannot reachend */ -static void First (SetOfStop stopset); +static void First (pge_SetOfStop stopset); /* Follow := 'follow' '{' { LitOrTokenOrIdent @@ -2265,7 +2266,7 @@ static void First (SetOfStop stopset); cannot reachend */ -static void Follow (SetOfStop stopset); +static void Follow (pge_SetOfStop stopset); /* LitOrTokenOrIdent := Literal @@ -2290,7 +2291,7 @@ static void Follow (SetOfStop stopset); cannot reachend */ -static void LitOrTokenOrIdent (SetOfStop stopset); +static void LitOrTokenOrIdent (pge_SetOfStop stopset); /* Literal := '"' CollectLiteral '"' | @@ -2301,7 +2302,7 @@ static void LitOrTokenOrIdent (SetOfStop stopset); cannot reachend */ -static void Literal (SetOfStop stopset); +static void Literal (pge_SetOfStop stopset); /* Token := Literal DefineToken @@ -2311,7 +2312,7 @@ static void Literal (SetOfStop stopset); cannot reachend */ -static void Token (SetOfStop stopset); +static void Token (pge_SetOfStop stopset); /* ErrorProcedures := Literal @@ -2325,7 +2326,7 @@ static void Token (SetOfStop stopset); cannot reachend */ -static void ErrorProcedures (SetOfStop stopset); +static void ErrorProcedures (pge_SetOfStop stopset); /* TokenProcedure := Literal @@ -2337,7 +2338,7 @@ static void ErrorProcedures (SetOfStop stopset); cannot reachend */ -static void TokenProcedure (SetOfStop stopset); +static void TokenProcedure (pge_SetOfStop stopset); /* SymProcedure := Literal @@ -2349,7 +2350,7 @@ static void TokenProcedure (SetOfStop stopset); cannot reachend */ -static void SymProcedure (SetOfStop stopset); +static void SymProcedure (pge_SetOfStop stopset); /* Production := Statement @@ -2359,7 +2360,7 @@ static void SymProcedure (SetOfStop stopset); cannot reachend */ -static void Production (SetOfStop stopset); +static void Production (pge_SetOfStop stopset); /* Expression := @@ -2384,7 +2385,7 @@ static void Production (SetOfStop stopset); cannot reachend */ -static void Expression (SetOfStop stopset); +static void Expression (pge_SetOfStop stopset); /* Term := @@ -2409,75 +2410,75 @@ static void Expression (SetOfStop stopset); cannot reachend */ -static void Term (SetOfStop stopset); +static void Term (pge_SetOfStop stopset); /* GetDefinitionName - returns the name of the rule inside, p. */ -static NameKey_Name GetDefinitionName (ProductionDesc p); +static NameKey_Name GetDefinitionName (pge_ProductionDesc p); /* FindDefinition - searches and returns the rule which defines, n. */ -static ProductionDesc FindDefinition (NameKey_Name n); +static pge_ProductionDesc FindDefinition (NameKey_Name n); /* BackPatchIdent - found an ident, i, we must look for the corresponding rule and set the definition accordingly. */ -static void BackPatchIdent (IdentDesc i); +static void BackPatchIdent (pge_IdentDesc i); /* BackPatchFactor - runs through the factor looking for an ident */ -static void BackPatchFactor (FactorDesc f); +static void BackPatchFactor (pge_FactorDesc f); /* BackPatchTerm - runs through all terms to find idents. */ -static void BackPatchTerm (TermDesc t); +static void BackPatchTerm (pge_TermDesc t); /* BackPatchExpression - runs through the term to find any idents. */ -static void BackPatchExpression (ExpressionDesc e); +static void BackPatchExpression (pge_ExpressionDesc e); /* BackPatchSet - */ -static void BackPatchSet (SetDesc s); +static void BackPatchSet (pge_SetDesc s); /* BackPatchIdentToDefinitions - search through all the rules and add a link from any ident to the definition. */ -static void BackPatchIdentToDefinitions (ProductionDesc d); +static void BackPatchIdentToDefinitions (pge_ProductionDesc d); /* CalculateFirstAndFollow - */ -static void CalculateFirstAndFollow (ProductionDesc p); +static void CalculateFirstAndFollow (pge_ProductionDesc p); /* ForeachRuleDo - */ -static void ForeachRuleDo (DoProcedure p); +static void ForeachRuleDo (pge_DoProcedure p); /* WhileNotCompleteDo - */ -static void WhileNotCompleteDo (DoProcedure p); +static void WhileNotCompleteDo (pge_DoProcedure p); /* NewLine - generate a newline and indent. @@ -2507,7 +2508,7 @@ static void KeyWord (NameKey_Name n); PrettyPara - */ -static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, ExpressionDesc e, unsigned int Left); +static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, pge_ExpressionDesc e, unsigned int Left); /* WriteKeyTexinfo - @@ -2519,55 +2520,55 @@ static void WriteKeyTexinfo (NameKey_Name s); PrettyCommentFactor - */ -static void PrettyCommentFactor (FactorDesc f, unsigned int Left); +static void PrettyCommentFactor (pge_FactorDesc f, unsigned int Left); /* PeepTerm - returns the length of characters in term. */ -static unsigned int PeepTerm (TermDesc t); +static unsigned int PeepTerm (pge_TermDesc t); /* PeepExpression - returns the length of the expression. */ -static unsigned int PeepExpression (ExpressionDesc e); +static unsigned int PeepExpression (pge_ExpressionDesc e); /* PeepFactor - returns the length of character in the factor */ -static unsigned int PeepFactor (FactorDesc f); +static unsigned int PeepFactor (pge_FactorDesc f); /* PrettyCommentTerm - */ -static void PrettyCommentTerm (TermDesc t, unsigned int Left); +static void PrettyCommentTerm (pge_TermDesc t, unsigned int Left); /* PrettyCommentExpression - */ -static void PrettyCommentExpression (ExpressionDesc e, unsigned int Left); +static void PrettyCommentExpression (pge_ExpressionDesc e, unsigned int Left); /* PrettyCommentStatement - */ -static void PrettyCommentStatement (StatementDesc s, unsigned int Left); +static void PrettyCommentStatement (pge_StatementDesc s, unsigned int Left); /* PrettyCommentProduction - generates the comment for rule, p. */ -static void PrettyCommentProduction (ProductionDesc p); +static void PrettyCommentProduction (pge_ProductionDesc p); /* PrettyPrintProduction - pretty prints the ebnf rule, p. */ -static void PrettyPrintProduction (ProductionDesc p); +static void PrettyPrintProduction (pge_ProductionDesc p); /* EmitFileLineTag - emits a line and file tag using the C preprocessor syntax. @@ -2579,91 +2580,91 @@ static void EmitFileLineTag (unsigned int line); EmitRule - generates a comment and code for rule, p. */ -static void EmitRule (ProductionDesc p); +static void EmitRule (pge_ProductionDesc p); /* CodeCondition - */ -static void CodeCondition (m2condition m); +static void CodeCondition (pge_m2condition m); /* CodeThenDo - codes a "THEN" or "DO" depending upon, m. */ -static void CodeThenDo (m2condition m); +static void CodeThenDo (pge_m2condition m); /* CodeElseEnd - builds an ELSE END statement using string, end. */ -static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, FactorDesc f, unsigned int inopt); +static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt); /* CodeEnd - codes a "END" depending upon, m. */ -static void CodeEnd (m2condition m, TermDesc t, unsigned int consumed, FactorDesc f, unsigned int inopt); +static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt); /* EmitNonVarCode - writes out, code, providing it is not a variable declaration. */ -static void EmitNonVarCode (CodeDesc code, unsigned int curpos, unsigned int left); +static void EmitNonVarCode (pge_CodeDesc code, unsigned int curpos, unsigned int left); /* ChainOn - */ -static FactorDesc ChainOn (FactorDesc codeStack, FactorDesc f); +static pge_FactorDesc ChainOn (pge_FactorDesc codeStack, pge_FactorDesc f); /* FlushCode - */ -static void FlushCode (FactorDesc *codeStack); +static void FlushCode (pge_FactorDesc *codeStack); /* CodeFactor - */ -static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeTerm - */ -static void CodeTerm (TermDesc t, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeExpression - */ -static void CodeExpression (ExpressionDesc e, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack); +static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack); /* CodeStatement - */ -static void CodeStatement (StatementDesc s, m2condition m); +static void CodeStatement (pge_StatementDesc s, pge_m2condition m); /* CodeProduction - only encode grammer rules which are not special. */ -static void CodeProduction (ProductionDesc p); +static void CodeProduction (pge_ProductionDesc p); /* RecoverCondition - */ -static void RecoverCondition (m2condition m); +static void RecoverCondition (pge_m2condition m); /* ConditionIndent - returns the number of spaces indentation created via, m. */ -static unsigned int ConditionIndent (m2condition m); +static unsigned int ConditionIndent (pge_m2condition m); /* WriteGetTokenType - writes out the method of determining the token type. @@ -2675,7 +2676,7 @@ static void WriteGetTokenType (void); NumberOfElements - returns the number of elements in set, to, which lie between low..high */ -static unsigned int NumberOfElements (SetDesc to, unsigned int low, unsigned int high); +static unsigned int NumberOfElements (pge_SetDesc to, unsigned int low, unsigned int high); /* WriteElement - writes the literal name for element, e. @@ -2687,26 +2688,26 @@ static void WriteElement (unsigned int e); EmitIsInSet - writes out the equivalent of GetTokenType() IN { toset } */ -static void EmitIsInSet (SetDesc to, NameKey_Name low, NameKey_Name high); +static void EmitIsInSet (pge_SetDesc to, NameKey_Name low, NameKey_Name high); /* EmitIsInSubSet - writes out a test to see whether GetTokenype() is in { subset } */ -static void EmitIsInSubSet (SetDesc to, unsigned int low, unsigned int high); +static void EmitIsInSubSet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitIsInFirst - */ -static void EmitIsInFirst (SetDesc to, m2condition m); -static void FlushRecoverCode (FactorDesc *codeStack); +static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m); +static void FlushRecoverCode (pge_FactorDesc *codeStack); /* RecoverFactor - */ -static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack); +static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc codeStack); /* OptExpSeen - returns TRUE if we can see an optional expression in the factor. @@ -2715,31 +2716,31 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack); and FALSE in the first. */ -static unsigned int OptExpSeen (FactorDesc f); +static unsigned int OptExpSeen (pge_FactorDesc f); /* RecoverTerm - */ -static void RecoverTerm (TermDesc t, m2condition new_, m2condition old); +static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition old); /* RecoverExpression - */ -static void RecoverExpression (ExpressionDesc e, m2condition new_, m2condition old); +static void RecoverExpression (pge_ExpressionDesc e, pge_m2condition new_, pge_m2condition old); /* RecoverStatement - */ -static void RecoverStatement (StatementDesc s, m2condition m); +static void RecoverStatement (pge_StatementDesc s, pge_m2condition m); /* EmitFirstFactor - generate a list of all first tokens between the range: low..high. */ -static void EmitFirstFactor (FactorDesc f, unsigned int low, unsigned int high); +static void EmitFirstFactor (pge_FactorDesc f, unsigned int low, unsigned int high); /* EmitUsed - @@ -2764,33 +2765,33 @@ static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned i IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high. */ -static unsigned int IsEmptySet (SetDesc to, unsigned int low, unsigned int high); +static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitSet - emits the tokens in the set, to, which have values low..high */ -static void EmitSet (SetDesc to, unsigned int low, unsigned int high); +static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitSetName - emits the tokens in the set, to, which have values low..high, using their names. */ -static void EmitSetName (SetDesc to, unsigned int low, unsigned int high); +static void EmitSetName (pge_SetDesc to, unsigned int low, unsigned int high); /* EmitStopParametersAndSet - generates the stop parameters together with a set inclusion of all the symbols in set, to. */ -static void EmitStopParametersAndSet (SetDesc to); +static void EmitStopParametersAndSet (pge_SetDesc to); /* EmitSetAsParameters - generates the first symbols as parameters to a set function. */ -static void EmitSetAsParameters (SetDesc to); +static void EmitSetAsParameters (pge_SetDesc to); /* EmitStopParametersAndFollow - generates the stop parameters together with a set @@ -2798,20 +2799,20 @@ static void EmitSetAsParameters (SetDesc to); sentances. */ -static void EmitStopParametersAndFollow (FactorDesc f, m2condition m); +static void EmitStopParametersAndFollow (pge_FactorDesc f, pge_m2condition m); /* EmitFirstAsParameters - */ -static void EmitFirstAsParameters (FactorDesc f); +static void EmitFirstAsParameters (pge_FactorDesc f); /* RecoverProduction - only encode grammer rules which are not special. Generate error recovery code. */ -static void RecoverProduction (ProductionDesc p); +static void RecoverProduction (pge_ProductionDesc p); /* IsWhite - returns TRUE if, ch, is a space or a tab. @@ -2823,208 +2824,208 @@ static unsigned int IsWhite (char ch); FindStr - returns TRUE if, str, was seen inside the code hunk */ -static unsigned int FindStr (CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high); +static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high); /* WriteUpto - */ -static void WriteUpto (CodeHunk code, CodeHunk upto, unsigned int limit); +static void WriteUpto (pge_CodeHunk code, pge_CodeHunk upto, unsigned int limit); /* CheckForVar - checks for any local variables which need to be emitted during this production. */ -static void CheckForVar (CodeHunk code); +static void CheckForVar (pge_CodeHunk code); /* VarFactor - */ -static void VarFactor (FactorDesc f); +static void VarFactor (pge_FactorDesc f); /* VarTerm - */ -static void VarTerm (TermDesc t); +static void VarTerm (pge_TermDesc t); /* VarExpression - */ -static void VarExpression (ExpressionDesc e); +static void VarExpression (pge_ExpressionDesc e); /* VarStatement - */ -static void VarStatement (StatementDesc s); +static void VarStatement (pge_StatementDesc s); /* VarProduction - writes out all variable declarations. */ -static void VarProduction (ProductionDesc p); +static void VarProduction (pge_ProductionDesc p); /* In - returns TRUE if token, s, is already in the set, to. */ -static unsigned int In (SetDesc to, NameKey_Name s); +static unsigned int In (pge_SetDesc to, NameKey_Name s); /* IntersectionIsNil - given two set lists, s1, s2, return TRUE if the s1 * s2 = {} */ -static unsigned int IntersectionIsNil (SetDesc s1, SetDesc s2); +static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2); /* AddSet - adds a first symbol to a production. */ -static void AddSet (SetDesc *to, NameKey_Name s); +static void AddSet (pge_SetDesc *to, NameKey_Name s); /* OrSet - */ -static void OrSet (SetDesc *to, SetDesc from); +static void OrSet (pge_SetDesc *to, pge_SetDesc from); /* CalcFirstFactor - */ -static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to); +static void CalcFirstFactor (pge_FactorDesc f, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstTerm - */ -static void CalcFirstTerm (TermDesc t, ProductionDesc from, SetDesc *to); +static void CalcFirstTerm (pge_TermDesc t, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstExpression - */ -static void CalcFirstExpression (ExpressionDesc e, ProductionDesc from, SetDesc *to); +static void CalcFirstExpression (pge_ExpressionDesc e, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstStatement - */ -static void CalcFirstStatement (StatementDesc s, ProductionDesc from, SetDesc *to); +static void CalcFirstStatement (pge_StatementDesc s, pge_ProductionDesc from, pge_SetDesc *to); /* CalcFirstProduction - calculates all of the first symbols for the grammer */ -static void CalcFirstProduction (ProductionDesc p, ProductionDesc from, SetDesc *to); -static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after); +static void CalcFirstProduction (pge_ProductionDesc p, pge_ProductionDesc from, pge_SetDesc *to); +static void WorkOutFollowFactor (pge_FactorDesc f, pge_SetDesc *followset, pge_SetDesc after); /* WorkOutFollowTerm - */ -static void WorkOutFollowTerm (TermDesc t, SetDesc *followset, SetDesc after); +static void WorkOutFollowTerm (pge_TermDesc t, pge_SetDesc *followset, pge_SetDesc after); /* WorkOutFollowExpression - */ -static void WorkOutFollowExpression (ExpressionDesc e, SetDesc *followset, SetDesc after); +static void WorkOutFollowExpression (pge_ExpressionDesc e, pge_SetDesc *followset, pge_SetDesc after); /* CollectFollow - collects the follow set from, f, into, to. */ -static void CollectFollow (SetDesc *to, FollowDesc f); +static void CollectFollow (pge_SetDesc *to, pge_FollowDesc f); /* CalcFollowFactor - */ -static void CalcFollowFactor (FactorDesc f, SetDesc after); +static void CalcFollowFactor (pge_FactorDesc f, pge_SetDesc after); /* CalcFollowTerm - */ -static void CalcFollowTerm (TermDesc t, SetDesc after); +static void CalcFollowTerm (pge_TermDesc t, pge_SetDesc after); /* CalcFollowExpression - */ -static void CalcFollowExpression (ExpressionDesc e, SetDesc after); +static void CalcFollowExpression (pge_ExpressionDesc e, pge_SetDesc after); /* CalcFollowStatement - given a bnf statement generate the follow set. */ -static void CalcFollowStatement (StatementDesc s); +static void CalcFollowStatement (pge_StatementDesc s); /* CalcFollowProduction - */ -static void CalcFollowProduction (ProductionDesc p); +static void CalcFollowProduction (pge_ProductionDesc p); /* CalcEpsilonFactor - */ -static void CalcEpsilonFactor (FactorDesc f); +static void CalcEpsilonFactor (pge_FactorDesc f); /* CalcEpsilonTerm - */ -static void CalcEpsilonTerm (TermDesc t); +static void CalcEpsilonTerm (pge_TermDesc t); /* CalcEpsilonExpression - */ -static void CalcEpsilonExpression (ExpressionDesc e); +static void CalcEpsilonExpression (pge_ExpressionDesc e); /* CalcEpsilonStatement - given a bnf statement generate the follow set. */ -static void CalcEpsilonStatement (StatementDesc s); +static void CalcEpsilonStatement (pge_StatementDesc s); /* CalcEpsilonProduction - */ -static void CalcEpsilonProduction (ProductionDesc p); +static void CalcEpsilonProduction (pge_ProductionDesc p); /* CalcReachEndFactor - */ -static TraverseResult CalcReachEndFactor (FactorDesc f); +static pge_TraverseResult CalcReachEndFactor (pge_FactorDesc f); /* CalcReachEndTerm - */ -static TraverseResult CalcReachEndTerm (TermDesc t); +static pge_TraverseResult CalcReachEndTerm (pge_TermDesc t); /* CalcReachEndExpression - */ -static void CalcReachEndExpression (ExpressionDesc e); +static void CalcReachEndExpression (pge_ExpressionDesc e); /* CalcReachEndStatement - */ -static void CalcReachEndStatement (StatementDesc s); +static void CalcReachEndStatement (pge_StatementDesc s); /* CalcReachEndStatement - @@ -3036,37 +3037,37 @@ static void stop (void); CalcReachEndProduction - */ -static void CalcReachEndProduction (ProductionDesc p); +static void CalcReachEndProduction (pge_ProductionDesc p); /* EmptyFactor - */ -static unsigned int EmptyFactor (FactorDesc f); +static unsigned int EmptyFactor (pge_FactorDesc f); /* EmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int EmptyTerm (TermDesc t); +static unsigned int EmptyTerm (pge_TermDesc t); /* EmptyExpression - */ -static unsigned int EmptyExpression (ExpressionDesc e); +static unsigned int EmptyExpression (pge_ExpressionDesc e); /* EmptyStatement - returns TRUE if statement, s, is empty. */ -static unsigned int EmptyStatement (StatementDesc s); +static unsigned int EmptyStatement (pge_StatementDesc s); /* EmptyProduction - returns if production, p, maybe empty. */ -static unsigned int EmptyProduction (ProductionDesc p); +static unsigned int EmptyProduction (pge_ProductionDesc p); /* EmitFDLNotice - @@ -3126,91 +3127,91 @@ static void EmitSupport (void); DisposeSetDesc - dispose of the set list, s. */ -static void DisposeSetDesc (SetDesc *s); +static void DisposeSetDesc (pge_SetDesc *s); /* OptionalFactor - */ -static unsigned int OptionalFactor (FactorDesc f); +static unsigned int OptionalFactor (pge_FactorDesc f); /* OptionalTerm - returns TRUE if the term maybe empty. */ -static unsigned int OptionalTerm (TermDesc t); +static unsigned int OptionalTerm (pge_TermDesc t); /* OptionalExpression - */ -static unsigned int OptionalExpression (ExpressionDesc e); +static unsigned int OptionalExpression (pge_ExpressionDesc e); /* OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int OptionalStatement (StatementDesc s); +static unsigned int OptionalStatement (pge_StatementDesc s); /* OptionalProduction - */ -static unsigned int OptionalProduction (ProductionDesc p); +static unsigned int OptionalProduction (pge_ProductionDesc p); /* CheckFirstFollow - */ -static unsigned int CheckFirstFollow (FactorDesc f, FactorDesc after); +static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after); /* ConstrainedEmptyFactor - */ -static unsigned int ConstrainedEmptyFactor (FactorDesc f); +static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f); /* ConstrainedEmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int ConstrainedEmptyTerm (TermDesc t); +static unsigned int ConstrainedEmptyTerm (pge_TermDesc t); /* ConstrainedEmptyExpression - */ -static unsigned int ConstrainedEmptyExpression (ExpressionDesc e); +static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e); /* ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int ConstrainedEmptyStatement (StatementDesc s); +static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s); /* ConstrainedEmptyProduction - returns TRUE if a problem exists with, p. */ -static unsigned int ConstrainedEmptyProduction (ProductionDesc p); +static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p); /* TestForLALR1 - */ -static void TestForLALR1 (ProductionDesc p); +static void TestForLALR1 (pge_ProductionDesc p); /* DoEpsilon - runs the epsilon interrelated rules */ -static void DoEpsilon (ProductionDesc p); +static void DoEpsilon (pge_ProductionDesc p); /* CheckComplete - checks that production, p, is complete. */ -static void CheckComplete (ProductionDesc p); +static void CheckComplete (pge_ProductionDesc p); /* PostProcessRules - backpatch the ident to rule definitions and emit comments and code. @@ -3241,7 +3242,7 @@ static void Init (void); DescribeStop - issues a message explaining what tokens were expected */ -static DynamicStrings_String DescribeStop (SetOfStop stopset) +static DynamicStrings_String DescribeStop (pge_SetOfStop stopset) { unsigned int n; DynamicStrings_String str; @@ -3600,14 +3601,14 @@ static void AddEntry (SymbolKey_SymbolTree *t, NameKey_Name def, NameKey_Name va static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, char *dest, unsigned int _dest_high) { - typedef struct _T12_a _T12; + typedef struct Format1__T12_a Format1__T12; - struct _T12_a { char array[MaxString+1]; }; + struct Format1__T12_a { char array[MaxString+1]; }; unsigned int HighSrc; unsigned int HighDest; unsigned int i; unsigned int j; - _T12 str; + Format1__T12 str; char src[_src_high+1]; /* make a local copy of each unbounded array. */ @@ -3671,10 +3672,10 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c static void WarnError1 (const char *a_, unsigned int _a_high, unsigned int n) { - typedef struct _T13_a _T13; + typedef struct WarnError1__T13_a WarnError1__T13; - struct _T13_a { char array[MaxString+1]; }; - _T13 line; + struct WarnError1__T13_a { char array[MaxString+1]; }; + WarnError1__T13 line; char a[_a_high+1]; /* make a local copy of each unbounded array. */ @@ -3689,7 +3690,7 @@ static void WarnError1 (const char *a_, unsigned int _a_high, unsigned int n) PrettyFollow - */ -static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, FollowDesc f) +static void PrettyFollow (const char *start_, unsigned int _start_high, const char *end_, unsigned int _end_high, pge_FollowDesc f) { char start[_start_high+1]; char end[_end_high+1]; @@ -3710,15 +3711,15 @@ static void PrettyFollow (const char *start_, unsigned int _start_high, const ch } switch (f->reachend) { - case true_: + case pge_true: Output_WriteString ((const char *) " [E]", 4); break; - case false_: + case pge_false: Output_WriteString ((const char *) " [C]", 4); break; - case unknown: + case pge_unknown: Output_WriteString ((const char *) " [U]", 4); break; @@ -3728,14 +3729,14 @@ static void PrettyFollow (const char *start_, unsigned int _start_high, const ch } switch (f->epsilon) { - case true_: + case pge_true: Output_WriteString ((const char *) " [e]", 4); break; - case false_: + case pge_false: break; - case unknown: + case pge_unknown: Output_WriteString ((const char *) " [u]", 4); break; @@ -3753,14 +3754,14 @@ static void PrettyFollow (const char *start_, unsigned int _start_high, const ch NewFollow - creates a new follow descriptor and returns the data structure. */ -static FollowDesc NewFollow (void) +static pge_FollowDesc NewFollow (void) { - FollowDesc f; + pge_FollowDesc f; - Storage_ALLOCATE ((void **) &f, sizeof (_T6)); + Storage_ALLOCATE ((void **) &f, sizeof (pge__T6)); f->follow = NULL; - f->reachend = unknown; - f->epsilon = unknown; + f->reachend = pge_unknown; + f->epsilon = pge_unknown; return f; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -3772,9 +3773,9 @@ static FollowDesc NewFollow (void) providing condition is TRUE. */ -static void AssignEpsilon (unsigned int condition, FollowDesc f, TraverseResult value) +static void AssignEpsilon (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value) { - if ((condition && (value != unknown)) && (f->epsilon == unknown)) + if ((condition && (value != pge_unknown)) && (f->epsilon == pge_unknown)) { f->epsilon = value; Finished = FALSE; @@ -3786,11 +3787,11 @@ static void AssignEpsilon (unsigned int condition, FollowDesc f, TraverseResult GetEpsilon - returns the value of epsilon */ -static TraverseResult GetEpsilon (FollowDesc f) +static pge_TraverseResult GetEpsilon (pge_FollowDesc f) { if (f == NULL) { - Debug_Halt ((const char *) "why is the follow info NIL?", 27, 595, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "why is the follow info NIL?", 27, 596, (const char *) "m2/gm2-auto/pge.mod", 19); } else { @@ -3805,11 +3806,11 @@ static TraverseResult GetEpsilon (FollowDesc f) AssignReachEnd - assigns the reachend value providing that, condition, is TRUE. */ -static void AssignReachEnd (unsigned int condition, FollowDesc f, TraverseResult value) +static void AssignReachEnd (unsigned int condition, pge_FollowDesc f, pge_TraverseResult value) { if (condition) { - if ((f->reachend == unknown) && (value != unknown)) + if ((f->reachend == pge_unknown) && (value != pge_unknown)) { f->reachend = value; Finished = FALSE; @@ -3822,11 +3823,11 @@ static void AssignReachEnd (unsigned int condition, FollowDesc f, TraverseResult GetReachEnd - returns the value of reachend */ -static TraverseResult GetReachEnd (FollowDesc f) +static pge_TraverseResult GetReachEnd (pge_FollowDesc f) { if (f == NULL) { - Debug_Halt ((const char *) "why is the follow info NIL?", 27, 629, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "why is the follow info NIL?", 27, 630, (const char *) "m2/gm2-auto/pge.mod", 19); } else { @@ -3841,11 +3842,11 @@ static TraverseResult GetReachEnd (FollowDesc f) AssignFollow - assigns the follow set and sets the calcfollow to TRUE. */ -static void AssignFollow (FollowDesc f, SetDesc s) +static void AssignFollow (pge_FollowDesc f, pge_SetDesc s) { if (f->calcfollow) { - Debug_Halt ((const char *) "why are we reassigning this follow set?", 39, 645, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "why are we reassigning this follow set?", 39, 646, (const char *) "m2/gm2-auto/pge.mod", 19); } f->follow = s; f->calcfollow = TRUE; @@ -3856,11 +3857,11 @@ static void AssignFollow (FollowDesc f, SetDesc s) GetFollow - returns the follow set. */ -static SetDesc GetFollow (FollowDesc f) +static pge_SetDesc GetFollow (pge_FollowDesc f) { if (f == NULL) { - Debug_Halt ((const char *) "why is the follow info NIL?", 27, 661, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "why is the follow info NIL?", 27, 662, (const char *) "m2/gm2-auto/pge.mod", 19); } else { @@ -3870,7 +3871,7 @@ static SetDesc GetFollow (FollowDesc f) } else { - Debug_Halt ((const char *) "not calculated the follow set yet..", 35, 668, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "not calculated the follow set yet..", 35, 669, (const char *) "m2/gm2-auto/pge.mod", 19); } } ReturnException ("m2/gm2-auto/pge.mod", 1, 7); @@ -3882,11 +3883,11 @@ static SetDesc GetFollow (FollowDesc f) NewProduction - creates a new production and returns the data structure. */ -static ProductionDesc NewProduction (void) +static pge_ProductionDesc NewProduction (void) { - ProductionDesc p; + pge_ProductionDesc p; - Storage_ALLOCATE ((void **) &p, sizeof (_T2)); + Storage_ALLOCATE ((void **) &p, sizeof (pge__T2)); if (TailProduction != NULL) { TailProduction->next = p; @@ -3913,11 +3914,11 @@ static ProductionDesc NewProduction (void) NewFactor - */ -static FactorDesc NewFactor (void) +static pge_FactorDesc NewFactor (void) { - FactorDesc f; + pge_FactorDesc f; - Storage_ALLOCATE ((void **) &f, sizeof (_T5)); + Storage_ALLOCATE ((void **) &f, sizeof (pge__T5)); f->next = NULL; f->followinfo = NewFollow (); f->line = PushBackInput_GetCurrentLine (); @@ -3931,11 +3932,11 @@ static FactorDesc NewFactor (void) NewTerm - returns a new term. */ -static TermDesc NewTerm (void) +static pge_TermDesc NewTerm (void) { - TermDesc t; + pge_TermDesc t; - Storage_ALLOCATE ((void **) &t, sizeof (termdesc)); + Storage_ALLOCATE ((void **) &t, sizeof (pge_termdesc)); t->factor = NULL; t->followinfo = NewFollow (); t->next = NULL; @@ -3950,11 +3951,11 @@ static TermDesc NewTerm (void) NewExpression - returns a new expression. */ -static ExpressionDesc NewExpression (void) +static pge_ExpressionDesc NewExpression (void) { - ExpressionDesc e; + pge_ExpressionDesc e; - Storage_ALLOCATE ((void **) &e, sizeof (_T4)); + Storage_ALLOCATE ((void **) &e, sizeof (pge__T4)); e->term = NULL; e->followinfo = NewFollow (); e->line = PushBackInput_GetCurrentLine (); @@ -3968,11 +3969,11 @@ static ExpressionDesc NewExpression (void) NewStatement - returns a new statement. */ -static StatementDesc NewStatement (void) +static pge_StatementDesc NewStatement (void) { - StatementDesc s; + pge_StatementDesc s; - Storage_ALLOCATE ((void **) &s, sizeof (_T3)); + Storage_ALLOCATE ((void **) &s, sizeof (pge__T3)); s->ident = NULL; s->expr = NULL; s->followinfo = NewFollow (); @@ -3987,11 +3988,11 @@ static StatementDesc NewStatement (void) NewSetDesc - creates a new set description and returns the data structure. */ -static SetDesc NewSetDesc (void) +static pge_SetDesc NewSetDesc (void) { - SetDesc s; + pge_SetDesc s; - Storage_ALLOCATE ((void **) &s, sizeof (_T7)); + Storage_ALLOCATE ((void **) &s, sizeof (pge__T7)); s->next = NULL; return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -4003,11 +4004,11 @@ static SetDesc NewSetDesc (void) NewCodeDesc - creates a new code descriptor and initializes all fields to zero. */ -static CodeDesc NewCodeDesc (void) +static pge_CodeDesc NewCodeDesc (void) { - CodeDesc c; + pge_CodeDesc c; - Storage_ALLOCATE ((void **) &c, sizeof (_T8)); + Storage_ALLOCATE ((void **) &c, sizeof (pge__T8)); c->code = NULL; c->indent = 0; c->line = PushBackInput_GetCurrentLine (); @@ -4054,7 +4055,7 @@ static void CodeFragmentDeclaration (void) GetCodeFragment - collects the code fragment up until ^ % */ -static void GetCodeFragment (CodeHunk *h) +static void GetCodeFragment (pge_CodeHunk *h) { unsigned int i; char ch; @@ -4104,7 +4105,7 @@ static void GetCodeFragment (CodeHunk *h) WriteCodeHunkList - writes the CodeHunk list in the correct order. */ -static void WriteCodeHunkList (CodeHunk l) +static void WriteCodeHunkList (pge_CodeHunk l) { if (l != NULL) { @@ -4200,7 +4201,7 @@ static void WriteStringIndent (const char *a_, unsigned int _a_high, unsigned in but it removes up to indent spaces if they exist. */ -static void WriteCodeHunkListIndent (CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext) +static void WriteCodeHunkListIndent (pge_CodeHunk l, unsigned int indent, unsigned int *curpos, unsigned int left, unsigned int *seentext) { if (l != NULL) { @@ -4215,13 +4216,13 @@ static void WriteCodeHunkListIndent (CodeHunk l, unsigned int indent, unsigned i Add - adds a character to a code hunk and creates another code hunk if necessary. */ -static CodeHunk Add (CodeHunk *p, char ch, unsigned int *i) +static pge_CodeHunk Add (pge_CodeHunk *p, char ch, unsigned int *i) { - CodeHunk q; + pge_CodeHunk q; if (((*p) == NULL) || ((*i) > MaxCodeHunkLength)) { - Storage_ALLOCATE ((void **) &q, sizeof (_T9)); + Storage_ALLOCATE ((void **) &q, sizeof (pge__T9)); q->next = (*p); q->codetext.array[0] = ch; (*i) = 1; @@ -4242,9 +4243,9 @@ static CodeHunk Add (CodeHunk *p, char ch, unsigned int *i) ConsHunk - combine two possible code hunks. */ -static void ConsHunk (CodeHunk *p, CodeHunk q) +static void ConsHunk (pge_CodeHunk *p, pge_CodeHunk q) { - CodeHunk r; + pge_CodeHunk r; if ((*p) != NULL) { @@ -4289,7 +4290,7 @@ static NameKey_Name GetName (void) a stop symbol. */ -static void SyntaxError (SetOfStop stop) +static void SyntaxError (pge_SetOfStop stop) { DescribeError (); if (Debugging) @@ -4314,7 +4315,7 @@ static void SyntaxError (SetOfStop stop) SyntaxCheck - */ -static void SyntaxCheck (SetOfStop stop) +static void SyntaxCheck (pge_SetOfStop stop) { if (! ((((1 << (bnflex_GetCurrentTokenType ()-bnflex_identtok)) & (stop)) != 0))) { @@ -4327,7 +4328,7 @@ static void SyntaxCheck (SetOfStop stop) Expect - */ -static void Expect (bnflex_TokenType t, SetOfStop stop) +static void Expect (bnflex_TokenType t, pge_SetOfStop stop) { if ((bnflex_GetCurrentTokenType ()) == t) { @@ -4345,11 +4346,11 @@ static void Expect (bnflex_TokenType t, SetOfStop stop) Ident - error checking varient of Ident */ -static void Ident (SetOfStop stop) +static void Ident (pge_SetOfStop stop) { if ((bnflex_GetCurrentTokenType ()) == bnflex_identtok) { - Storage_ALLOCATE ((void **) &CurrentIdent, sizeof (_T1)); + Storage_ALLOCATE ((void **) &CurrentIdent, sizeof (pge__T1)); CurrentIdent->definition = NULL; CurrentIdent->name = GetName (); CurrentIdent->line = PushBackInput_GetCurrentLine (); @@ -4361,9 +4362,9 @@ static void Ident (SetOfStop stop) Modula2Code - error checking varient of Modula2Code */ -static void Modula2Code (SetOfStop stop) +static void Modula2Code (pge_SetOfStop stop) { - CodeHunk p; + pge_CodeHunk p; unsigned int i; unsigned int quote; unsigned int line; @@ -4408,7 +4409,7 @@ static void Modula2Code (SetOfStop stop) } } p = Add (&p, ASCII_nul, &i); - CurrentFactor->type = m2; + CurrentFactor->type = pge_m2; CurrentFactor->code = NewCodeDesc (); CurrentFactor->code->code = p; CurrentFactor->code->indent = position; @@ -4426,7 +4427,7 @@ static void Modula2Code (SetOfStop stop) StartModName := % ModuleName := GetName() ; ignore begintok CodeFragmentPrologue % =: */ -static void StartModName (SetOfStop stop) +static void StartModName (pge_SetOfStop stop) { ModuleName = GetName (); CodeFragmentPrologue (); @@ -4437,7 +4438,7 @@ static void StartModName (SetOfStop stop) EndModName := */ -static void EndModName (SetOfStop stop) +static void EndModName (pge_SetOfStop stop) { if (ModuleName != (GetName ())) { @@ -4452,7 +4453,7 @@ static void EndModName (SetOfStop stop) DoDeclaration := % CodeFragmentDeclaration % =: */ -static void DoDeclaration (SetOfStop stop) +static void DoDeclaration (pge_SetOfStop stop) { if (ModuleName != (GetName ())) { @@ -4474,7 +4475,7 @@ static void DoDeclaration (SetOfStop stop) cannot reachend */ -static void CollectLiteral (SetOfStop stopset) +static void CollectLiteral (pge_SetOfStop stopset) { LastLiteral = bnflex_GetCurrentToken (); /* */ bnflex_AdvanceToken (); @@ -4504,10 +4505,10 @@ static void CollectLiteral (SetOfStop stopset) cannot reachend */ -static void CollectTok (SetOfStop stopset) +static void CollectTok (pge_SetOfStop stopset) { CurrentSetDesc = NewSetDesc (); /* */ - CurrentSetDesc->type = tokel; + CurrentSetDesc->type = pge_tokel; CurrentSetDesc->string = bnflex_GetCurrentToken (); if (! (SymbolKey_ContainsSymKey (Values, bnflex_GetCurrentToken ()))) { @@ -4536,7 +4537,7 @@ static void CollectTok (SetOfStop stopset) cannot reachend */ -static void DefineToken (SetOfStop stopset) +static void DefineToken (pge_SetOfStop stopset) { AddEntry (&Aliases, LastLiteral, bnflex_GetCurrentToken ()); /* */ AddEntry (&ReverseAliases, bnflex_GetCurrentToken (), LastLiteral); @@ -4555,13 +4556,13 @@ static void DefineToken (SetOfStop stopset) cannot reachend */ -static void Rules (SetOfStop stopset) +static void Rules (pge_SetOfStop stopset) { - Expect (bnflex_codetok, stopset|(SetOfStop) ((1 << (bnflex_rulestok-bnflex_identtok)))); - Expect (bnflex_rulestok, stopset|(SetOfStop) ((1 << (bnflex_symfunctok-bnflex_identtok)) | (1 << (bnflex_tfunctok-bnflex_identtok)) | (1 << (bnflex_errortok-bnflex_identtok)) | (1 << (bnflex_tokentok-bnflex_identtok)) | (1 << (bnflex_specialtok-bnflex_identtok)) | (1 << (bnflex_BNFtok-bnflex_identtok)))); + Expect (bnflex_codetok, stopset|(pge_SetOfStop) ((1 << (bnflex_rulestok-bnflex_identtok)))); + Expect (bnflex_rulestok, stopset|(pge_SetOfStop) ((1 << (bnflex_symfunctok-bnflex_identtok)) | (1 << (bnflex_tfunctok-bnflex_identtok)) | (1 << (bnflex_errortok-bnflex_identtok)) | (1 << (bnflex_tokentok-bnflex_identtok)) | (1 << (bnflex_specialtok-bnflex_identtok)) | (1 << (bnflex_BNFtok-bnflex_identtok)))); while ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_specialtok)) | (1 << (bnflex_tokentok)) | (1 << (bnflex_errortok)) | (1 << (bnflex_tfunctok)) | (1 << (bnflex_symfunctok))))) != 0)) { - Defs (stopset|(SetOfStop) ((1 << (bnflex_BNFtok-bnflex_identtok)) | (1 << (bnflex_specialtok-bnflex_identtok)) | (1 << (bnflex_tokentok-bnflex_identtok)) | (1 << (bnflex_errortok-bnflex_identtok)) | (1 << (bnflex_tfunctok-bnflex_identtok)) | (1 << (bnflex_symfunctok-bnflex_identtok)))); + Defs (stopset|(pge_SetOfStop) ((1 << (bnflex_BNFtok-bnflex_identtok)) | (1 << (bnflex_specialtok-bnflex_identtok)) | (1 << (bnflex_tokentok-bnflex_identtok)) | (1 << (bnflex_errortok-bnflex_identtok)) | (1 << (bnflex_tfunctok-bnflex_identtok)) | (1 << (bnflex_symfunctok-bnflex_identtok)))); } /* while */ ExtBNF (stopset); @@ -4598,31 +4599,31 @@ static void Rules (SetOfStop stopset) cannot reachend */ -static void Special (SetOfStop stopset) +static void Special (pge_SetOfStop stopset) { - ProductionDesc p; + pge_ProductionDesc p; - Ident (stopset|(SetOfStop) ((1 << (bnflex_firsttok-bnflex_identtok)))); + Ident (stopset|(pge_SetOfStop) ((1 << (bnflex_firsttok-bnflex_identtok)))); p = NewProduction (); p->statement = NewStatement (); p->statement->followinfo->calcfollow = TRUE; - p->statement->followinfo->epsilon = false_; - p->statement->followinfo->reachend = false_; + p->statement->followinfo->epsilon = pge_false; + p->statement->followinfo->reachend = pge_false; p->statement->ident = CurrentIdent; p->statement->expr = NULL; p->firstsolved = TRUE; p->followinfo->calcfollow = TRUE; - p->followinfo->epsilon = false_; - p->followinfo->reachend = false_; - First (stopset|(SetOfStop) ((1 << (bnflex_followtok-bnflex_identtok)))); - Follow (stopset|(SetOfStop) ((1 << (bnflex_epsilontok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + p->followinfo->epsilon = pge_false; + p->followinfo->reachend = pge_false; + First (stopset|(pge_SetOfStop) ((1 << (bnflex_followtok-bnflex_identtok)))); + Follow (stopset|(pge_SetOfStop) ((1 << (bnflex_epsilontok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); if ((bnflex_GetCurrentTokenType ()) == bnflex_epsilontok) { - Expect (bnflex_epsilontok, stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); - p->statement->followinfo->epsilon = true_; /* these are not used - but they are displayed when debugging */ - p->statement->followinfo->reachend = true_; /* these are not used - but they are displayed when debugging */ - p->followinfo->epsilon = true_; - p->followinfo->reachend = true_; + Expect (bnflex_epsilontok, stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + p->statement->followinfo->epsilon = pge_true; /* these are not used - but they are displayed when debugging */ + p->statement->followinfo->reachend = pge_true; /* these are not used - but they are displayed when debugging */ + p->followinfo->epsilon = pge_true; + p->followinfo->reachend = pge_true; } if ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_dquotetok)) | (1 << (bnflex_squotetok))))) != 0)) { @@ -4673,26 +4674,26 @@ static void Special (SetOfStop stopset) cannot reachend */ -static void Factor (SetOfStop stopset) +static void Factor (pge_SetOfStop stopset) { if ((bnflex_GetCurrentTokenType ()) == bnflex_codetok) { Expect (bnflex_codetok, stopset); - Modula2Code (stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); + Modula2Code (stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); Expect (bnflex_codetok, stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_identtok) { /* avoid dangling else. */ Ident (stopset); - CurrentFactor->type = id; + CurrentFactor->type = pge_id; CurrentFactor->ident = CurrentIdent; } else if ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_dquotetok)) | (1 << (bnflex_squotetok))))) != 0)) { /* avoid dangling else. */ Literal (stopset); - CurrentFactor->type = lit; + CurrentFactor->type = pge_lit; CurrentFactor->string = LastLiteral; if ((SymbolKey_GetSymKey (Aliases, LastLiteral)) == NameKey_NulName) { @@ -4702,31 +4703,31 @@ static void Factor (SetOfStop stopset) else if ((bnflex_GetCurrentTokenType ()) == bnflex_lcparatok) { /* avoid dangling else. */ - Expect (bnflex_lcparatok, stopset|(SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); - CurrentFactor->type = mult; + Expect (bnflex_lcparatok, stopset|(pge_SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + CurrentFactor->type = pge_mult; CurrentFactor->expr = NewExpression (); CurrentExpression = CurrentFactor->expr; - Expression (stopset|(SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)))); + Expression (stopset|(pge_SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)))); Expect (bnflex_rcparatok, stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_lsparatok) { /* avoid dangling else. */ - Expect (bnflex_lsparatok, stopset|(SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); - CurrentFactor->type = opt; + Expect (bnflex_lsparatok, stopset|(pge_SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + CurrentFactor->type = pge_opt; CurrentFactor->expr = NewExpression (); CurrentExpression = CurrentFactor->expr; - Expression (stopset|(SetOfStop) ((1 << (bnflex_rsparatok-bnflex_identtok)))); + Expression (stopset|(pge_SetOfStop) ((1 << (bnflex_rsparatok-bnflex_identtok)))); Expect (bnflex_rsparatok, stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_lparatok) { /* avoid dangling else. */ - Expect (bnflex_lparatok, stopset|(SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); - CurrentFactor->type = sub; + Expect (bnflex_lparatok, stopset|(pge_SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + CurrentFactor->type = pge_sub; CurrentFactor->expr = NewExpression (); CurrentExpression = CurrentFactor->expr; - Expression (stopset|(SetOfStop) ((1 << (bnflex_rparatok-bnflex_identtok)))); + Expression (stopset|(pge_SetOfStop) ((1 << (bnflex_rparatok-bnflex_identtok)))); Expect (bnflex_rparatok, stopset); } else @@ -4776,14 +4777,14 @@ static void Factor (SetOfStop stopset) cannot reachend */ -static void Statement (SetOfStop stopset) +static void Statement (pge_SetOfStop stopset) { - IdentDesc i; - ProductionDesc p; - ExpressionDesc e; - StatementDesc s; + pge_IdentDesc i; + pge_ProductionDesc p; + pge_ExpressionDesc e; + pge_StatementDesc s; - Ident (stopset|(SetOfStop) ((1 << (bnflex_lbecomestok-bnflex_identtok)))); + Ident (stopset|(pge_SetOfStop) ((1 << (bnflex_lbecomestok-bnflex_identtok)))); p = FindDefinition (CurrentIdent->name); if (p == NULL) { @@ -4797,13 +4798,13 @@ static void Statement (SetOfStop stopset) } } i = CurrentIdent; - Expect (bnflex_lbecomestok, stopset|(SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_lbecomestok, stopset|(pge_SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); e = NewExpression (); CurrentExpression = e; s = NewStatement (); s->ident = i; s->expr = e; - Expression (stopset|(SetOfStop) ((1 << (bnflex_rbecomestok-bnflex_identtok)))); + Expression (stopset|(pge_SetOfStop) ((1 << (bnflex_rbecomestok-bnflex_identtok)))); p->statement = s; Expect (bnflex_rbecomestok, stopset); } @@ -4820,35 +4821,35 @@ static void Statement (SetOfStop stopset) cannot reachend */ -static void Defs (SetOfStop stopset) +static void Defs (pge_SetOfStop stopset) { if ((bnflex_GetCurrentTokenType ()) == bnflex_specialtok) { - Expect (bnflex_specialtok, stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + Expect (bnflex_specialtok, stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); Special (stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_tokentok) { /* avoid dangling else. */ - Expect (bnflex_tokentok, stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_tokentok, stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); Token (stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_errortok) { /* avoid dangling else. */ - Expect (bnflex_errortok, stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_errortok, stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); ErrorProcedures (stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_tfunctok) { /* avoid dangling else. */ - Expect (bnflex_tfunctok, stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_tfunctok, stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); TokenProcedure (stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_symfunctok) { /* avoid dangling else. */ - Expect (bnflex_symfunctok, stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_symfunctok, stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); SymProcedure (stopset); } else @@ -4867,12 +4868,12 @@ static void Defs (SetOfStop stopset) cannot reachend */ -static void ExtBNF (SetOfStop stopset) +static void ExtBNF (pge_SetOfStop stopset) { - Expect (bnflex_BNFtok, stopset|(SetOfStop) ((1 << (bnflex_FNBtok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)))); + Expect (bnflex_BNFtok, stopset|(pge_SetOfStop) ((1 << (bnflex_FNBtok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)))); while ((bnflex_GetCurrentTokenType ()) == bnflex_identtok) { - Production (stopset|(SetOfStop) ((1 << (bnflex_FNBtok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)))); + Production (stopset|(pge_SetOfStop) ((1 << (bnflex_FNBtok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)))); } /* while */ Expect (bnflex_FNBtok, stopset); @@ -4887,11 +4888,11 @@ static void ExtBNF (SetOfStop stopset) cannot reachend */ -static void Main (SetOfStop stopset) +static void Main (pge_SetOfStop stopset) { - Header (stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); - Decls (stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); - Footer (stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); + Header (stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); + Decls (stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); + Footer (stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)))); Rules (stopset); } @@ -4904,10 +4905,10 @@ static void Main (SetOfStop stopset) cannot reachend */ -static void Header (SetOfStop stopset) +static void Header (pge_SetOfStop stopset) { - Expect (bnflex_codetok, stopset|(SetOfStop) ((1 << (bnflex_moduletok-bnflex_identtok)))); - Expect (bnflex_moduletok, stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + Expect (bnflex_codetok, stopset|(pge_SetOfStop) ((1 << (bnflex_moduletok-bnflex_identtok)))); + Expect (bnflex_moduletok, stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); StartModName (stopset); } @@ -4920,10 +4921,10 @@ static void Header (SetOfStop stopset) cannot reachend */ -static void Decls (SetOfStop stopset) +static void Decls (pge_SetOfStop stopset) { - Expect (bnflex_codetok, stopset|(SetOfStop) ((1 << (bnflex_declarationtok-bnflex_identtok)))); - Expect (bnflex_declarationtok, stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + Expect (bnflex_codetok, stopset|(pge_SetOfStop) ((1 << (bnflex_declarationtok-bnflex_identtok)))); + Expect (bnflex_declarationtok, stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); DoDeclaration (stopset); } @@ -4936,10 +4937,10 @@ static void Decls (SetOfStop stopset) cannot reachend */ -static void Footer (SetOfStop stopset) +static void Footer (pge_SetOfStop stopset) { - Expect (bnflex_codetok, stopset|(SetOfStop) ((1 << (bnflex_moduletok-bnflex_identtok)))); - Expect (bnflex_moduletok, stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + Expect (bnflex_codetok, stopset|(pge_SetOfStop) ((1 << (bnflex_moduletok-bnflex_identtok)))); + Expect (bnflex_moduletok, stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); EndModName (stopset); } @@ -4958,13 +4959,13 @@ static void Footer (SetOfStop stopset) cannot reachend */ -static void First (SetOfStop stopset) +static void First (pge_SetOfStop stopset) { - Expect (bnflex_firsttok, stopset|(SetOfStop) ((1 << (bnflex_lcparatok-bnflex_identtok)))); - Expect (bnflex_lcparatok, stopset|(SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_firsttok, stopset|(pge_SetOfStop) ((1 << (bnflex_lcparatok-bnflex_identtok)))); + Expect (bnflex_lcparatok, stopset|(pge_SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); while ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_lesstok)) | (1 << (bnflex_identtok)) | (1 << (bnflex_squotetok)) | (1 << (bnflex_dquotetok))))) != 0)) { - LitOrTokenOrIdent (stopset|(SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + LitOrTokenOrIdent (stopset|(pge_SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); CurrentSetDesc->next = TailProduction->first; TailProduction->first = CurrentSetDesc; } @@ -4987,13 +4988,13 @@ static void First (SetOfStop stopset) cannot reachend */ -static void Follow (SetOfStop stopset) +static void Follow (pge_SetOfStop stopset) { - Expect (bnflex_followtok, stopset|(SetOfStop) ((1 << (bnflex_lcparatok-bnflex_identtok)))); - Expect (bnflex_lcparatok, stopset|(SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_followtok, stopset|(pge_SetOfStop) ((1 << (bnflex_lcparatok-bnflex_identtok)))); + Expect (bnflex_lcparatok, stopset|(pge_SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); while ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_lesstok)) | (1 << (bnflex_identtok)) | (1 << (bnflex_squotetok)) | (1 << (bnflex_dquotetok))))) != 0)) { - LitOrTokenOrIdent (stopset|(SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + LitOrTokenOrIdent (stopset|(pge_SetOfStop) ((1 << (bnflex_rcparatok-bnflex_identtok)) | (1 << (bnflex_lesstok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); CurrentSetDesc->next = TailProduction->followinfo->follow; TailProduction->followinfo->follow = CurrentSetDesc; } @@ -5025,20 +5026,20 @@ static void Follow (SetOfStop stopset) cannot reachend */ -static void LitOrTokenOrIdent (SetOfStop stopset) +static void LitOrTokenOrIdent (pge_SetOfStop stopset) { if ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_dquotetok)) | (1 << (bnflex_squotetok))))) != 0)) { Literal (stopset); CurrentSetDesc = NewSetDesc (); - CurrentSetDesc->type = litel; + CurrentSetDesc->type = pge_litel; CurrentSetDesc->string = LastLiteral; } else if ((bnflex_GetCurrentTokenType ()) == bnflex_lesstok) { /* avoid dangling else. */ - Expect (bnflex_lesstok, stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); - CollectTok (stopset|(SetOfStop) ((1 << (bnflex_gretok-bnflex_identtok)))); + Expect (bnflex_lesstok, stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + CollectTok (stopset|(pge_SetOfStop) ((1 << (bnflex_gretok-bnflex_identtok)))); Expect (bnflex_gretok, stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_identtok) @@ -5046,7 +5047,7 @@ static void LitOrTokenOrIdent (SetOfStop stopset) /* avoid dangling else. */ Ident (stopset); CurrentSetDesc = NewSetDesc (); - CurrentSetDesc->type = idel; + CurrentSetDesc->type = pge_idel; CurrentSetDesc->ident = CurrentIdent; } else @@ -5066,19 +5067,19 @@ static void LitOrTokenOrIdent (SetOfStop stopset) cannot reachend */ -static void Literal (SetOfStop stopset) +static void Literal (pge_SetOfStop stopset) { if ((bnflex_GetCurrentTokenType ()) == bnflex_dquotetok) { - Expect (bnflex_dquotetok, stopset|(SetOfStop) ((1 << (bnflex_literaltok-bnflex_identtok)))); - CollectLiteral (stopset|(SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)))); + Expect (bnflex_dquotetok, stopset|(pge_SetOfStop) ((1 << (bnflex_literaltok-bnflex_identtok)))); + CollectLiteral (stopset|(pge_SetOfStop) ((1 << (bnflex_dquotetok-bnflex_identtok)))); Expect (bnflex_dquotetok, stopset); } else if ((bnflex_GetCurrentTokenType ()) == bnflex_squotetok) { /* avoid dangling else. */ - Expect (bnflex_squotetok, stopset|(SetOfStop) ((1 << (bnflex_literaltok-bnflex_identtok)))); - CollectLiteral (stopset|(SetOfStop) ((1 << (bnflex_squotetok-bnflex_identtok)))); + Expect (bnflex_squotetok, stopset|(pge_SetOfStop) ((1 << (bnflex_literaltok-bnflex_identtok)))); + CollectLiteral (stopset|(pge_SetOfStop) ((1 << (bnflex_squotetok-bnflex_identtok)))); Expect (bnflex_squotetok, stopset); } else @@ -5097,9 +5098,9 @@ static void Literal (SetOfStop stopset) cannot reachend */ -static void Token (SetOfStop stopset) +static void Token (pge_SetOfStop stopset) { - Literal (stopset|(SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); + Literal (stopset|(pge_SetOfStop) ((1 << (bnflex_identtok-bnflex_identtok)))); DefineToken (stopset); } @@ -5116,9 +5117,9 @@ static void Token (SetOfStop stopset) cannot reachend */ -static void ErrorProcedures (SetOfStop stopset) +static void ErrorProcedures (pge_SetOfStop stopset) { - Literal (stopset|(SetOfStop) ((1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + Literal (stopset|(pge_SetOfStop) ((1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); ErrorProcArray = LastLiteral; Literal (stopset); ErrorProcString = LastLiteral; @@ -5135,7 +5136,7 @@ static void ErrorProcedures (SetOfStop stopset) cannot reachend */ -static void TokenProcedure (SetOfStop stopset) +static void TokenProcedure (pge_SetOfStop stopset) { Literal (stopset); TokenTypeProc = LastLiteral; @@ -5152,7 +5153,7 @@ static void TokenProcedure (SetOfStop stopset) cannot reachend */ -static void SymProcedure (SetOfStop stopset) +static void SymProcedure (pge_SetOfStop stopset) { Literal (stopset); SymIsProc = LastLiteral; @@ -5167,7 +5168,7 @@ static void SymProcedure (SetOfStop stopset) cannot reachend */ -static void Production (SetOfStop stopset) +static void Production (pge_SetOfStop stopset) { Statement (stopset); } @@ -5196,23 +5197,23 @@ static void Production (SetOfStop stopset) cannot reachend */ -static void Expression (SetOfStop stopset) +static void Expression (pge_SetOfStop stopset) { - TermDesc t1; - TermDesc t2; - ExpressionDesc e; + pge_TermDesc t1; + pge_TermDesc t2; + pge_ExpressionDesc e; e = CurrentExpression; t1 = NewTerm (); CurrentTerm = t1; - Term (stopset|(SetOfStop) ((1 << (bnflex_bartok-bnflex_identtok)))); + Term (stopset|(pge_SetOfStop) ((1 << (bnflex_bartok-bnflex_identtok)))); e->term = t1; while ((bnflex_GetCurrentTokenType ()) == bnflex_bartok) { - Expect (bnflex_bartok, stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + Expect (bnflex_bartok, stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); t2 = NewTerm (); CurrentTerm = t2; - Term (stopset|(SetOfStop) ((1 << (bnflex_bartok-bnflex_identtok)))); + Term (stopset|(pge_SetOfStop) ((1 << (bnflex_bartok-bnflex_identtok)))); t1->next = t2; t1 = t2; } @@ -5243,22 +5244,22 @@ static void Expression (SetOfStop stopset) cannot reachend */ -static void Term (SetOfStop stopset) +static void Term (pge_SetOfStop stopset) { - TermDesc t1; - FactorDesc f1; - FactorDesc f2; + pge_TermDesc t1; + pge_FactorDesc f1; + pge_FactorDesc f2; CurrentFactor = NewFactor (); f1 = CurrentFactor; t1 = CurrentTerm; - Factor (stopset|(SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); + Factor (stopset|(pge_SetOfStop) ((1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)))); t1->factor = f1; f2 = NewFactor (); CurrentFactor = f2; while ((((1 << (bnflex_GetCurrentTokenType ())) & ((unsigned int) ((1 << (bnflex_codetok)) | (1 << (bnflex_identtok)) | (1 << (bnflex_lcparatok)) | (1 << (bnflex_lsparatok)) | (1 << (bnflex_lparatok)) | (1 << (bnflex_squotetok)) | (1 << (bnflex_dquotetok))))) != 0)) { - Factor (stopset|(SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); + Factor (stopset|(pge_SetOfStop) ((1 << (bnflex_codetok-bnflex_identtok)) | (1 << (bnflex_identtok-bnflex_identtok)) | (1 << (bnflex_lcparatok-bnflex_identtok)) | (1 << (bnflex_lsparatok-bnflex_identtok)) | (1 << (bnflex_lparatok-bnflex_identtok)) | (1 << (bnflex_squotetok-bnflex_identtok)) | (1 << (bnflex_dquotetok-bnflex_identtok)))); f1->next = f2; f1 = f2; f2 = NewFactor (); @@ -5272,7 +5273,7 @@ static void Term (SetOfStop stopset) GetDefinitionName - returns the name of the rule inside, p. */ -static NameKey_Name GetDefinitionName (ProductionDesc p) +static NameKey_Name GetDefinitionName (pge_ProductionDesc p) { if (p != NULL) { @@ -5291,10 +5292,10 @@ static NameKey_Name GetDefinitionName (ProductionDesc p) FindDefinition - searches and returns the rule which defines, n. */ -static ProductionDesc FindDefinition (NameKey_Name n) +static pge_ProductionDesc FindDefinition (NameKey_Name n) { - ProductionDesc p; - ProductionDesc f; + pge_ProductionDesc p; + pge_ProductionDesc f; p = HeadProduction; f = NULL; @@ -5327,7 +5328,7 @@ static ProductionDesc FindDefinition (NameKey_Name n) set the definition accordingly. */ -static void BackPatchIdent (IdentDesc i) +static void BackPatchIdent (pge_IdentDesc i) { if (i != NULL) { @@ -5345,19 +5346,19 @@ static void BackPatchIdent (IdentDesc i) BackPatchFactor - runs through the factor looking for an ident */ -static void BackPatchFactor (FactorDesc f) +static void BackPatchFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: BackPatchIdent (f->ident); break; - case sub: - case opt: - case mult: + case pge_sub: + case pge_opt: + case pge_mult: BackPatchExpression (f->expr); break; @@ -5374,7 +5375,7 @@ static void BackPatchFactor (FactorDesc f) BackPatchTerm - runs through all terms to find idents. */ -static void BackPatchTerm (TermDesc t) +static void BackPatchTerm (pge_TermDesc t) { while (t != NULL) { @@ -5388,7 +5389,7 @@ static void BackPatchTerm (TermDesc t) BackPatchExpression - runs through the term to find any idents. */ -static void BackPatchExpression (ExpressionDesc e) +static void BackPatchExpression (pge_ExpressionDesc e) { if (e != NULL) { @@ -5401,13 +5402,13 @@ static void BackPatchExpression (ExpressionDesc e) BackPatchSet - */ -static void BackPatchSet (SetDesc s) +static void BackPatchSet (pge_SetDesc s) { while (s != NULL) { switch (s->type) { - case idel: + case pge_idel: BackPatchIdent (s->ident); break; @@ -5425,7 +5426,7 @@ static void BackPatchSet (SetDesc s) to the definition. */ -static void BackPatchIdentToDefinitions (ProductionDesc d) +static void BackPatchIdentToDefinitions (pge_ProductionDesc d) { if ((d != NULL) && (d->statement != NULL)) { @@ -5438,7 +5439,7 @@ static void BackPatchIdentToDefinitions (ProductionDesc d) CalculateFirstAndFollow - */ -static void CalculateFirstAndFollow (ProductionDesc p) +static void CalculateFirstAndFollow (pge_ProductionDesc p) { if (Debugging) { @@ -5465,7 +5466,7 @@ static void CalculateFirstAndFollow (ProductionDesc p) ForeachRuleDo - */ -static void ForeachRuleDo (DoProcedure p) +static void ForeachRuleDo (pge_DoProcedure p) { CurrentProduction = HeadProduction; while (CurrentProduction != NULL) @@ -5480,7 +5481,7 @@ static void ForeachRuleDo (DoProcedure p) WhileNotCompleteDo - */ -static void WhileNotCompleteDo (DoProcedure p) +static void WhileNotCompleteDo (pge_DoProcedure p) { do { Finished = TRUE; @@ -5573,7 +5574,7 @@ static void KeyWord (NameKey_Name n) PrettyPara - */ -static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, ExpressionDesc e, unsigned int Left) +static void PrettyPara (const char *c1_, unsigned int _c1_high, const char *c2_, unsigned int _c2_high, pge_ExpressionDesc e, unsigned int Left) { char c1[_c1_high+1]; char c2[_c2_high+1]; @@ -5629,7 +5630,7 @@ static void WriteKeyTexinfo (NameKey_Name s) PrettyCommentFactor - */ -static void PrettyCommentFactor (FactorDesc f, unsigned int Left) +static void PrettyCommentFactor (pge_FactorDesc f, unsigned int Left) { unsigned int curpos; unsigned int seentext; @@ -5639,13 +5640,13 @@ static void PrettyCommentFactor (FactorDesc f, unsigned int Left) CheckNewLine (Left); switch (f->type) { - case id: + case pge_id: Output_WriteKey (f->ident->name); Output_WriteString ((const char *) " ", 1); Indent += (NameKey_LengthKey (f->ident->name))+1; break; - case lit: + case pge_lit: if ((NameKey_MakeKey ((const char *) "'", 1)) == f->string) { Output_Write ('"'); @@ -5661,15 +5662,15 @@ static void PrettyCommentFactor (FactorDesc f, unsigned int Left) Indent += (NameKey_LengthKey (f->string))+3; break; - case sub: + case pge_sub: PrettyPara ((const char *) "( ", 2, (const char *) " ) ", 3, f->expr, Left); break; - case opt: + case pge_opt: PrettyPara ((const char *) "[ ", 2, (const char *) " ] ", 3, f->expr, Left); break; - case mult: + case pge_mult: if (Texinfo) { PrettyPara ((const char *) "@{ ", 3, (const char *) " @} ", 4, f->expr, Left); @@ -5680,7 +5681,7 @@ static void PrettyCommentFactor (FactorDesc f, unsigned int Left) } break; - case m2: + case pge_m2: if (EmitCode) { NewLine (Left); @@ -5707,7 +5708,7 @@ static void PrettyCommentFactor (FactorDesc f, unsigned int Left) PeepTerm - returns the length of characters in term. */ -static unsigned int PeepTerm (TermDesc t) +static unsigned int PeepTerm (pge_TermDesc t) { unsigned int l; @@ -5731,7 +5732,7 @@ static unsigned int PeepTerm (TermDesc t) PeepExpression - returns the length of the expression. */ -static unsigned int PeepExpression (ExpressionDesc e) +static unsigned int PeepExpression (pge_ExpressionDesc e) { if (e == NULL) { @@ -5750,7 +5751,7 @@ static unsigned int PeepExpression (ExpressionDesc e) PeepFactor - returns the length of character in the factor */ -static unsigned int PeepFactor (FactorDesc f) +static unsigned int PeepFactor (pge_FactorDesc f) { unsigned int l; @@ -5759,21 +5760,21 @@ static unsigned int PeepFactor (FactorDesc f) { switch (f->type) { - case id: + case pge_id: l += (NameKey_LengthKey (f->ident->name))+1; break; - case lit: + case pge_lit: l += (NameKey_LengthKey (f->string))+3; break; - case opt: - case mult: - case sub: + case pge_opt: + case pge_mult: + case pge_sub: l += PeepExpression (f->expr); break; - case m2: + case pge_m2: break; @@ -5792,7 +5793,7 @@ static unsigned int PeepFactor (FactorDesc f) PrettyCommentTerm - */ -static void PrettyCommentTerm (TermDesc t, unsigned int Left) +static void PrettyCommentTerm (pge_TermDesc t, unsigned int Left) { while (t != NULL) { @@ -5817,7 +5818,7 @@ static void PrettyCommentTerm (TermDesc t, unsigned int Left) PrettyCommentExpression - */ -static void PrettyCommentExpression (ExpressionDesc e, unsigned int Left) +static void PrettyCommentExpression (pge_ExpressionDesc e, unsigned int Left) { if (e != NULL) { @@ -5831,7 +5832,7 @@ static void PrettyCommentExpression (ExpressionDesc e, unsigned int Left) PrettyCommentStatement - */ -static void PrettyCommentStatement (StatementDesc s, unsigned int Left) +static void PrettyCommentStatement (pge_StatementDesc s, unsigned int Left) { if (s != NULL) { @@ -5845,9 +5846,9 @@ static void PrettyCommentStatement (StatementDesc s, unsigned int Left) PrettyCommentProduction - generates the comment for rule, p. */ -static void PrettyCommentProduction (ProductionDesc p) +static void PrettyCommentProduction (pge_ProductionDesc p) { - SetDesc to; + pge_SetDesc to; if (p != NULL) { @@ -5870,15 +5871,15 @@ static void PrettyCommentProduction (ProductionDesc p) NewLine (3); switch (GetReachEnd (p->followinfo)) { - case true_: + case pge_true: Output_WriteString ((const char *) "reachend", 8); break; - case false_: + case pge_false: Output_WriteString ((const char *) "cannot reachend", 15); break; - case unknown: + case pge_unknown: Output_WriteString ((const char *) "unknown...", 10); break; @@ -5898,9 +5899,9 @@ static void PrettyCommentProduction (ProductionDesc p) PrettyPrintProduction - pretty prints the ebnf rule, p. */ -static void PrettyPrintProduction (ProductionDesc p) +static void PrettyPrintProduction (pge_ProductionDesc p) { - SetDesc to; + pge_SetDesc to; if (p != NULL) { @@ -5911,6 +5912,12 @@ static void PrettyPrintProduction (ProductionDesc p) Output_WriteString ((const char *) "@example", 8); NewLine (0); } + else if (Sphinx) + { + /* avoid dangling else. */ + Output_WriteString ((const char *) ".. code-block:: ebnf", 20); + NewLine (0); + } Output_WriteKey (GetDefinitionName (p)); Output_WriteString ((const char *) " := ", 4); Indent += (NameKey_LengthKey (GetDefinitionName (p)))+4; @@ -5932,6 +5939,16 @@ static void PrettyPrintProduction (ProductionDesc p) Output_WriteString ((const char *) "@end example", 12); NewLine (0); } + else if (Sphinx) + { + /* avoid dangling else. */ + Output_WriteString ((const char *) ".. index::", 10); + NewLine (0); + Output_WriteString ((const char *) " pair: ", 8); + Output_WriteKey (GetDefinitionName (p)); + Output_WriteString ((const char *) "; (ebnf)", 8); + NewLine (0); + } NewLine (0); } } @@ -5965,7 +5982,7 @@ static void EmitFileLineTag (unsigned int line) EmitRule - generates a comment and code for rule, p. */ -static void EmitRule (ProductionDesc p) +static void EmitRule (pge_ProductionDesc p) { if (PrettyPrint) { @@ -5990,26 +6007,26 @@ static void EmitRule (ProductionDesc p) CodeCondition - */ -static void CodeCondition (m2condition m) +static void CodeCondition (pge_m2condition m) { switch (m) { - case m2if: - case m2none: + case pge_m2if: + case pge_m2none: IndentString ((const char *) "IF ", 3); break; - case m2elsif: + case pge_m2elsif: IndentString ((const char *) "ELSIF ", 6); break; - case m2while: + case pge_m2while: IndentString ((const char *) "WHILE ", 6); break; default: - Debug_Halt ((const char *) "unrecognised m2condition", 24, 2672, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unrecognised m2condition", 24, 2680, (const char *) "m2/gm2-auto/pge.mod", 19); break; } } @@ -6019,13 +6036,13 @@ static void CodeCondition (m2condition m) CodeThenDo - codes a "THEN" or "DO" depending upon, m. */ -static void CodeThenDo (m2condition m) +static void CodeThenDo (pge_m2condition m) { switch (m) { - case m2if: - case m2none: - case m2elsif: + case pge_m2if: + case pge_m2none: + case pge_m2elsif: if (LastLineNo == 0) { Output_WriteLn (); @@ -6034,14 +6051,14 @@ static void CodeThenDo (m2condition m) Output_WriteLn (); break; - case m2while: + case pge_m2while: Output_WriteString ((const char *) " DO", 3); Output_WriteLn (); break; default: - Debug_Halt ((const char *) "unrecognised m2condition", 24, 2697, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unrecognised m2condition", 24, 2705, (const char *) "m2/gm2-auto/pge.mod", 19); break; } OnLineStart = TRUE; @@ -6052,7 +6069,7 @@ static void CodeThenDo (m2condition m) CodeElseEnd - builds an ELSE END statement using string, end. */ -static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, FactorDesc f, unsigned int inopt) +static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int consumed, pge_FactorDesc f, unsigned int inopt) { char end[_end_high+1]; @@ -6074,14 +6091,14 @@ static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int Output_Write ('('); switch (f->type) { - case id: + case pge_id: Output_Write ('\''); Output_WriteKey (f->ident->name); Output_WriteString ((const char *) " - expected", 11); Output_WriteString ((const char *) "') ;", 4); break; - case lit: + case pge_lit: if ((NameKey_MakeKey ((const char *) "'", 1)) == f->string) { Output_Write ('"'); @@ -6128,41 +6145,41 @@ static void CodeElseEnd (const char *end_, unsigned int _end_high, unsigned int CodeEnd - codes a "END" depending upon, m. */ -static void CodeEnd (m2condition m, TermDesc t, unsigned int consumed, FactorDesc f, unsigned int inopt) +static void CodeEnd (pge_m2condition m, pge_TermDesc t, unsigned int consumed, pge_FactorDesc f, unsigned int inopt) { Indent -= 3; Output_WriteLn (); OnLineStart = TRUE; switch (m) { - case m2none: + case pge_m2none: if (t == NULL) { CodeElseEnd ((const char *) "END ;", 5, consumed, f, inopt); } break; - case m2if: + case pge_m2if: if (t == NULL) { CodeElseEnd ((const char *) "END ; (* if *)", 15, consumed, f, inopt); } break; - case m2elsif: + case pge_m2elsif: if (t == NULL) { CodeElseEnd ((const char *) "END ; (* elsif *)", 18, consumed, f, inopt); } break; - case m2while: + case pge_m2while: IndentString ((const char *) "END ; (* while *)", 18); break; default: - Debug_Halt ((const char *) "unrecognised m2condition", 24, 2780, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unrecognised m2condition", 24, 2788, (const char *) "m2/gm2-auto/pge.mod", 19); break; } OnLineStart = FALSE; @@ -6173,10 +6190,10 @@ static void CodeEnd (m2condition m, TermDesc t, unsigned int consumed, FactorDes EmitNonVarCode - writes out, code, providing it is not a variable declaration. */ -static void EmitNonVarCode (CodeDesc code, unsigned int curpos, unsigned int left) +static void EmitNonVarCode (pge_CodeDesc code, unsigned int curpos, unsigned int left) { unsigned int i; - CodeHunk t; + pge_CodeHunk t; unsigned int seentext; t = code->code; @@ -6198,9 +6215,9 @@ static void EmitNonVarCode (CodeDesc code, unsigned int curpos, unsigned int lef ChainOn - */ -static FactorDesc ChainOn (FactorDesc codeStack, FactorDesc f) +static pge_FactorDesc ChainOn (pge_FactorDesc codeStack, pge_FactorDesc f) { - FactorDesc s; + pge_FactorDesc s; f->pushed = NULL; if (codeStack == NULL) @@ -6226,7 +6243,7 @@ static FactorDesc ChainOn (FactorDesc codeStack, FactorDesc f) FlushCode - */ -static void FlushCode (FactorDesc *codeStack) +static void FlushCode (pge_FactorDesc *codeStack) { if ((*codeStack) != NULL) { @@ -6257,7 +6274,7 @@ static void FlushCode (FactorDesc *codeStack) CodeFactor - */ -static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack) +static void CodeFactor (pge_FactorDesc f, pge_TermDesc t, pge_m2condition l, pge_m2condition n, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack) { if (f == NULL) { @@ -6274,18 +6291,18 @@ static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, EmitFileLineTag (f->line); switch (f->type) { - case id: + case pge_id: FlushCode (&codeStack); CodeCondition (n); Output_WriteKey (f->ident->name); Output_WriteString ((const char *) "()", 2); CodeThenDo (n); Indent += 3; - CodeFactor (f->next, NULL, n, m2none, inopt, inwhile, TRUE, NULL); + CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, TRUE, NULL); CodeEnd (n, t, consumed, f, inopt); break; - case lit: + case pge_lit: FlushCode (&codeStack); CodeCondition (n); Output_WriteKey (SymIsProc); @@ -6294,42 +6311,42 @@ static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, Output_Write (')'); CodeThenDo (n); Indent += 3; - CodeFactor (f->next, NULL, n, m2none, inopt, inwhile, TRUE, NULL); + CodeFactor (f->next, NULL, n, pge_m2none, inopt, inwhile, TRUE, NULL); CodeEnd (n, t, consumed, f, inopt); break; - case sub: + case pge_sub: FlushCode (&codeStack); - CodeExpression (f->expr, m2none, inopt, inwhile, consumed, NULL); + CodeExpression (f->expr, pge_m2none, inopt, inwhile, consumed, NULL); if (f->next != NULL) { /* * the test above makes sure that we don't emit a RETURN( TRUE ) * after a subexpression. Remember sub expressions are not conditional */ - CodeFactor (f->next, t, n, m2none, inopt, inwhile, TRUE, NULL); + CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, TRUE, NULL); } break; - case opt: + case pge_opt: FlushCode (&codeStack); - CodeExpression (f->expr, m2if, TRUE, inwhile, FALSE, NULL); - CodeFactor (f->next, t, n, m2none, inopt, inwhile, consumed, NULL); + CodeExpression (f->expr, pge_m2if, TRUE, inwhile, FALSE, NULL); + CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, consumed, NULL); break; - case mult: + case pge_mult: FlushCode (&codeStack); - CodeExpression (f->expr, m2while, FALSE, TRUE, consumed, NULL); - CodeFactor (f->next, t, n, m2none, inopt, inwhile, consumed, NULL); + CodeExpression (f->expr, pge_m2while, FALSE, TRUE, consumed, NULL); + CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, consumed, NULL); break; - case m2: + case pge_m2: codeStack = ChainOn (codeStack, f); if (consumed || (f->next == NULL)) { FlushCode (&codeStack); } - CodeFactor (f->next, t, n, m2none, inopt, inwhile, consumed, codeStack); + CodeFactor (f->next, t, n, pge_m2none, inopt, inwhile, consumed, codeStack); break; @@ -6344,22 +6361,22 @@ static void CodeFactor (FactorDesc f, TermDesc t, m2condition l, m2condition n, CodeTerm - */ -static void CodeTerm (TermDesc t, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack) +static void CodeTerm (pge_TermDesc t, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack) { - m2condition l; + pge_m2condition l; l = m; while (t != NULL) { EmitFileLineTag (t->line); - if ((t->factor->type == m2) && (m == m2elsif)) + if ((t->factor->type == pge_m2) && (m == pge_m2elsif)) { - m = m2if; + m = pge_m2if; IndentString ((const char *) "ELSE", 4); Output_WriteLn (); OnLineStart = TRUE; Indent += 3; - CodeFactor (t->factor, t->next, m2none, m2none, inopt, inwhile, consumed, codeStack); + CodeFactor (t->factor, t->next, pge_m2none, pge_m2none, inopt, inwhile, consumed, codeStack); Indent -= 3; IndentString ((const char *) "END ;", 5); Output_WriteLn (); @@ -6367,12 +6384,12 @@ static void CodeTerm (TermDesc t, m2condition m, unsigned int inopt, unsigned in } else { - CodeFactor (t->factor, t->next, m2none, m, inopt, inwhile, consumed, codeStack); + CodeFactor (t->factor, t->next, pge_m2none, m, inopt, inwhile, consumed, codeStack); } l = m; if (t->next != NULL) { - m = m2elsif; + m = pge_m2elsif; } t = t->next; } @@ -6383,7 +6400,7 @@ static void CodeTerm (TermDesc t, m2condition m, unsigned int inopt, unsigned in CodeExpression - */ -static void CodeExpression (ExpressionDesc e, m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, FactorDesc codeStack) +static void CodeExpression (pge_ExpressionDesc e, pge_m2condition m, unsigned int inopt, unsigned int inwhile, unsigned int consumed, pge_FactorDesc codeStack) { if (e != NULL) { @@ -6397,7 +6414,7 @@ static void CodeExpression (ExpressionDesc e, m2condition m, unsigned int inopt, CodeStatement - */ -static void CodeStatement (StatementDesc s, m2condition m) +static void CodeStatement (pge_StatementDesc s, pge_m2condition m) { if (s != NULL) { @@ -6411,7 +6428,7 @@ static void CodeStatement (StatementDesc s, m2condition m) CodeProduction - only encode grammer rules which are not special. */ -static void CodeProduction (ProductionDesc p) +static void CodeProduction (pge_ProductionDesc p) { if ((p != NULL) && (! p->firstsolved || ((p->statement != NULL) && (p->statement->expr != NULL)))) { @@ -6431,7 +6448,7 @@ static void CodeProduction (ProductionDesc p) OnLineStart = FALSE; EmitFileLineTag (p->line); Indent = 3; - CodeStatement (p->statement, m2none); + CodeStatement (p->statement, pge_m2none); Output_WriteLn (); Indent = 0; IndentString ((const char *) "END ", 4); @@ -6448,29 +6465,29 @@ static void CodeProduction (ProductionDesc p) RecoverCondition - */ -static void RecoverCondition (m2condition m) +static void RecoverCondition (pge_m2condition m) { switch (m) { - case m2if: + case pge_m2if: IndentString ((const char *) "IF ", 3); break; - case m2none: + case pge_m2none: IndentString ((const char *) "IF ", 3); break; - case m2elsif: + case pge_m2elsif: IndentString ((const char *) "ELSIF ", 6); break; - case m2while: + case pge_m2while: IndentString ((const char *) "WHILE ", 6); break; default: - Debug_Halt ((const char *) "unrecognised m2condition", 24, 3037, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unrecognised m2condition", 24, 3045, (const char *) "m2/gm2-auto/pge.mod", 19); break; } } @@ -6480,29 +6497,29 @@ static void RecoverCondition (m2condition m) ConditionIndent - returns the number of spaces indentation created via, m. */ -static unsigned int ConditionIndent (m2condition m) +static unsigned int ConditionIndent (pge_m2condition m) { switch (m) { - case m2if: + case pge_m2if: return 3; break; - case m2none: + case pge_m2none: return 3; break; - case m2elsif: + case pge_m2elsif: return 6; break; - case m2while: + case pge_m2while: return 6; break; default: - Debug_Halt ((const char *) "unrecognised m2condition", 24, 3056, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unrecognised m2condition", 24, 3064, (const char *) "m2/gm2-auto/pge.mod", 19); break; } ReturnException ("m2/gm2-auto/pge.mod", 1, 7); @@ -6524,7 +6541,7 @@ static void WriteGetTokenType (void) NumberOfElements - returns the number of elements in set, to, which lie between low..high */ -static unsigned int NumberOfElements (SetDesc to, unsigned int low, unsigned int high) +static unsigned int NumberOfElements (pge_SetDesc to, unsigned int low, unsigned int high) { unsigned int n; @@ -6533,21 +6550,21 @@ static unsigned int NumberOfElements (SetDesc to, unsigned int low, unsigned int { switch (to->type) { - case tokel: + case pge_tokel: if ((high == 0) || (IsBetween (to->string, low, high))) { n += 1; } break; - case litel: + case pge_litel: if ((high == 0) || (IsBetween (SymbolKey_GetSymKey (Aliases, to->string), low, high))) { n += 1; } break; - case idel: + case pge_idel: PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40); WasNoError = FALSE; break; @@ -6580,7 +6597,7 @@ static void WriteElement (unsigned int e) EmitIsInSet - writes out the equivalent of GetTokenType() IN { toset } */ -static void EmitIsInSet (SetDesc to, NameKey_Name low, NameKey_Name high) +static void EmitIsInSet (pge_SetDesc to, NameKey_Name low, NameKey_Name high) { if ((NumberOfElements (to, low, high)) == 1) { @@ -6607,7 +6624,7 @@ static void EmitIsInSet (SetDesc to, NameKey_Name low, NameKey_Name high) EmitIsInSubSet - writes out a test to see whether GetTokenype() is in { subset } */ -static void EmitIsInSubSet (SetDesc to, unsigned int low, unsigned int high) +static void EmitIsInSubSet (pge_SetDesc to, unsigned int low, unsigned int high) { if ((NumberOfElements (to, low, high)) == 1) { @@ -6661,7 +6678,7 @@ static void EmitIsInSubSet (SetDesc to, unsigned int low, unsigned int high) EmitIsInFirst - */ -static void EmitIsInFirst (SetDesc to, m2condition m) +static void EmitIsInFirst (pge_SetDesc to, pge_m2condition m) { unsigned int i; unsigned int first; @@ -6705,7 +6722,7 @@ static void EmitIsInFirst (SetDesc to, m2condition m) } } -static void FlushRecoverCode (FactorDesc *codeStack) +static void FlushRecoverCode (pge_FactorDesc *codeStack) { /* FlushCode - @@ -6725,9 +6742,9 @@ static void FlushRecoverCode (FactorDesc *codeStack) RecoverFactor - */ -static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) +static void RecoverFactor (pge_FactorDesc f, pge_m2condition m, pge_FactorDesc codeStack) { - SetDesc to; + pge_SetDesc to; if (f == NULL) {} /* empty. */ @@ -6736,10 +6753,10 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) EmitFileLineTag (f->line); switch (f->type) { - case id: + case pge_id: to = NULL; CalcFirstFactor (f, NULL, &to); - if ((to != NULL) && (m != m2none)) + if ((to != NULL) && (m != pge_m2none)) { RecoverCondition (m); EmitIsInFirst (to, m); @@ -6753,15 +6770,15 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) EmitStopParametersAndFollow (f, m); Output_WriteString ((const char *) ") ;", 3); Output_WriteLn (); - RecoverFactor (f->next, m2none, codeStack); - if ((to != NULL) && (m != m2none)) + RecoverFactor (f->next, pge_m2none, codeStack); + if ((to != NULL) && (m != pge_m2none)) { Indent -= 3; } break; - case lit: - if (m == m2none) + case pge_lit: + if (m == pge_m2none) { FlushRecoverCode (&codeStack); IndentString ((const char *) "Expect(", 7); @@ -6770,7 +6787,7 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) EmitStopParametersAndFollow (f, m); Output_WriteString ((const char *) ") ;", 3); Output_WriteLn (); - RecoverFactor (f->next, m2none, codeStack); + RecoverFactor (f->next, pge_m2none, codeStack); } else { @@ -6787,18 +6804,18 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) Output_WriteString ((const char *) ") ;", 3); Output_WriteLn (); FlushRecoverCode (&codeStack); - RecoverFactor (f->next, m2none, codeStack); + RecoverFactor (f->next, pge_m2none, codeStack); Indent -= 3; } break; - case sub: + case pge_sub: FlushRecoverCode (&codeStack); - RecoverExpression (f->expr, m2none, m); - RecoverFactor (f->next, m2none, codeStack); + RecoverExpression (f->expr, pge_m2none, m); + RecoverFactor (f->next, pge_m2none, codeStack); break; - case opt: + case pge_opt: FlushRecoverCode (&codeStack); if (OptExpSeen (f)) { @@ -6811,7 +6828,7 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) IndentString ((const char *) "(* seen optional [ | ] expression *)", 36); Output_WriteLn (); stop (); - RecoverExpression (f->expr, m2none, m2if); + RecoverExpression (f->expr, pge_m2none, pge_m2if); IndentString ((const char *) "(* end of optional [ | ] expression *)", 38); Output_WriteLn (); Indent -= 3; @@ -6820,14 +6837,14 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) } else { - RecoverExpression (f->expr, m2if, m); + RecoverExpression (f->expr, pge_m2if, m); } - RecoverFactor (f->next, m2none, codeStack); + RecoverFactor (f->next, pge_m2none, codeStack); break; - case mult: + case pge_mult: FlushRecoverCode (&codeStack); - if (((OptExpSeen (f)) || (m == m2if)) || (m == m2elsif)) + if (((OptExpSeen (f)) || (m == pge_m2if)) || (m == pge_m2elsif)) { /* avoid dangling else. */ to = NULL; @@ -6838,18 +6855,18 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) Indent += 3; IndentString ((const char *) "(* seen optional { | } expression *)", 36); Output_WriteLn (); - RecoverCondition (m2while); - EmitIsInFirst (to, m2while); - CodeThenDo (m2while); + RecoverCondition (pge_m2while); + EmitIsInFirst (to, pge_m2while); + CodeThenDo (pge_m2while); Indent += 3; - RecoverExpression (f->expr, m2none, m2while); + RecoverExpression (f->expr, pge_m2none, pge_m2while); IndentString ((const char *) "(* end of optional { | } expression *)", 38); Output_WriteLn (); Indent -= 3; IndentString ((const char *) "END ;", 5); Output_WriteLn (); Indent -= 3; - if (m == m2none) + if (m == pge_m2none) { IndentString ((const char *) "END ;", 5); Output_WriteLn (); @@ -6858,12 +6875,12 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) } else { - RecoverExpression (f->expr, m2while, m); + RecoverExpression (f->expr, pge_m2while, m); } - RecoverFactor (f->next, m2none, codeStack); + RecoverFactor (f->next, pge_m2none, codeStack); break; - case m2: + case pge_m2: codeStack = ChainOn (codeStack, f); if (f->next == NULL) { @@ -6890,7 +6907,7 @@ static void RecoverFactor (FactorDesc f, m2condition m, FactorDesc codeStack) and FALSE in the first. */ -static unsigned int OptExpSeen (FactorDesc f) +static unsigned int OptExpSeen (pge_FactorDesc f) { if (f == NULL) { @@ -6900,21 +6917,21 @@ static unsigned int OptExpSeen (FactorDesc f) { switch (f->type) { - case id: - case lit: + case pge_id: + case pge_lit: return FALSE; break; - case sub: + case pge_sub: return FALSE; /* is this correct? */ break; - case opt: - case mult: + case pge_opt: + case pge_mult: return ((f->expr != NULL) && (f->expr->term != NULL)) && (f->expr->term->next != NULL); /* is this correct? */ break; - case m2: + case pge_m2: return TRUE; break; @@ -6934,31 +6951,31 @@ static unsigned int OptExpSeen (FactorDesc f) RecoverTerm - */ -static void RecoverTerm (TermDesc t, m2condition new_, m2condition old) +static void RecoverTerm (pge_TermDesc t, pge_m2condition new_, pge_m2condition old) { unsigned int LastWasM2Only; unsigned int alternative; - SetDesc to; + pge_SetDesc to; - LastWasM2Only = (t->factor->type == m2) && (t->factor->next == NULL); /* does the factor only contain inline code? */ + LastWasM2Only = (t->factor->type == pge_m2) && (t->factor->next == NULL); /* does the factor only contain inline code? */ to = NULL; CalcFirstTerm (t, NULL, &to); alternative = FALSE; if (t->next != NULL) { - new_ = m2if; + new_ = pge_m2if; } while (t != NULL) { EmitFileLineTag (t->line); - LastWasM2Only = (t->factor->type == m2) && (t->factor->next == NULL); - if ((t->factor->type == m2) && (new_ == m2elsif)) + LastWasM2Only = (t->factor->type == pge_m2) && (t->factor->next == NULL); + if ((t->factor->type == pge_m2) && (new_ == pge_m2elsif)) { - new_ = m2if; + new_ = pge_m2if; IndentString ((const char *) "ELSE", 4); Output_WriteLn (); Indent += 3; - RecoverFactor (t->factor, m2none, NULL); + RecoverFactor (t->factor, pge_m2none, NULL); alternative = FALSE; } else @@ -6967,14 +6984,14 @@ static void RecoverTerm (TermDesc t, m2condition new_, m2condition old) } if (t->next != NULL) { - new_ = m2elsif; + new_ = pge_m2elsif; alternative = TRUE; } t = t->next; } - if ((new_ == m2if) || (new_ == m2elsif)) + if ((new_ == pge_m2if) || (new_ == pge_m2elsif)) { - if (alternative && (old != m2while)) + if (alternative && (old != pge_m2while)) { IndentString ((const char *) "ELSE", 4); Output_WriteLn (); @@ -6995,7 +7012,7 @@ static void RecoverTerm (TermDesc t, m2condition new_, m2condition old) IndentString ((const char *) "END ;", 5); Output_WriteLn (); } - else if (new_ == m2while) + else if (new_ == pge_m2while) { /* avoid dangling else. */ IndentString ((const char *) "END (* while *) ;", 17); @@ -7013,7 +7030,7 @@ static void RecoverTerm (TermDesc t, m2condition new_, m2condition old) RecoverExpression - */ -static void RecoverExpression (ExpressionDesc e, m2condition new_, m2condition old) +static void RecoverExpression (pge_ExpressionDesc e, pge_m2condition new_, pge_m2condition old) { if (e != NULL) { @@ -7027,12 +7044,12 @@ static void RecoverExpression (ExpressionDesc e, m2condition new_, m2condition o RecoverStatement - */ -static void RecoverStatement (StatementDesc s, m2condition m) +static void RecoverStatement (pge_StatementDesc s, pge_m2condition m) { if (s != NULL) { EmitFileLineTag (s->line); - RecoverExpression (s->expr, m, m2none); + RecoverExpression (s->expr, m, pge_m2none); } } @@ -7041,7 +7058,7 @@ static void RecoverStatement (StatementDesc s, m2condition m) EmitFirstFactor - generate a list of all first tokens between the range: low..high. */ -static void EmitFirstFactor (FactorDesc f, unsigned int low, unsigned int high) +static void EmitFirstFactor (pge_FactorDesc f, unsigned int low, unsigned int high) { } @@ -7131,27 +7148,27 @@ static unsigned int IsBetween (NameKey_Name string, unsigned int low, unsigned i IsEmptySet - returns TRUE if no elements exist in set, to, with values, low..high. */ -static unsigned int IsEmptySet (SetDesc to, unsigned int low, unsigned int high) +static unsigned int IsEmptySet (pge_SetDesc to, unsigned int low, unsigned int high) { while (to != NULL) { switch (to->type) { - case tokel: + case pge_tokel: if (IsBetween (to->string, low, high)) { return FALSE; } break; - case litel: + case pge_litel: if (IsBetween (SymbolKey_GetSymKey (Aliases, to->string), low, high)) { return FALSE; } break; - case idel: + case pge_idel: PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40); WasNoError = FALSE; break; @@ -7174,7 +7191,7 @@ static unsigned int IsEmptySet (SetDesc to, unsigned int low, unsigned int high) EmitSet - emits the tokens in the set, to, which have values low..high */ -static void EmitSet (SetDesc to, unsigned int low, unsigned int high) +static void EmitSet (pge_SetDesc to, unsigned int low, unsigned int high) { unsigned int first; @@ -7183,7 +7200,7 @@ static void EmitSet (SetDesc to, unsigned int low, unsigned int high) { switch (to->type) { - case tokel: + case pge_tokel: if ((high == 0) || (IsBetween (to->string, low, high))) { if (! first) @@ -7195,7 +7212,7 @@ static void EmitSet (SetDesc to, unsigned int low, unsigned int high) } break; - case litel: + case pge_litel: if ((high == 0) || (IsBetween (SymbolKey_GetSymKey (Aliases, to->string), low, high))) { if (! first) @@ -7207,7 +7224,7 @@ static void EmitSet (SetDesc to, unsigned int low, unsigned int high) } break; - case idel: + case pge_idel: PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40); WasNoError = FALSE; break; @@ -7228,13 +7245,13 @@ static void EmitSet (SetDesc to, unsigned int low, unsigned int high) their names. */ -static void EmitSetName (SetDesc to, unsigned int low, unsigned int high) +static void EmitSetName (pge_SetDesc to, unsigned int low, unsigned int high) { while (to != NULL) { switch (to->type) { - case tokel: + case pge_tokel: if ((high == 0) || (IsBetween (to->string, low, high))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ @@ -7249,14 +7266,14 @@ static void EmitSetName (SetDesc to, unsigned int low, unsigned int high) } break; - case litel: + case pge_litel: if ((high == 0) || (IsBetween (SymbolKey_GetSymKey (Aliases, to->string), low, high))) { Output_WriteKey (to->string); } break; - case idel: + case pge_idel: PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40); WasNoError = FALSE; break; @@ -7281,7 +7298,7 @@ static void EmitSetName (SetDesc to, unsigned int low, unsigned int high) inclusion of all the symbols in set, to. */ -static void EmitStopParametersAndSet (SetDesc to) +static void EmitStopParametersAndSet (pge_SetDesc to) { unsigned int i; @@ -7327,7 +7344,7 @@ static void EmitStopParametersAndSet (SetDesc to) EmitSetAsParameters - generates the first symbols as parameters to a set function. */ -static void EmitSetAsParameters (SetDesc to) +static void EmitSetAsParameters (pge_SetDesc to) { unsigned int i; @@ -7359,9 +7376,9 @@ static void EmitSetAsParameters (SetDesc to) sentances. */ -static void EmitStopParametersAndFollow (FactorDesc f, m2condition m) +static void EmitStopParametersAndFollow (pge_FactorDesc f, pge_m2condition m) { - SetDesc to; + pge_SetDesc to; to = NULL; /* @@ -7389,9 +7406,9 @@ static void EmitStopParametersAndFollow (FactorDesc f, m2condition m) EmitFirstAsParameters - */ -static void EmitFirstAsParameters (FactorDesc f) +static void EmitFirstAsParameters (pge_FactorDesc f) { - SetDesc to; + pge_SetDesc to; to = NULL; CalcFirstFactor (f, NULL, &to); @@ -7404,7 +7421,7 @@ static void EmitFirstAsParameters (FactorDesc f) Generate error recovery code. */ -static void RecoverProduction (ProductionDesc p) +static void RecoverProduction (pge_ProductionDesc p) { DynamicStrings_String s; @@ -7431,7 +7448,7 @@ static void RecoverProduction (ProductionDesc p) OnLineStart = FALSE; EmitFileLineTag (p->line); Indent = 3; - RecoverStatement (p->statement, m2none); + RecoverStatement (p->statement, pge_m2none); Indent = 0; IndentString ((const char *) "END ", 4); Output_WriteKey (GetDefinitionName (p)); @@ -7462,11 +7479,11 @@ static unsigned int IsWhite (char ch) FindStr - returns TRUE if, str, was seen inside the code hunk */ -static unsigned int FindStr (CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high) +static unsigned int FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsigned int _str_high) { unsigned int j; unsigned int k; - CodeHunk t; + pge_CodeHunk t; char str[_str_high+1]; /* make a local copy of each unbounded array. */ @@ -7527,7 +7544,7 @@ static unsigned int FindStr (CodeHunk *code, unsigned int *i, const char *str_, WriteUpto - */ -static void WriteUpto (CodeHunk code, CodeHunk upto, unsigned int limit) +static void WriteUpto (pge_CodeHunk code, pge_CodeHunk upto, unsigned int limit) { if (code != upto) { @@ -7550,10 +7567,10 @@ static void WriteUpto (CodeHunk code, CodeHunk upto, unsigned int limit) this production. */ -static void CheckForVar (CodeHunk code) +static void CheckForVar (pge_CodeHunk code) { unsigned int i; - CodeHunk t; + pge_CodeHunk t; t = code; if ((FindStr (&t, &i, (const char *) "VAR", 3)) && EmitCode) @@ -7576,25 +7593,25 @@ static void CheckForVar (CodeHunk code) VarFactor - */ -static void VarFactor (FactorDesc f) +static void VarFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: break; - case lit: + case pge_lit: break; - case sub: - case opt: - case mult: + case pge_sub: + case pge_opt: + case pge_mult: VarExpression (f->expr); break; - case m2: + case pge_m2: CheckForVar (f->code->code); break; @@ -7611,7 +7628,7 @@ static void VarFactor (FactorDesc f) VarTerm - */ -static void VarTerm (TermDesc t) +static void VarTerm (pge_TermDesc t) { while (t != NULL) { @@ -7625,7 +7642,7 @@ static void VarTerm (TermDesc t) VarExpression - */ -static void VarExpression (ExpressionDesc e) +static void VarExpression (pge_ExpressionDesc e) { if (e != NULL) { @@ -7638,7 +7655,7 @@ static void VarExpression (ExpressionDesc e) VarStatement - */ -static void VarStatement (StatementDesc s) +static void VarStatement (pge_StatementDesc s) { if (s != NULL) { @@ -7651,7 +7668,7 @@ static void VarStatement (StatementDesc s) VarProduction - writes out all variable declarations. */ -static void VarProduction (ProductionDesc p) +static void VarProduction (pge_ProductionDesc p) { EmittedVar = FALSE; if (p != NULL) @@ -7665,21 +7682,21 @@ static void VarProduction (ProductionDesc p) In - returns TRUE if token, s, is already in the set, to. */ -static unsigned int In (SetDesc to, NameKey_Name s) +static unsigned int In (pge_SetDesc to, NameKey_Name s) { while (to != NULL) { switch (to->type) { - case idel: + case pge_idel: if (s == to->ident->name) { return TRUE; } break; - case tokel: - case litel: + case pge_tokel: + case pge_litel: if (s == to->string) { return TRUE; @@ -7705,21 +7722,21 @@ static unsigned int In (SetDesc to, NameKey_Name s) s1 * s2 = {} */ -static unsigned int IntersectionIsNil (SetDesc s1, SetDesc s2) +static unsigned int IntersectionIsNil (pge_SetDesc s1, pge_SetDesc s2) { while (s1 != NULL) { switch (s1->type) { - case idel: + case pge_idel: if (In (s2, s1->ident->name)) { return FALSE; } break; - case tokel: - case litel: + case pge_tokel: + case pge_litel: if (In (s2, s1->string)) { return FALSE; @@ -7744,14 +7761,14 @@ static unsigned int IntersectionIsNil (SetDesc s1, SetDesc s2) AddSet - adds a first symbol to a production. */ -static void AddSet (SetDesc *to, NameKey_Name s) +static void AddSet (pge_SetDesc *to, NameKey_Name s) { - SetDesc d; + pge_SetDesc d; if (! (In ((*to), s))) { d = NewSetDesc (); - d->type = tokel; + d->type = pge_tokel; d->string = s; d->next = (*to); (*to) = d; @@ -7764,28 +7781,28 @@ static void AddSet (SetDesc *to, NameKey_Name s) OrSet - */ -static void OrSet (SetDesc *to, SetDesc from) +static void OrSet (pge_SetDesc *to, pge_SetDesc from) { while (from != NULL) { switch (from->type) { - case tokel: + case pge_tokel: AddSet (to, from->string); break; - case litel: + case pge_litel: AddSet (to, SymbolKey_GetSymKey (Aliases, from->string)); break; - case idel: + case pge_idel: PushBackInput_WarnError ((const char *) "not expecting ident in first symbol list", 40); WasNoError = FALSE; break; default: - Debug_Halt ((const char *) "unknown element in enumeration type", 35, 4114, (const char *) "m2/gm2-auto/pge.mod", 19); + Debug_Halt ((const char *) "unknown element in enumeration type", 35, 4122, (const char *) "m2/gm2-auto/pge.mod", 19); break; } from = from->next; @@ -7797,13 +7814,13 @@ static void OrSet (SetDesc *to, SetDesc from) CalcFirstFactor - */ -static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to) +static void CalcFirstFactor (pge_FactorDesc f, pge_ProductionDesc from, pge_SetDesc *to) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: if (f->ident->definition == NULL) { WarnError1 ((const char *) "no rule found for an 'ident' called '%s'", 40, f->ident->name); @@ -7811,13 +7828,13 @@ static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to) __builtin_unreachable (); } OrSet (to, f->ident->definition->first); - if ((GetReachEnd (f->ident->definition->followinfo)) == false_) + if ((GetReachEnd (f->ident->definition->followinfo)) == pge_false) { return ; } break; - case lit: + case pge_lit: if ((SymbolKey_GetSymKey (Aliases, f->string)) == SymbolKey_NulKey) { WarnError1 ((const char *) "unknown token for '%s'", 22, f->string); @@ -7830,13 +7847,13 @@ static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to) return ; break; - case sub: - case opt: - case mult: + case pge_sub: + case pge_opt: + case pge_mult: CalcFirstExpression (f->expr, from, to); break; - case m2: + case pge_m2: break; @@ -7852,7 +7869,7 @@ static void CalcFirstFactor (FactorDesc f, ProductionDesc from, SetDesc *to) CalcFirstTerm - */ -static void CalcFirstTerm (TermDesc t, ProductionDesc from, SetDesc *to) +static void CalcFirstTerm (pge_TermDesc t, pge_ProductionDesc from, pge_SetDesc *to) { while (t != NULL) { @@ -7866,7 +7883,7 @@ static void CalcFirstTerm (TermDesc t, ProductionDesc from, SetDesc *to) CalcFirstExpression - */ -static void CalcFirstExpression (ExpressionDesc e, ProductionDesc from, SetDesc *to) +static void CalcFirstExpression (pge_ExpressionDesc e, pge_ProductionDesc from, pge_SetDesc *to) { if (e != NULL) { @@ -7879,7 +7896,7 @@ static void CalcFirstExpression (ExpressionDesc e, ProductionDesc from, SetDesc CalcFirstStatement - */ -static void CalcFirstStatement (StatementDesc s, ProductionDesc from, SetDesc *to) +static void CalcFirstStatement (pge_StatementDesc s, pge_ProductionDesc from, pge_SetDesc *to) { if (s != NULL) { @@ -7892,9 +7909,9 @@ static void CalcFirstStatement (StatementDesc s, ProductionDesc from, SetDesc *t CalcFirstProduction - calculates all of the first symbols for the grammer */ -static void CalcFirstProduction (ProductionDesc p, ProductionDesc from, SetDesc *to) +static void CalcFirstProduction (pge_ProductionDesc p, pge_ProductionDesc from, pge_SetDesc *to) { - SetDesc s; + pge_SetDesc s; if (p != NULL) { @@ -7906,12 +7923,12 @@ static void CalcFirstProduction (ProductionDesc p, ProductionDesc from, SetDesc { switch (s->type) { - case idel: + case pge_idel: CalcFirstProduction (s->ident->definition, from, to); break; - case tokel: - case litel: + case pge_tokel: + case pge_litel: AddSet (to, s->string); break; @@ -7929,21 +7946,21 @@ static void CalcFirstProduction (ProductionDesc p, ProductionDesc from, SetDesc } } -static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after) +static void WorkOutFollowFactor (pge_FactorDesc f, pge_SetDesc *followset, pge_SetDesc after) { - TraverseResult foundepsilon; - TraverseResult canreachend; + pge_TraverseResult foundepsilon; + pge_TraverseResult canreachend; /* WorkOutFollow - */ - foundepsilon = true_; - canreachend = true_; - while ((f != NULL) && (foundepsilon == true_)) + foundepsilon = pge_true; + canreachend = pge_true; + while ((f != NULL) && (foundepsilon == pge_true)) { switch (f->type) { - case id: + case pge_id: if (f->ident->definition == NULL) { WarnError1 ((const char *) "no rule found for an 'ident' called '%s'", 40, f->ident->name); @@ -7953,30 +7970,30 @@ static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after OrSet (followset, f->ident->definition->first); break; - case lit: + case pge_lit: AddSet (followset, SymbolKey_GetSymKey (Aliases, f->string)); break; - case sub: + case pge_sub: WorkOutFollowExpression (f->expr, followset, NULL); break; - case opt: + case pge_opt: WorkOutFollowExpression (f->expr, followset, NULL); break; - case mult: + case pge_mult: WorkOutFollowExpression (f->expr, followset, NULL); break; - case m2: + case pge_m2: break; default: break; } - if ((GetEpsilon (f->followinfo)) == unknown) + if ((GetEpsilon (f->followinfo)) == pge_unknown) { PushBackInput_WarnError ((const char *) "internal error: epsilon unknown", 31); PrettyCommentFactor (f, 3); @@ -7986,7 +8003,7 @@ static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after canreachend = GetReachEnd (f->followinfo); /* only goes from FALSE -> TRUE */ f = f->next; /* only goes from FALSE -> TRUE */ } - if (canreachend == true_) + if (canreachend == pge_true) { OrSet (followset, after); } @@ -7997,7 +8014,7 @@ static void WorkOutFollowFactor (FactorDesc f, SetDesc *followset, SetDesc after WorkOutFollowTerm - */ -static void WorkOutFollowTerm (TermDesc t, SetDesc *followset, SetDesc after) +static void WorkOutFollowTerm (pge_TermDesc t, pge_SetDesc *followset, pge_SetDesc after) { if (t != NULL) { @@ -8014,7 +8031,7 @@ static void WorkOutFollowTerm (TermDesc t, SetDesc *followset, SetDesc after) WorkOutFollowExpression - */ -static void WorkOutFollowExpression (ExpressionDesc e, SetDesc *followset, SetDesc after) +static void WorkOutFollowExpression (pge_ExpressionDesc e, pge_SetDesc *followset, pge_SetDesc after) { if (e != NULL) { @@ -8027,7 +8044,7 @@ static void WorkOutFollowExpression (ExpressionDesc e, SetDesc *followset, SetDe CollectFollow - collects the follow set from, f, into, to. */ -static void CollectFollow (SetDesc *to, FollowDesc f) +static void CollectFollow (pge_SetDesc *to, pge_FollowDesc f) { OrSet (to, f->follow); } @@ -8037,24 +8054,24 @@ static void CollectFollow (SetDesc *to, FollowDesc f) CalcFollowFactor - */ -static void CalcFollowFactor (FactorDesc f, SetDesc after) +static void CalcFollowFactor (pge_FactorDesc f, pge_SetDesc after) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: WorkOutFollowFactor (f->next, &f->followinfo->follow, after); break; - case lit: + case pge_lit: WorkOutFollowFactor (f->next, &f->followinfo->follow, after); break; - case opt: - case sub: + case pge_opt: + case pge_sub: CalcFirstFactor (f->next, NULL, &f->followinfo->follow); - if ((f->next == NULL) || ((GetReachEnd (f->next->followinfo)) == true_)) + if ((f->next == NULL) || ((GetReachEnd (f->next->followinfo)) == pge_true)) { OrSet (&f->followinfo->follow, after); CalcFollowExpression (f->expr, f->followinfo->follow); @@ -8065,7 +8082,7 @@ static void CalcFollowFactor (FactorDesc f, SetDesc after) } break; - case mult: + case pge_mult: CalcFirstFactor (f, NULL, &f->followinfo->follow); /* include first as we may repeat this sentance */ if (Debugging) @@ -8075,7 +8092,7 @@ static void CalcFollowFactor (FactorDesc f, SetDesc after) EmitSet (f->followinfo->follow, static_cast (0), static_cast (0)); StrIO_WriteLn (); } - if ((f->next == NULL) || ((GetReachEnd (f->next->followinfo)) == true_)) + if ((f->next == NULL) || ((GetReachEnd (f->next->followinfo)) == pge_true)) { OrSet (&f->followinfo->follow, after); CalcFollowExpression (f->expr, f->followinfo->follow); @@ -8099,7 +8116,7 @@ static void CalcFollowFactor (FactorDesc f, SetDesc after) CalcFollowTerm - */ -static void CalcFollowTerm (TermDesc t, SetDesc after) +static void CalcFollowTerm (pge_TermDesc t, pge_SetDesc after) { if (t != NULL) { @@ -8116,7 +8133,7 @@ static void CalcFollowTerm (TermDesc t, SetDesc after) CalcFollowExpression - */ -static void CalcFollowExpression (ExpressionDesc e, SetDesc after) +static void CalcFollowExpression (pge_ExpressionDesc e, pge_SetDesc after) { if (e != NULL) { @@ -8129,7 +8146,7 @@ static void CalcFollowExpression (ExpressionDesc e, SetDesc after) CalcFollowStatement - given a bnf statement generate the follow set. */ -static void CalcFollowStatement (StatementDesc s) +static void CalcFollowStatement (pge_StatementDesc s) { if (s != NULL) { @@ -8142,7 +8159,7 @@ static void CalcFollowStatement (StatementDesc s) CalcFollowProduction - */ -static void CalcFollowProduction (ProductionDesc p) +static void CalcFollowProduction (pge_ProductionDesc p) { if (p != NULL) { @@ -8155,33 +8172,33 @@ static void CalcFollowProduction (ProductionDesc p) CalcEpsilonFactor - */ -static void CalcEpsilonFactor (FactorDesc f) +static void CalcEpsilonFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: - AssignEpsilon ((GetEpsilon (f->ident->definition->followinfo)) != unknown, f->followinfo, GetEpsilon (f->ident->definition->followinfo)); + case pge_id: + AssignEpsilon ((GetEpsilon (f->ident->definition->followinfo)) != pge_unknown, f->followinfo, GetEpsilon (f->ident->definition->followinfo)); break; - case lit: - AssignEpsilon (TRUE, f->followinfo, false_); + case pge_lit: + AssignEpsilon (TRUE, f->followinfo, pge_false); break; - case sub: + case pge_sub: CalcEpsilonExpression (f->expr); - AssignEpsilon ((GetEpsilon (f->expr->followinfo)) != unknown, f->followinfo, GetEpsilon (f->expr->followinfo)); + AssignEpsilon ((GetEpsilon (f->expr->followinfo)) != pge_unknown, f->followinfo, GetEpsilon (f->expr->followinfo)); break; - case m2: - AssignEpsilon (TRUE, f->followinfo, true_); + case pge_m2: + AssignEpsilon (TRUE, f->followinfo, pge_true); break; - case opt: - case mult: + case pge_opt: + case pge_mult: CalcEpsilonExpression (f->expr); - AssignEpsilon (TRUE, f->followinfo, true_); + AssignEpsilon (TRUE, f->followinfo, pge_true); break; @@ -8197,7 +8214,7 @@ static void CalcEpsilonFactor (FactorDesc f) CalcEpsilonTerm - */ -static void CalcEpsilonTerm (TermDesc t) +static void CalcEpsilonTerm (pge_TermDesc t) { if (t != NULL) { @@ -8207,15 +8224,15 @@ static void CalcEpsilonTerm (TermDesc t) { switch (GetReachEnd (t->factor->followinfo)) { - case true_: - AssignEpsilon (TRUE, t->followinfo, true_); + case pge_true: + AssignEpsilon (TRUE, t->followinfo, pge_true); break; - case false_: - AssignEpsilon (TRUE, t->followinfo, false_); + case pge_false: + AssignEpsilon (TRUE, t->followinfo, pge_false); break; - case unknown: + case pge_unknown: break; @@ -8234,37 +8251,37 @@ static void CalcEpsilonTerm (TermDesc t) CalcEpsilonExpression - */ -static void CalcEpsilonExpression (ExpressionDesc e) +static void CalcEpsilonExpression (pge_ExpressionDesc e) { - TermDesc t; - TraverseResult result; + pge_TermDesc t; + pge_TraverseResult result; if (e != NULL) { CalcEpsilonTerm (e->term); - if ((GetEpsilon (e->followinfo)) == unknown) + if ((GetEpsilon (e->followinfo)) == pge_unknown) { - result = unknown; + result = pge_unknown; t = e->term; while (t != NULL) { - if ((GetEpsilon (t->followinfo)) != unknown) + if ((GetEpsilon (t->followinfo)) != pge_unknown) { stop (); } switch (GetEpsilon (t->followinfo)) { - case unknown: + case pge_unknown: break; - case true_: - result = true_; + case pge_true: + result = pge_true; break; - case false_: - if (result != true_) + case pge_false: + if (result != pge_true) { - result = false_; + result = pge_false; } break; @@ -8274,7 +8291,7 @@ static void CalcEpsilonExpression (ExpressionDesc e) } t = t->next; } - AssignEpsilon (result != unknown, e->followinfo, result); + AssignEpsilon (result != pge_unknown, e->followinfo, result); } } } @@ -8284,13 +8301,13 @@ static void CalcEpsilonExpression (ExpressionDesc e) CalcEpsilonStatement - given a bnf statement generate the follow set. */ -static void CalcEpsilonStatement (StatementDesc s) +static void CalcEpsilonStatement (pge_StatementDesc s) { if (s != NULL) { if (s->expr != NULL) { - AssignEpsilon ((GetEpsilon (s->expr->followinfo)) != unknown, s->followinfo, GetEpsilon (s->expr->followinfo)); + AssignEpsilon ((GetEpsilon (s->expr->followinfo)) != pge_unknown, s->followinfo, GetEpsilon (s->expr->followinfo)); } CalcEpsilonExpression (s->expr); } @@ -8301,7 +8318,7 @@ static void CalcEpsilonStatement (StatementDesc s) CalcEpsilonProduction - */ -static void CalcEpsilonProduction (ProductionDesc p) +static void CalcEpsilonProduction (pge_ProductionDesc p) { if (p != NULL) { @@ -8317,7 +8334,7 @@ static void CalcEpsilonProduction (ProductionDesc p) StrIO_WriteString ((const char *) " calculating epsilon", 21); StrIO_WriteLn (); } - AssignEpsilon ((GetEpsilon (p->statement->followinfo)) != unknown, p->followinfo, GetEpsilon (p->statement->followinfo)); + AssignEpsilon ((GetEpsilon (p->statement->followinfo)) != pge_unknown, p->followinfo, GetEpsilon (p->statement->followinfo)); CalcEpsilonStatement (p->statement); } } @@ -8327,14 +8344,14 @@ static void CalcEpsilonProduction (ProductionDesc p) CalcReachEndFactor - */ -static TraverseResult CalcReachEndFactor (FactorDesc f) +static pge_TraverseResult CalcReachEndFactor (pge_FactorDesc f) { - TraverseResult canreachend; - TraverseResult result; + pge_TraverseResult canreachend; + pge_TraverseResult result; if (f == NULL) { - return true_; /* we have reached the end of this factor list */ + return pge_true; /* we have reached the end of this factor list */ } else { @@ -8342,26 +8359,26 @@ static TraverseResult CalcReachEndFactor (FactorDesc f) result = CalcReachEndFactor (f->next); switch (f->type) { - case id: + case pge_id: if (f->ident->definition == NULL) { WarnError1 ((const char *) "definition for %s is absent (assuming epsilon is false for this production)", 75, f->ident->name); - result = false_; + result = pge_false; } - else if (result != false_) + else if (result != pge_false) { /* avoid dangling else. */ switch (GetReachEnd (f->ident->definition->followinfo)) { - case false_: - result = false_; + case pge_false: + result = pge_false; break; - case true_: + case pge_true: break; - case unknown: - result = unknown; + case pge_unknown: + result = pge_unknown; break; @@ -8371,20 +8388,20 @@ static TraverseResult CalcReachEndFactor (FactorDesc f) } break; - case lit: - result = false_; + case pge_lit: + result = pge_false; break; - case sub: + case pge_sub: CalcReachEndExpression (f->expr); - if ((f->expr != NULL) && (result == true_)) + if ((f->expr != NULL) && (result == pge_true)) { result = GetReachEnd (f->expr->followinfo); } break; - case mult: - case opt: + case pge_mult: + case pge_opt: if (f->expr != NULL) { /* not interested in the result as expression is optional */ @@ -8392,14 +8409,14 @@ static TraverseResult CalcReachEndFactor (FactorDesc f) } break; - case m2: + case pge_m2: break; default: break; } - AssignReachEnd (result != unknown, f->followinfo, result); + AssignReachEnd (result != pge_unknown, f->followinfo, result); return result; } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -8411,31 +8428,31 @@ static TraverseResult CalcReachEndFactor (FactorDesc f) CalcReachEndTerm - */ -static TraverseResult CalcReachEndTerm (TermDesc t) +static pge_TraverseResult CalcReachEndTerm (pge_TermDesc t) { - TraverseResult canreachend; - TraverseResult result; + pge_TraverseResult canreachend; + pge_TraverseResult result; if (t != NULL) { - canreachend = false_; + canreachend = pge_false; while (t != NULL) { result = CalcReachEndFactor (t->factor); - AssignReachEnd (result != unknown, t->followinfo, result); + AssignReachEnd (result != pge_unknown, t->followinfo, result); switch (result) { - case true_: - canreachend = true_; + case pge_true: + canreachend = pge_true; break; - case false_: + case pge_false: break; - case unknown: - if (canreachend == false_) + case pge_unknown: + if (canreachend == pge_false) { - canreachend = unknown; + canreachend = pge_unknown; } break; @@ -8456,9 +8473,9 @@ static TraverseResult CalcReachEndTerm (TermDesc t) CalcReachEndExpression - */ -static void CalcReachEndExpression (ExpressionDesc e) +static void CalcReachEndExpression (pge_ExpressionDesc e) { - TraverseResult result; + pge_TraverseResult result; if (e == NULL) {} /* empty. */ @@ -8466,7 +8483,7 @@ static void CalcReachEndExpression (ExpressionDesc e) { /* no expression, thus reached the end of this sentance */ result = CalcReachEndTerm (e->term); - AssignReachEnd (result != unknown, e->followinfo, result); + AssignReachEnd (result != pge_unknown, e->followinfo, result); } } @@ -8475,14 +8492,14 @@ static void CalcReachEndExpression (ExpressionDesc e) CalcReachEndStatement - */ -static void CalcReachEndStatement (StatementDesc s) +static void CalcReachEndStatement (pge_StatementDesc s) { if (s != NULL) { if (s->expr != NULL) { CalcReachEndExpression (s->expr); - AssignReachEnd ((GetReachEnd (s->expr->followinfo)) != unknown, s->followinfo, GetReachEnd (s->expr->followinfo)); + AssignReachEnd ((GetReachEnd (s->expr->followinfo)) != pge_unknown, s->followinfo, GetReachEnd (s->expr->followinfo)); } } } @@ -8501,19 +8518,19 @@ static void stop (void) CalcReachEndProduction - */ -static void CalcReachEndProduction (ProductionDesc p) +static void CalcReachEndProduction (pge_ProductionDesc p) { if (p != NULL) { CalcReachEndStatement (p->statement); - if ((GetReachEnd (p->followinfo)) != unknown) + if ((GetReachEnd (p->followinfo)) != pge_unknown) { if (Debugging) { StrIO_WriteString ((const char *) "already calculated reach end for: ", 34); NameKey_WriteKey (p->statement->ident->name); StrIO_WriteString ((const char *) " its value is ", 14); - if ((GetReachEnd (p->followinfo)) == true_) + if ((GetReachEnd (p->followinfo)) == pge_true) { StrIO_WriteString ((const char *) "reachable", 9); } @@ -8524,7 +8541,7 @@ static void CalcReachEndProduction (ProductionDesc p) StrIO_WriteLn (); } } - AssignReachEnd ((GetReachEnd (p->statement->followinfo)) != unknown, p->followinfo, GetReachEnd (p->statement->followinfo)); + AssignReachEnd ((GetReachEnd (p->statement->followinfo)) != pge_unknown, p->followinfo, GetReachEnd (p->statement->followinfo)); } } @@ -8533,36 +8550,36 @@ static void CalcReachEndProduction (ProductionDesc p) EmptyFactor - */ -static unsigned int EmptyFactor (FactorDesc f) +static unsigned int EmptyFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: if (! (EmptyProduction (f->ident->definition))) { return FALSE; } break; - case lit: + case pge_lit: return FALSE; break; - case sub: + case pge_sub: if (! (EmptyExpression (f->expr))) { return FALSE; } break; - case opt: - case mult: + case pge_opt: + case pge_mult: return TRUE; break; - case m2: + case pge_m2: break; @@ -8581,7 +8598,7 @@ static unsigned int EmptyFactor (FactorDesc f) EmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int EmptyTerm (TermDesc t) +static unsigned int EmptyTerm (pge_TermDesc t) { while (t != NULL) { @@ -8604,7 +8621,7 @@ static unsigned int EmptyTerm (TermDesc t) EmptyExpression - */ -static unsigned int EmptyExpression (ExpressionDesc e) +static unsigned int EmptyExpression (pge_ExpressionDesc e) { if (e == NULL) { @@ -8623,7 +8640,7 @@ static unsigned int EmptyExpression (ExpressionDesc e) EmptyStatement - returns TRUE if statement, s, is empty. */ -static unsigned int EmptyStatement (StatementDesc s) +static unsigned int EmptyStatement (pge_StatementDesc s) { if (s == NULL) { @@ -8642,7 +8659,7 @@ static unsigned int EmptyStatement (StatementDesc s) EmptyProduction - returns if production, p, maybe empty. */ -static unsigned int EmptyProduction (ProductionDesc p) +static unsigned int EmptyProduction (pge_ProductionDesc p) { if (p == NULL) { @@ -8695,7 +8712,7 @@ static void EmitRules (void) { EmitFDLNotice (); } - ForeachRuleDo ((DoProcedure) {(DoProcedure_t) EmitRule}); + ForeachRuleDo ((pge_DoProcedure) {(pge_DoProcedure_t) EmitRule}); } @@ -9093,17 +9110,17 @@ static void EmitSupport (void) DisposeSetDesc - dispose of the set list, s. */ -static void DisposeSetDesc (SetDesc *s) +static void DisposeSetDesc (pge_SetDesc *s) { - SetDesc h; - SetDesc n; + pge_SetDesc h; + pge_SetDesc n; if ((*s) != NULL) { h = (*s); n = (*s)->next; do { - Storage_DEALLOCATE ((void **) &h, sizeof (_T7)); + Storage_DEALLOCATE ((void **) &h, sizeof (pge__T7)); h = n; if (n != NULL) { @@ -9119,28 +9136,28 @@ static void DisposeSetDesc (SetDesc *s) OptionalFactor - */ -static unsigned int OptionalFactor (FactorDesc f) +static unsigned int OptionalFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: break; - case lit: + case pge_lit: break; - case sub: - case opt: - case mult: + case pge_sub: + case pge_opt: + case pge_mult: if (OptionalExpression (f->expr)) { return TRUE; } break; - case m2: + case pge_m2: break; @@ -9159,12 +9176,12 @@ static unsigned int OptionalFactor (FactorDesc f) OptionalTerm - returns TRUE if the term maybe empty. */ -static unsigned int OptionalTerm (TermDesc t) +static unsigned int OptionalTerm (pge_TermDesc t) { - TermDesc u; - TermDesc v; - SetDesc tov; - SetDesc tou; + pge_TermDesc u; + pge_TermDesc v; + pge_SetDesc tov; + pge_SetDesc tou; u = t; while (u != NULL) @@ -9214,7 +9231,7 @@ static unsigned int OptionalTerm (TermDesc t) OptionalExpression - */ -static unsigned int OptionalExpression (ExpressionDesc e) +static unsigned int OptionalExpression (pge_ExpressionDesc e) { if (e == NULL) { @@ -9233,7 +9250,7 @@ static unsigned int OptionalExpression (ExpressionDesc e) OptionalStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int OptionalStatement (StatementDesc s) +static unsigned int OptionalStatement (pge_StatementDesc s) { if (s == NULL) { @@ -9252,7 +9269,7 @@ static unsigned int OptionalStatement (StatementDesc s) OptionalProduction - */ -static unsigned int OptionalProduction (ProductionDesc p) +static unsigned int OptionalProduction (pge_ProductionDesc p) { if (p == NULL) { @@ -9271,10 +9288,10 @@ static unsigned int OptionalProduction (ProductionDesc p) CheckFirstFollow - */ -static unsigned int CheckFirstFollow (FactorDesc f, FactorDesc after) +static unsigned int CheckFirstFollow (pge_FactorDesc f, pge_FactorDesc after) { - SetDesc first; - SetDesc follow; + pge_SetDesc first; + pge_SetDesc follow; first = NULL; CalcFirstFactor (f, NULL, &first); @@ -9309,35 +9326,35 @@ static unsigned int CheckFirstFollow (FactorDesc f, FactorDesc after) ConstrainedEmptyFactor - */ -static unsigned int ConstrainedEmptyFactor (FactorDesc f) +static unsigned int ConstrainedEmptyFactor (pge_FactorDesc f) { while (f != NULL) { switch (f->type) { - case id: + case pge_id: break; - case lit: + case pge_lit: break; - case sub: - case opt: - case mult: + case pge_sub: + case pge_opt: + case pge_mult: if (ConstrainedEmptyExpression (f->expr)) { return TRUE; } break; - case m2: + case pge_m2: break; default: break; } - if (((f->type != m2) && (EmptyFactor (f))) && (CheckFirstFollow (f, f->next))) + if (((f->type != pge_m2) && (EmptyFactor (f))) && (CheckFirstFollow (f, f->next))) { return TRUE; } @@ -9353,10 +9370,10 @@ static unsigned int ConstrainedEmptyFactor (FactorDesc f) ConstrainedEmptyTerm - returns TRUE if the term maybe empty. */ -static unsigned int ConstrainedEmptyTerm (TermDesc t) +static unsigned int ConstrainedEmptyTerm (pge_TermDesc t) { - SetDesc first; - SetDesc follow; + pge_SetDesc first; + pge_SetDesc follow; while (t != NULL) { @@ -9364,7 +9381,7 @@ static unsigned int ConstrainedEmptyTerm (TermDesc t) { return TRUE; } - else if (((t->factor->type != m2) && (EmptyFactor (t->factor))) && (CheckFirstFollow (t->factor, t->factor->next))) + else if (((t->factor->type != pge_m2) && (EmptyFactor (t->factor))) && (CheckFirstFollow (t->factor, t->factor->next))) { /* avoid dangling else. */ return TRUE; @@ -9381,7 +9398,7 @@ static unsigned int ConstrainedEmptyTerm (TermDesc t) ConstrainedEmptyExpression - */ -static unsigned int ConstrainedEmptyExpression (ExpressionDesc e) +static unsigned int ConstrainedEmptyExpression (pge_ExpressionDesc e) { if (e == NULL) { @@ -9400,7 +9417,7 @@ static unsigned int ConstrainedEmptyExpression (ExpressionDesc e) ConstrainedEmptyStatement - returns FALSE if statement, s, does not have a optional ambiguity. */ -static unsigned int ConstrainedEmptyStatement (StatementDesc s) +static unsigned int ConstrainedEmptyStatement (pge_StatementDesc s) { if (s == NULL) { @@ -9419,7 +9436,7 @@ static unsigned int ConstrainedEmptyStatement (StatementDesc s) ConstrainedEmptyProduction - returns TRUE if a problem exists with, p. */ -static unsigned int ConstrainedEmptyProduction (ProductionDesc p) +static unsigned int ConstrainedEmptyProduction (pge_ProductionDesc p) { if (p == NULL) { @@ -9438,7 +9455,7 @@ static unsigned int ConstrainedEmptyProduction (ProductionDesc p) TestForLALR1 - */ -static void TestForLALR1 (ProductionDesc p) +static void TestForLALR1 (pge_ProductionDesc p) { if (OptionalProduction (p)) { @@ -9453,7 +9470,7 @@ static void TestForLALR1 (ProductionDesc p) DoEpsilon - runs the epsilon interrelated rules */ -static void DoEpsilon (ProductionDesc p) +static void DoEpsilon (pge_ProductionDesc p) { CalcEpsilonProduction (p); CalcReachEndProduction (p); @@ -9464,9 +9481,9 @@ static void DoEpsilon (ProductionDesc p) CheckComplete - checks that production, p, is complete. */ -static void CheckComplete (ProductionDesc p) +static void CheckComplete (pge_ProductionDesc p) { - if ((GetReachEnd (p->followinfo)) == unknown) + if ((GetReachEnd (p->followinfo)) == pge_unknown) { PrettyCommentProduction (p); WarnError1 ((const char *) "cannot determine epsilon, probably a left recursive rule in %s and associated rules (hint rewrite using ebnf and eliminate left recursion)", 138, p->statement->ident->name); @@ -9481,34 +9498,34 @@ static void CheckComplete (ProductionDesc p) static void PostProcessRules (void) { - ForeachRuleDo ((DoProcedure) {(DoProcedure_t) BackPatchIdentToDefinitions}); + ForeachRuleDo ((pge_DoProcedure) {(pge_DoProcedure_t) BackPatchIdentToDefinitions}); if (! WasNoError) { M2RTS_HALT (-1); __builtin_unreachable (); } - WhileNotCompleteDo ((DoProcedure) {(DoProcedure_t) DoEpsilon}); + WhileNotCompleteDo ((pge_DoProcedure) {(pge_DoProcedure_t) DoEpsilon}); if (! WasNoError) { M2RTS_HALT (-1); __builtin_unreachable (); } - ForeachRuleDo ((DoProcedure) {(DoProcedure_t) CheckComplete}); + ForeachRuleDo ((pge_DoProcedure) {(pge_DoProcedure_t) CheckComplete}); if (! WasNoError) { M2RTS_HALT (-1); __builtin_unreachable (); } - WhileNotCompleteDo ((DoProcedure) {(DoProcedure_t) CalculateFirstAndFollow}); + WhileNotCompleteDo ((pge_DoProcedure) {(pge_DoProcedure_t) CalculateFirstAndFollow}); if (! WasNoError) { M2RTS_HALT (-1); __builtin_unreachable (); } - ForeachRuleDo ((DoProcedure) {(DoProcedure_t) TestForLALR1}); + ForeachRuleDo ((pge_DoProcedure) {(pge_DoProcedure_t) TestForLALR1}); if (! WasNoError) { - ForeachRuleDo ((DoProcedure) {(DoProcedure_t) PrettyCommentProduction}); + ForeachRuleDo ((pge_DoProcedure) {(pge_DoProcedure_t) PrettyCommentProduction}); } } @@ -9519,7 +9536,7 @@ static void PostProcessRules (void) static void DisplayHelp (void) { - StrIO_WriteString ((const char *) "Usage: pge [-l] [-c] [-d] [-e] [-k] [-t] [-k] [-p] [-t] [-f] [-o outputfile] filename", 85); + StrIO_WriteString ((const char *) "Usage: pge [-l] [-c] [-d] [-e] [-k] [-t] [-k] [-p] [-x] [-f] [-o outputfile] filename", 85); StrIO_WriteLn (); StrIO_WriteString ((const char *) " -l suppress file and line source information", 59); StrIO_WriteLn (); @@ -9537,6 +9554,8 @@ static void DisplayHelp (void) StrIO_WriteLn (); StrIO_WriteString ((const char *) " -t generate texinfo formating for pretty printing (-p)", 69); StrIO_WriteLn (); + StrIO_WriteString ((const char *) " -x generate sphinx formating for pretty printing (-p)", 68); + StrIO_WriteLn (); StrIO_WriteString ((const char *) " -f generate GNU Free Documentation header before pretty printing in texinfo", 90); StrIO_WriteLn (); StrIO_WriteString ((const char *) " -o write output to filename", 42); @@ -9605,6 +9624,11 @@ static void ParseArgs (void) /* avoid dangling else. */ Texinfo = TRUE; } + else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-x", 2)) + { + /* avoid dangling else. */ + Sphinx = TRUE; + } else if (StrLib_StrEqual ((const char *) &ArgName.array[0], MaxFileName, (const char *) "-f", 2)) { /* avoid dangling else. */ @@ -9659,6 +9683,7 @@ static void Init (void) { WasNoError = TRUE; Texinfo = FALSE; + Sphinx = FALSE; FreeDocLicense = FALSE; EmitCode = TRUE; LargestValue = 0; @@ -9678,7 +9703,7 @@ static void Init (void) SymIsProc = NameKey_MakeKey ((const char *) "SymIs", 5); OnLineStart = TRUE; ParseArgs (); - Main (static_cast ((unsigned int) ((1 << (bnflex_eoftok))))); /* this line will be manipulated by sed in buildpg */ + Main (static_cast ((unsigned int) ((1 << (bnflex_eoftok))))); /* this line will be manipulated by sed in buildpg */ if (WasNoError) /* this line will be manipulated by sed in buildpg */ { PostProcessRules (); @@ -9718,11 +9743,11 @@ static void Init (void) Output_Close (); } -extern "C" void _M2_pge_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_pge_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { Init (); } -extern "C" void _M2_pge_finish (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[]) +extern "C" void _M2_pge_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } diff --git a/gcc/m2/pge-boot/main.c b/gcc/m2/pge-boot/main.c index af6e1bd76a3..3c7656a1d53 100644 --- a/gcc/m2/pge-boot/main.c +++ b/gcc/m2/pge-boot/main.c @@ -1,123 +1,123 @@ -extern "C" void _M2_RTExceptions_init(int argc, char *argv[]); -extern "C" void _M2_RTExceptions_finish(int argc, char *argv[]); -extern "C" void _M2_M2EXCEPTION_init(int argc, char *argv[]); -extern "C" void _M2_M2EXCEPTION_finish(int argc, char *argv[]); -extern "C" void _M2_M2RTS_init(int argc, char *argv[]); -extern "C" void _M2_M2RTS_finish(int argc, char *argv[]); -extern "C" void _M2_SysExceptions_init(int argc, char *argv[]); -extern "C" void _M2_SysExceptions_finish(int argc, char *argv[]); -extern "C" void _M2_StrLib_init(int argc, char *argv[]); -extern "C" void _M2_StrLib_finish(int argc, char *argv[]); -extern "C" void _M2_errno_init(int argc, char *argv[]); -extern "C" void _M2_errno_finish(int argc, char *argv[]); -extern "C" void _M2_termios_init(int argc, char *argv[]); -extern "C" void _M2_termios_finish(int argc, char *argv[]); -extern "C" void _M2_IO_init(int argc, char *argv[]); -extern "C" void _M2_IO_finish(int argc, char *argv[]); -extern "C" void _M2_StdIO_init(int argc, char *argv[]); -extern "C" void _M2_StdIO_finish(int argc, char *argv[]); -extern "C" void _M2_Debug_init(int argc, char *argv[]); -extern "C" void _M2_Debug_finish(int argc, char *argv[]); -extern "C" void _M2_SysStorage_init(int argc, char *argv[]); -extern "C" void _M2_SysStorage_finish(int argc, char *argv[]); -extern "C" void _M2_Storage_init(int argc, char *argv[]); -extern "C" void _M2_Storage_finish(int argc, char *argv[]); -extern "C" void _M2_StrIO_init(int argc, char *argv[]); -extern "C" void _M2_StrIO_finish(int argc, char *argv[]); -extern "C" void _M2_DynamicStrings_init(int argc, char *argv[]); -extern "C" void _M2_DynamicStrings_finish(int argc, char *argv[]); -extern "C" void _M2_Assertion_init(int argc, char *argv[]); -extern "C" void _M2_Assertion_finish(int argc, char *argv[]); -extern "C" void _M2_Indexing_init(int argc, char *argv[]); -extern "C" void _M2_Indexing_finish(int argc, char *argv[]); -extern "C" void _M2_NameKey_init(int argc, char *argv[]); -extern "C" void _M2_NameKey_finish(int argc, char *argv[]); -extern "C" void _M2_NumberIO_init(int argc, char *argv[]); -extern "C" void _M2_NumberIO_finish(int argc, char *argv[]); -extern "C" void _M2_PushBackInput_init(int argc, char *argv[]); -extern "C" void _M2_PushBackInput_finish(int argc, char *argv[]); -extern "C" void _M2_SymbolKey_init(int argc, char *argv[]); -extern "C" void _M2_SymbolKey_finish(int argc, char *argv[]); -extern "C" void _M2_UnixArgs_init(int argc, char *argv[]); -extern "C" void _M2_UnixArgs_finish(int argc, char *argv[]); -extern "C" void _M2_FIO_init(int argc, char *argv[]); -extern "C" void _M2_FIO_finish(int argc, char *argv[]); -extern "C" void _M2_SFIO_init(int argc, char *argv[]); -extern "C" void _M2_SFIO_finish(int argc, char *argv[]); -extern "C" void _M2_StrCase_init(int argc, char *argv[]); -extern "C" void _M2_StrCase_finish(int argc, char *argv[]); -extern "C" void _M2_bnflex_init(int argc, char *argv[]); -extern "C" void _M2_bnflex_finish(int argc, char *argv[]); -extern "C" void _M2_Lists_init(int argc, char *argv[]); -extern "C" void _M2_Lists_finish(int argc, char *argv[]); -extern "C" void _M2_Args_init(int argc, char *argv[]); -extern "C" void _M2_Args_finish(int argc, char *argv[]); -extern "C" void _M2_Output_init(int argc, char *argv[]); -extern "C" void _M2_Output_finish(int argc, char *argv[]); -extern "C" void _M2_pge_init(int argc, char *argv[]); -extern "C" void _M2_pge_finish(int argc, char *argv[]); +extern "C" void _M2_RTExceptions_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_RTExceptions_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_M2EXCEPTION_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_M2EXCEPTION_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_M2RTS_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_M2RTS_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SysExceptions_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SysExceptions_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrLib_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrLib_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_errno_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_errno_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_termios_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_termios_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_IO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_IO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StdIO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StdIO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Debug_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Debug_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SysStorage_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SysStorage_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Storage_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Storage_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrIO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrIO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_DynamicStrings_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_DynamicStrings_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Assertion_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Assertion_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Indexing_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Indexing_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_NameKey_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_NameKey_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_NumberIO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_NumberIO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_PushBackInput_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_PushBackInput_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SymbolKey_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SymbolKey_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_UnixArgs_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_UnixArgs_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_FIO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_FIO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SFIO_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_SFIO_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrCase_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_StrCase_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_bnflex_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_bnflex_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Lists_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Lists_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Args_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Args_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Output_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_Output_finish (int argc, char *argv[], char *envp[]); +extern "C" void _M2_pge_init (int argc, char *argv[], char *envp[]); +extern "C" void _M2_pge_finish (int argc, char *argv[], char *envp[]); extern "C" void _exit(int); -int main(int argc, char *argv[]) +int main(int argc, char *argv[], char *envp[]) { - _M2_RTExceptions_init(argc, argv); - _M2_M2EXCEPTION_init(argc, argv); - _M2_M2RTS_init(argc, argv); - _M2_SysExceptions_init(argc, argv); - _M2_StrLib_init(argc, argv); - _M2_errno_init(argc, argv); - _M2_termios_init(argc, argv); - _M2_IO_init(argc, argv); - _M2_StdIO_init(argc, argv); - _M2_Debug_init(argc, argv); - _M2_SysStorage_init(argc, argv); - _M2_Storage_init(argc, argv); - _M2_StrIO_init(argc, argv); - _M2_DynamicStrings_init(argc, argv); - _M2_Assertion_init(argc, argv); - _M2_Indexing_init(argc, argv); - _M2_NameKey_init(argc, argv); - _M2_NumberIO_init(argc, argv); - _M2_PushBackInput_init(argc, argv); - _M2_SymbolKey_init(argc, argv); - _M2_UnixArgs_init(argc, argv); - _M2_FIO_init(argc, argv); - _M2_SFIO_init(argc, argv); - _M2_StrCase_init(argc, argv); - _M2_bnflex_init(argc, argv); - _M2_Lists_init(argc, argv); - _M2_Args_init(argc, argv); - _M2_Output_init(argc, argv); - _M2_pge_init(argc, argv); - _M2_pge_finish(argc, argv); - _M2_Output_finish(argc, argv); - _M2_Args_finish(argc, argv); - _M2_Lists_finish(argc, argv); - _M2_bnflex_finish(argc, argv); - _M2_StrCase_finish(argc, argv); - _M2_SFIO_finish(argc, argv); - _M2_FIO_finish(argc, argv); - _M2_UnixArgs_finish(argc, argv); - _M2_SymbolKey_finish(argc, argv); - _M2_PushBackInput_finish(argc, argv); - _M2_NumberIO_finish(argc, argv); - _M2_NameKey_finish(argc, argv); - _M2_Indexing_finish(argc, argv); - _M2_Assertion_finish(argc, argv); - _M2_DynamicStrings_finish(argc, argv); - _M2_StrIO_finish(argc, argv); - _M2_Storage_finish(argc, argv); - _M2_SysStorage_finish(argc, argv); - _M2_Debug_finish(argc, argv); - _M2_StdIO_finish(argc, argv); - _M2_IO_finish(argc, argv); - _M2_termios_finish(argc, argv); - _M2_errno_finish(argc, argv); - _M2_StrLib_finish(argc, argv); - _M2_SysExceptions_finish(argc, argv); - _M2_M2RTS_finish(argc, argv); - _M2_M2EXCEPTION_finish(argc, argv); - _M2_RTExceptions_finish(argc, argv); + _M2_RTExceptions_init (argc, argv, envp); + _M2_M2EXCEPTION_init (argc, argv, envp); + _M2_M2RTS_init (argc, argv, envp); + _M2_SysExceptions_init (argc, argv, envp); + _M2_StrLib_init (argc, argv, envp); + _M2_errno_init (argc, argv, envp); + _M2_termios_init (argc, argv, envp); + _M2_IO_init (argc, argv, envp); + _M2_StdIO_init (argc, argv, envp); + _M2_Debug_init (argc, argv, envp); + _M2_SysStorage_init (argc, argv, envp); + _M2_Storage_init (argc, argv, envp); + _M2_StrIO_init (argc, argv, envp); + _M2_DynamicStrings_init (argc, argv, envp); + _M2_Assertion_init (argc, argv, envp); + _M2_Indexing_init (argc, argv, envp); + _M2_NameKey_init (argc, argv, envp); + _M2_NumberIO_init (argc, argv, envp); + _M2_PushBackInput_init (argc, argv, envp); + _M2_SymbolKey_init (argc, argv, envp); + _M2_UnixArgs_init (argc, argv, envp); + _M2_FIO_init (argc, argv, envp); + _M2_SFIO_init (argc, argv, envp); + _M2_StrCase_init (argc, argv, envp); + _M2_bnflex_init (argc, argv, envp); + _M2_Lists_init (argc, argv, envp); + _M2_Args_init (argc, argv, envp); + _M2_Output_init (argc, argv, envp); + _M2_pge_init (argc, argv, envp); + _M2_pge_finish (argc, argv, envp); + _M2_Output_finish (argc, argv, envp); + _M2_Args_finish (argc, argv, envp); + _M2_Lists_finish (argc, argv, envp); + _M2_bnflex_finish (argc, argv, envp); + _M2_StrCase_finish (argc, argv, envp); + _M2_SFIO_finish (argc, argv, envp); + _M2_FIO_finish (argc, argv, envp); + _M2_UnixArgs_finish (argc, argv, envp); + _M2_SymbolKey_finish (argc, argv, envp); + _M2_PushBackInput_finish (argc, argv, envp); + _M2_NumberIO_finish (argc, argv, envp); + _M2_NameKey_finish (argc, argv, envp); + _M2_Indexing_finish (argc, argv, envp); + _M2_Assertion_finish (argc, argv, envp); + _M2_DynamicStrings_finish (argc, argv, envp); + _M2_StrIO_finish (argc, argv, envp); + _M2_Storage_finish (argc, argv, envp); + _M2_SysStorage_finish (argc, argv, envp); + _M2_Debug_finish (argc, argv, envp); + _M2_StdIO_finish (argc, argv, envp); + _M2_IO_finish (argc, argv, envp); + _M2_termios_finish (argc, argv, envp); + _M2_errno_finish (argc, argv, envp); + _M2_StrLib_finish (argc, argv, envp); + _M2_SysExceptions_finish (argc, argv, envp); + _M2_M2RTS_finish (argc, argv, envp); + _M2_M2EXCEPTION_finish (argc, argv, envp); + _M2_RTExceptions_finish (argc, argv, envp); return(0); } diff --git a/gcc/m2/tools-src/def2doc.py b/gcc/m2/tools-src/def2doc.py index 7aaab6b90af..eb29118cc9d 100755 --- a/gcc/m2/tools-src/def2doc.py +++ b/gcc/m2/tools-src/def2doc.py @@ -36,10 +36,46 @@ ISO_Libs = ['gm2-libs-iso', 'M2 ISO Libraries', 'ISO defined libraries'] library_classifications = [Base_Libs, PIM_Log, PIM_Cor, ISO_Libs] +# state_states +state_none, state_var, state_type, state_const = range(4) +# block states +block_none, block_code, block_text, block_index = range(4) + + +class state: + def __init__(self): + self._state_state = state_none + self._block = block_none + def get_state (self): + return self._state_state + def set_state (self, value): + self._state_state = value + def is_const(self): + return self._state_state == state_const + def is_type(self): + return self._state_state == state_type + def is_var(self): + return self._state_state == state_var + def get_block(self): + return self._block + def _change_block(self, new_block): + if self._block != new_block: + self._block = new_block + self._emit_block_desc() + def _emit_block_desc(self): + if self._block == block_code: + output.write('.. code-block:: modula2\n') + elif self._block == block_index: + output.write('.. index::\n') + def to_code(self): + self._change_block(block_code) + def to_index(self): + self._change_block(block_index) + def init_state(): - global in_var, in_type, in_const - in_var, in_type, in_const = False, False, False + global state_obj + state_obj = state() def emit_node(name, nxt, previous, up): @@ -139,7 +175,8 @@ def remove_fields(file, line): output.write(line.rstrip() + '\n') -def emit_index(entry, tag, previous): +def emit_index(entry, tag): + global state_obj if args.texinfo: if tag == '': output.write('@findex ' + entry.rstrip() + '\n') @@ -147,72 +184,59 @@ def emit_index(entry, tag, previous): output.write('@findex ' + entry.rstrip() + ' ' + tag + '\n') elif args.sphinx: if tag == '': - output.write('.. index::') + state_obj.to_index() output.write(' ' * 3 + entry.rstrip() + '\n') else: - output.write('.. index::') + state_obj.to_index() output.write(' ' * 3 + 'pair: ' + entry.rstrip() + '; ' + tag + '\n') - if previous != '': - output.write(previous + '\n') -def check_index(line, current): +def check_index(line): # check_index - create an index entry for a PROCEDURE, TYPE, CONST or VAR. - global in_var, in_type, in_const + global state_obj words = line.split() procedure = '' if (len(words) > 1) and (words[0] == 'PROCEDURE'): - in_const = False - in_type = False - in_var = False + state_obj.set_state(state_none) if (words[1] == '__BUILTIN__') and (len(words) > 2): procedure = words[2] else: procedure = words[1] if (len(line) > 1) and (line[0:2] == '(*'): - in_const = False - in_type = False - in_var = False + state_obj.set_state(state_none) elif line == 'VAR': - in_const = False - in_var = True - in_type = False + state_obj.set_state(state_var) return elif line == 'TYPE': - in_const = False - in_type = True - in_var = False + state_obj.set_state(state_type) return elif line == 'CONST': - in_const = True - in_type = False - in_var = False - if in_var: + state_obj.set_state(state_const) + if state_obj.is_var(): words = line.split(',') for word in words: word = word.lstrip() if word != '': if word.find(':') == -1: - emit_index(word, '(var)', current) + emit_index(word, '(var)') elif len(word) > 0: var = word.split(':') if len(var) > 0: - emit_index(var[0], '(var)', current) - - if in_type: + emit_index(var[0], '(var)') + if state_obj.is_type(): words = line.lstrip() if words.find('=') != -1: word = words.split('=') if (len(word[0]) > 0) and (word[0][0] != '_'): - emit_index(word[0].rstrip(), '(type)', current) + emit_index(word[0].rstrip(), '(type)') else: word = words.split() if (len(word) > 1) and (word[1] == ';'): # hidden type if (len(word[0]) > 0) and (word[0][0] != '_'): - emit_index(word[0].rstrip(), '(type)', current) - if in_const: + emit_index(word[0].rstrip(), '(type)') + if state_obj.is_const(): words = line.split(';') for word in words: word = word.lstrip() @@ -220,7 +244,7 @@ def check_index(line, current): if word.find('=') != -1: var = word.split('=') if len(var) > 0: - emit_index(var[0], '(const)', current) + emit_index(var[0], '(const)') if procedure != '': name = procedure.split('(') if name[0] != '': @@ -228,10 +252,12 @@ def check_index(line, current): if proc[-1] == ';': proc = proc[:-1] if proc != '': - emit_index(proc, '', current) + emit_index(proc, '') def emit_texinfo_content(f, line): + global state_obj + state_obj.to_code() output.write(line.rstrip() + '\n') line = f.readline() if len(line.rstrip()) == 0: @@ -246,7 +272,8 @@ def emit_texinfo_content(f, line): line = f.readline() while line: line = line.rstrip() - check_index(line, '') + check_index(line) + state_obj.to_code() output.write(str.replace(str.replace(line, '{', '@{'), '}', '@}')) output.write('\n') line = f.readline() @@ -254,7 +281,8 @@ def emit_texinfo_content(f, line): def emit_sphinx_content(f, line): - output.write('.. code-block:: modula2\n') + global state_obj + state_obj.to_code() indent = ' ' * 4 output.write(indent + line.rstrip() + '\n') line = f.readline() @@ -270,7 +298,8 @@ def emit_sphinx_content(f, line): line = f.readline() while line: line = line.rstrip() - check_index(line, '.. code-block:: modula2') + check_index(line) + state_obj.to_code() output.write(indent + line + '\n') line = f.readline() return f diff --git a/libgm2/libm2cor/Makefile.in b/libgm2/libm2cor/Makefile.in index c867e42eca2..6d921cd329d 100644 --- a/libgm2/libm2cor/Makefile.in +++ b/libgm2/libm2cor/Makefile.in @@ -364,7 +364,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ # Used to install the shared libgcc. diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in index e83b9914af8..78a2efd49e0 100644 --- a/libgm2/libm2iso/Makefile.in +++ b/libgm2/libm2iso/Makefile.in @@ -388,7 +388,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ # Used to install the shared libgcc. diff --git a/libgm2/libm2log/Makefile.in b/libgm2/libm2log/Makefile.in index 30070ec5f03..be8a59d2a56 100644 --- a/libgm2/libm2log/Makefile.in +++ b/libgm2/libm2log/Makefile.in @@ -353,7 +353,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ # Used to install the shared libgcc. diff --git a/libgm2/libm2min/Makefile.in b/libgm2/libm2min/Makefile.in index f2ec8705936..8210c2e2fa9 100644 --- a/libgm2/libm2min/Makefile.in +++ b/libgm2/libm2min/Makefile.in @@ -343,7 +343,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ # Used to install the shared libgcc. diff --git a/libgm2/libm2pim/Makefile.in b/libgm2/libm2pim/Makefile.in index 338fcf8766d..ed14837c0a4 100644 --- a/libgm2/libm2pim/Makefile.in +++ b/libgm2/libm2pim/Makefile.in @@ -378,7 +378,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ # Used to install the shared libgcc.