Code Monkey home page Code Monkey logo

toolmaker's Introduction

ToolMaker

What it is

ToolMaker is a set of tools to make compilers, analyzers and similar tools. It creates a lexcial scanner (like lex et.al) and a parser (like yacc et.al). But in addition it can also generate a lister (modules handling input text and error messages). It is also build on top of a powerful macro tool, imp, similar in function to m4 and others.

License

This is a project which contains original work by Kenth Ericsson, Jerker Willander and others at SoftLab AB Sweden, including myself. SoftLab was sold to Rational Software in 1997 which then resold that to Ericsson some years later.

Although this would strictly be copyrighted material, but considering

  • me being one of its authors and also one of the owners of SoftLab
  • the almost 20 years that has gone by
  • the low commercial value in this technology, given that there are a multitude of other tools available
  • the missing documentation
  • that I am willing to take this down if anyone objects

I'm making this repo of resurrected sources available, mostly for my own use. Please consult me before creating forks.

Current state

All licensing is removed, but the source for the licensing mechanism is still here, but not cleaned or compiled recently. The same goes for the toolmake utility, which creates an initial set of files for your new ToolMaker-based project.

Otherwise the source compiles on multipe platfoms (Linux, Cygwin, ...) and all tests run (using Jregr).

Acknowledgement

We, who where at SoftLab at that time, where all involved in this in some way. Special thanks to

  • Kenth Ericsson & Jerker Wilander for the theory behind the error recovery in the parser generated by the ParserMaker.

  • Tony Olsson for the core of the scanner logic.

  • Myself, Reibert Arbring, Michael Dahlgren and Håkan Pettersson for structuring this into a project and filling out all the blanks.

Building

To build you need gcc with binutils for 32-bit. ToolMaker cannot currently be built for 64-bit architectures. If you want to run tests you need Jregr.

For building the documentation, see docs-src/README.md.

toolmaker's People

Contributors

tajmone avatar thoni56 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tajmone

toolmaker's Issues

C Sources Styles Consistency

@thoni56,

I've began enforcing consistent code styles for C source, as you can see in the EditorConfig-C-Sources branch of my fork.

My approach is to work one folder at them time, since there are lots of sources and I want to visually inspect them one-by-one to ensure they are being correctly formatted.

The main problem is mixed indentation (tabs and spaces), which I'd like to fix by converting all tabs to spaces, and then enforce spaces indentation (without specifying any width).

After having looked at many .c and .h sources, it seems to me that the original tabs were 8 spaces, because when I set them to that all code aligns perfectly (especially comments). I then proceed to convert all tabs to spaces and inspect each file before committing.

To keep things simple, I'm adding a temporary .editorconfig settings file to each folder, as I reformat it, instead of having a root folder.

Once all folders are done, I'll delete those temporary settings and just add a rule for C files in the main .editorconfig.

Before carrying on with this work (which is quite huge and time consuming) I just wanted to make sure that this is something you're willing to accept a PR for, and (in case yes) whether you'd prefer me to submit a PR for every fixed folder or just submit one big PR once they're all done (with the latter, the risk is that if you update your sources I'll have to redo some files from scratch).

PS: Enable Discussions!

64 bit builds

Currently the ToolMaker suite builds cleanly on Cygwin32, Msys2/Mingw32 and Linux (cross-compilation to 32 bit with multilib).

There are a couple of warnings if you try to build for 64-bit. Also you should use i686---gcc cross-compiler in these cases.

Win OS + MSYS2: Make Failing

@thoni56, I've tried to build the repo under Win 10 using MSYS2 + MinGW-32, but only managed to compile part of the project. IRC, you mention somewhere that it only builds using CygWin.

Pre-Compiled Win Binaries

Since I'd like to be able to access all the ToolMaker binaries for the ALAN source project, I was hoping to manage to build it with MSYS2 and also wondering whether you could either:

  1. Make the precompiled binaries for Windows available for download somewhere.
  2. Add a Travis CI job to cross-compile ToolMaker for Windows under Ubuntu when a release is created.

As for the latter, it could automate adding precompiled binaries for other OSs too, and include them in each tagged GitHub release. Since the project is not actually following a versioned-releases strategy, and because it includes various tools, you could use dates in the YYYY-MM-DD format for release tags, instead of SemVer, and simply create a new release whenever any of the project tools was updated.

This might be a better versioning strategy, since the goal would be just to provide up-to-date binaries which each release, and because SemVer tags are not applicable to the whole project, besides not being practical in this case.

MSYS2/MinGW-32 Failure

Any idea why the build fails under MSYS2? The only binaries that compile successfully are:

  • imp.exe
  • lmk.exe
  • smk.exe

These tools seems to work fine — at least, I can query them via -help.

The Make log is rather long and not entirely clear, due to the many GCC warnings that clutter it. I've pasted it below, in a foldable section (so it doesn't take the whole page).

From what I gather, it fails to build the pmk tool:

collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:60: mingw32] Error 1
make[1]: Leaving directory '/d/GitHub/ToolMaker/ToolMaker/src/pmk'
make: *** [Makefile:8: all] Error 2

but I'm not sure what the collect2.exe binary is (part of the repo?) and why it's failing.

Since Make aborts at the above error, I have no idea if there are other problems with the remaining tools (I don't even know how many binaries I should expect on a successful build). Maybe if we manage to fix the above problem the rest of the Makefile works fine under MSYS2, or maybe there are more problems.

I haven't yet tried to build other sub-folders/tool using their Makefiles, but I will try to.

MSYS Log

Error log trying to build the project under Windows 10 x64, using MSYS2 and MinGW-32.

MSYS2 Error Log (click to unfold) ``` P.K.Dick@RANXEROX MINGW32 /d/ToolMaker/src $ make cd tmk; make all make[1]: Entering directory '/d/ToolMaker/src/tmk' Rebuilding for mingw32 rm: cannot remove '*.o': No such file or directory rm: cannot remove '*.a': No such file or directory gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkPaSema.o tmkPaSema.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkParse.o tmkParse.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkErr.o tmkErr.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkScan.o tmkScan.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkScSema.o tmkScSema.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkOpts.o tmkOpts.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o tmkCommon.o tmkCommon.c ar r libtmk.a tmkPaSema.o tmkParse.o tmkErr.o tmkScan.o tmkScSema.o tmkOpts.o tmkCommon.o C:\tools\msys64\mingw32\bin\ar.exe: creating libtmk.a ranlib libtmk.a install -C -b Common.imp ../../lib/ansi-c make[1]: Leaving directory '/d/ToolMaker/src/tmk' cd imp; make all make[1]: Entering directory '/d/ToolMaker/src/imp' Rebuilding for mingw32 rm: cannot remove '*.o': No such file or directory rm: cannot remove '*.a': No such file or directory gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impParse.o impParse.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impPaSema.o impPaSema.c impPaSema.c: In function 'impPaSema': impPaSema.c:454:5: warning: 'errStr' may be used uninitialized [-Wmaybe-uninitialized] 454 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : note: by argument 1 of type 'const char *' to '__builtin_strlen' declared here impPaSema.c:453:10: note: 'errStr' declared here 453 | char errStr[19]; | ^~~~~~ impPaSema.c:467:5: warning: 'errStr' may be used uninitialized [-Wmaybe-uninitialized] 467 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : note: by argument 1 of type 'const char *' to '__builtin_strlen' declared here impPaSema.c:466:10: note: 'errStr' declared here 466 | char errStr[19]; | ^~~~~~ impPaSema.c:480:5: warning: 'errStr' may be used uninitialized [-Wmaybe-uninitialized] 480 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : note: by argument 1 of type 'const char *' to '__builtin_strlen' declared here impPaSema.c:479:10: note: 'errStr' declared here 479 | char errStr[19]; | ^~~~~~ impPaSema.c:493:5: warning: 'errStr' may be used uninitialized [-Wmaybe-uninitialized] 493 | strcat(errStr, "INTEGER*IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : note: by argument 1 of type 'const char *' to '__builtin_strlen' declared here impPaSema.c:492:10: note: 'errStr' declared here 492 | char errStr[19]; | ^~~~~~ impPaSema.c:506:5: warning: 'errStr' may be used uninitialized [-Wmaybe-uninitialized] 506 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : note: by argument 1 of type 'const char *' to '__builtin_strlen' declared here impPaSema.c:505:10: note: 'errStr' declared here 505 | char errStr[19]; | ^~~~~~ impPaSema.c:454:5: warning: '__builtin_memcpy' writing 20 bytes into a region of size 19 overflows the destination [-Wstringop-overflow=] 454 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ impPaSema.c:453:10: note: destination object 'errStr' of size 19 453 | char errStr[19]; | ^~~~~~ impPaSema.c:467:5: warning: '__builtin_memcpy' writing 20 bytes into a region of size 19 overflows the destination [-Wstringop-overflow=] 467 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ impPaSema.c:466:10: note: destination object 'errStr' of size 19 466 | char errStr[19]; | ^~~~~~ impPaSema.c:480:5: warning: '__builtin_memcpy' writing 20 bytes into a region of size 19 overflows the destination [-Wstringop-overflow=] 480 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ impPaSema.c:479:10: note: destination object 'errStr' of size 19 479 | char errStr[19]; | ^~~~~~ impPaSema.c:506:5: warning: '__builtin_memcpy' writing 20 bytes into a region of size 19 overflows the destination [-Wstringop-overflow=] 506 | strcat(errStr, "INTEGER**IDENTIFIER"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ impPaSema.c:505:10: note: destination object 'errStr' of size 19 505 | char errStr[19]; | ^~~~~~ gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impErr.o impErr.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impList.o impList.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impScan.o impScan.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impScSema.o impScSema.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o ast.o ast.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o name.o name.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o impMacro.o impMacro.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o timing.o timing.c gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o version.o version.c ar rv imp.a impParse.o impPaSema.o impErr.o impList.o impScan.o impScSema.o ast.o name.o impMacro.o timing.o version.o a - impParse.o a - impPaSema.o a - impErr.o a - impList.o a - impScan.o a - impScSema.o a - ast.o a - name.o a - impMacro.o a - timing.o a - version.o C:\tools\msys64\mingw32\bin\ar.exe: creating imp.a ranlib imp.a gcc -Wall -g -DTARGETOS=\"mingw32\" -m32 -c -o imp.o imp.c gcc -o imp -Wall -g -DTARGETOS=\"mingw32\" -m32 imp.o imp.a mkdir -p ../../bin install imp ../../bin/ make[1]: Leaving directory '/d/ToolMaker/src/imp' cd lmk; make all make[1]: Entering directory '/d/ToolMaker/src/lmk' Rebuilding for mingw32 rm: cannot remove '*.o': No such file or directory rm: cannot remove '*.a': No such file or directory gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkPaSema.o lmkPaSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkParse.o lmkParse.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkErr.o lmkErr.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkScan.o lmkScan.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkScSema.o lmkScSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkList.o lmkList.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmkTab.o lmkTab.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmk.o lmk.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o version.o version.c gcc -o lmk -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 lmkPaSema.o lmkParse.o lmkErr.o lmkScan.o lmkScSema.o lmkList.o lmkTab.o lmk.o version.o ../tmk/libtmk.a ../imp/imp.a install lmk ../../bin/ install -C -b List.imp ../../lib/ansi-c/ make[1]: Leaving directory '/d/ToolMaker/src/lmk' cd smk; make all make[1]: Entering directory '/d/ToolMaker/src/smk' Rebuilding for mingw32 rm: cannot remove '*.o': No such file or directory rm: cannot remove '*.a': No such file or directory gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkPaSema.o smkPaSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkScSema.o smkScSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkParse.o smkParse.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkErr.o smkErr.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkScan.o smkScan.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smkList.o smkList.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smk.o smk.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o token.o token.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o scanner.o scanner.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o vocabulary.o vocabulary.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o definition.o definition.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o rule.o rule.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o ast.o ast.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lmprintf.o lmprintf.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o name.o name.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o char.o char.c char.c: In function 'charClass': char.c:180:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation] 180 | else | ^~~~ char.c:182:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else' 182 | if(*string==']') break; | ^~ gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o nfa.o nfa.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o lookahead.o lookahead.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o dfa.o dfa.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o map.o map.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pack.o pack.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o write.o write.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o time.o time.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o action.o action.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o set.o set.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o screen.o screen.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o smalloc.o smalloc.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o nfas.o nfas.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o common.o common.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o version.o version.c gcc -o smk -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 smkPaSema.o smkScSema.o smkParse.o smkErr.o smkScan.o smkList.o smk.o token.o scanner.o vocabulary.o definition.o rule.o ast.o lmprintf.o name.o char.o nfa.o lookahead.o dfa.o map.o pack.o write.o time.o action.o set.o screen.o smalloc.o nfas.o common.o version.o ../tmk/libtmk.a ../imp/imp.a install smk ../../bin/ install -C -b Scan.imp ../../lib/ansi-c make[1]: Leaving directory '/d/ToolMaker/src/smk' cd pmk; make all make[1]: Entering directory '/d/ToolMaker/src/pmk' Rebuilding for mingw32 rm: cannot remove '*.o': No such file or directory rm: cannot remove '*.a': No such file or directory gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pack.o pack.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkErr.o pmkErr.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkList.o pmkList.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkParse.o pmkParse.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkScan.o pmkScan.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkPaSema.o pmkPaSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkScSema.o pmkScSema.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkSymTab.o pmkSymTab.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmkTab.o pmkTab.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwDbg.o pwDbg.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwGe.o pwGe.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwLog.o pwLog.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwPack.o pwPack.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwSymSet.o pwSymSet.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwsGrm.o pwsGrm.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwsOrd.o pwsOrd.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwsQueue.o pwsQueue.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pwsWrit.o pwsWrit.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o set.o set.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o timing.o timing.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o pmk.o pmk.c gcc -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 -c -o version.o version.c gcc -o pmk -Wall -g -I../tmk -I../imp -DTARGETOS=\"mingw32\" -m32 pack.o pmkErr.o pmkList.o pmkParse.o pmkScan.o pmkPaSema.o pmkScSema.o pmkSymTab.o pmkTab.o pwDbg.o pwGe.o pwLog.o pwPack.o pwSymSet.o pwsGrm.o pwsOrd.o pwsQueue.o pwsWrit.o set.o timing.o pmk.o version.o ../tmk/libtmk.a ../imp/imp.a C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkParse.o:pmkParse.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkParse.o:pmkParse.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkScan.o:pmkScan.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkScan.o:pmkScan.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkPaSema.o:pmkPaSema.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkPaSema.o:pmkPaSema.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkScSema.o:pmkScSema.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkScSema.o:pmkScSema.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkSymTab.o:pmkSymTab.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkTab.o:pmkTab.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmkTab.o:pmkTab.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwGe.o:pwGe.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwLog.o:pwLog.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwLog.o:pwLog.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwPack.o:pwPack.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwSymSet.o:pwSymSet.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwsGrm.o:pwsGrm.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwsGrm.o:pwsGrm.c:(.bss+0xc): multiple definition of `code_spec'; pmkErr.o:pmkErr.c:(.bss+0xc): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwsOrd.o:pwsOrd.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwsQueue.o:pwsQueue.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pwsWrit.o:pwsWrit.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here C:/tools/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld.exe: pmk.o:pmk.c:(.bss+0x0): multiple definition of `inFiles'; pmkErr.o:pmkErr.c:(.bss+0x0): first defined here collect2.exe: error: ld returned 1 exit status make[1]: *** [Makefile:60: mingw32] Error 1 make[1]: Leaving directory '/d/ToolMaker/src/pmk' make: *** [Makefile:8: all] Error 2 ```

Building with LLVM/Clang?

Do you think that the project might build using the Clang compiler? It seems that the LLVM package contains various tools that allow code analysis to compile C project under Windows without all the cross-compatibility problems, which might allow to compile directly under Windows — but I'm not sure how this works and whether it currently handles any project or only certain features.

I've installed the LLVM package because various Rust projects need it to translate C sources to Rust (e.g. headers, or even transpiling entire sources). From what I've read, Clang has developed into an excellent compiler and it's currently comparable to GCC in terms of quality results.

If there's a chance that the project might build under Win OS using Clang (and other LLVM tools), without the need of the POSIX emulation layer of CygWin/MSYS2, then I think it's worth investing some energy in creating a build script for it.

More Info on Project Binaries

If you could provide me with some info regarding the various binary tools generated by the project it could help me out trying to provide alternative build scripts for Windows 10 (MSYS2, or Clang/LLVM).

Having a README file in each src/ folder, describing the tool, etc., would be useful.

Documenting ToolMaker

@thoni56, since ToolMaker is part of the ALAN toolchain (i.e. it's needed to tweak the ALAN syntax), I think it's worth trying to document ToolMaker, and I'm happy to help in this respect.

You mention "the missing documentation" in the main README. Was ToolMaker never documented because it was for internal use only? or was it documented in Swedish, or the documentation simply got lost? If there was a documentation printed on paper I could scan it and digitalize it, for example. If it's in Swedish, I could create a draft translation using DeepL, etc.

In absence of an original documentation, I could try to document the project from scratch, starting from the individual tools (which I'm currently unable to build though, see #5), and as I learn my way through start to document the notation of the grammar files, etc.

From what I gather, ToolMaker is quite an interesting set of tools, since it contains both a lexer and parser generator (whereas most of the other tools only handle the lexer or the parser). Also, while sifting through the sources I noticed it's a LALR(1) parser, so it should be similar to the Lemon parser generator in terms of parsing features, which is an excellent tool.

And if I'm not wrong, ToolMaker also provides some extra tools, which add value to it.

Anyhow, documenting it might be a long-term project, but it can be done nonetheless, a bit at the time, as I get to know ToolMaker in my free time (even if it's a morning I dedicate to it every so many months).

What do you think would be the best approach:

  1. I start documenting it in my fork's Wiki, and whenever a document is usable I submit it to the repository.
  2. I work on the documentation in a dedicated branch, and we simply merge the docs once they are production ready.

With either approach we could use Markdown or AsciiDoc, at our own discretion. Obviously, I'm more prone to use AsciiDoc since I prefer it and it would spare us porting work in case we end up creating a proper document from the various tools' READMEs.

Once I'll have access to the compiled binaries the task should be easier (I really should re-install my Ubuntu machine and just cross compile it). But since there is no documentation whatsoever right now, any input from you would be useful to set me in the right course in this task.


P.S. — Could you enable Discussions and convert this Issue into a discussion? Just to keep Issues clutter-free.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.