Install CRexsel on MacOS

Installing on MacOS can be done in two ways. First is identical form to the Linux install described here, and second as an XCode install. For the latter (and assuming that Xcode is installed) the process is relatively easy.

Load the CRexsel Package from the Git repository. After you open the link select "Download" from the left panel menu.

XCode_Package

Then select "Download repository" which should load the folder containing the CRexsel package.

XCode_Package

Rename the folder to CRexsel and move it the folder where you will build the package. Open the Package.swift file. After XCode has loaded the following should be displayed.

XCode_Package

The Package manifest file shows that there are two dependencies: the RexselKernel and the Swift ArgumentParser. Both of these should the most recent but is probably worth updating them before proceeding (right click on each one in turn).

import PackageDescription let package = Package( name: "crexsel", platforms: [ .macOS(.v14) ], products: [ .executable(name: "crexsel", targets: ["crexsel"]), ], dependencies: [ .package(url: "https://bitbucket.org/hsfr/rexselkernel", branch: "master" ), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), ], targets: [ .executableTarget( name: "crexsel", dependencies: [ .product( name: "RexselKernel", package: "rexselkernel" ), .product( name: "ArgumentParser", package: "swift-argument-parser" ), ], resources: [ .process("Resources") ] ) ] )

Build the Package by pressing Command+Build or the menu item 'Product->Build'. This should produce the executable file 'crexsel' in the build folder. This needs to be put in the '/usr/local/bin' folder.

Copy the build path using the menu item 'Product->Copy Build Folder Path'. This should be a path similar to '/Users/xxxx/Library/Developer/Xcode/DerivedData/CRexsel-xxxxxxxxx/Build'.

In the terminal type the following command:

hsfr@bramley pcms % cp -v [paste the build path here]/Products/Debug/crexsel /usr/local/bin .../Products/Debug/crexsel -> /usr/local/bin/crexsel hsfr@bramley pcms %

You may have to run this command as superuser. You may have to run this command as superuser.If all has gone without errors do the following (and assuming that the folder '/usr/local/bin' has added to the PATH environment variable, a reasonable assumption in most cases):

xxxx@pearmain crexsel % crexsel -h OVERVIEW: CRexsel V1.1.1 (Kernel V1.1.15) Translates Rexsel files to XSLT and vice versa. USAGE: If there has been no change in the rexsel source file then the compiling is skipped for that file. This can be overridden by using the "-f" flag. # Compile all files with extension rxsl with errors/symbols in the output. crexsel *.rxsl --errors --symbols # Convert all files with extension xsl to Rexsel language files. crexsel *.xsl --uncompile # Compile all files with extension rxsl leaving result in parent folder. crexsel *.rxsl --dest .. # Force compile (no caching) all files with extension rxsl leaving result in parent folder. crexsel *.rxsl --dest .. -f ARGUMENTS: <inputs> Set of Rexsel files to compile to XSLT. OPTIONS: -d, --dest <dest> Destination folder for output files. -f, --force Force compile (no caching). -s, --symbols Generate symbol table in the code. -e, --errors Show error list in output. -u, --undefined Show undefined errors (ignore external defines). -l, --lineNumbers Insert Rexsel source line numbers in XSL. -n, --noXmlnsPrefix No xsl namespace prefix. --uncompile Transform XSLT file into Rexsel. --verbose Verbose console messages. --debug Output debug messages. -h, --help Show help information. xxxx@pearmain crexsel % crexsel

This shows that the command is working. There is one more step to be done: copying the uncompiler script into '/usr/local/bin'. First you need to compile the script from the Rexsel source file into XSLT. First go to the Downloads folder and then to the downloaded repository whiocse name has the form '[user name]-crexsel-[hash]'.

xxxx@pearmain crexsel % cd [user name]-crexsel-[hash] xxxx@bramley [user name]-crexsel-[hash] % ls -l total 40 -rw-r--r--@ 1 hsfr staff 677 30 May 18:30 Package.resolved -rw-r--r--@ 1 hsfr staff 852 30 May 18:30 Package.swift -rw-r--r--@ 1 hsfr staff 565 30 May 18:30 README.md drwxr-xr-x@ 4 hsfr staff 128 30 May 18:30 Sources -rwxr-xr-x@ 1 hsfr staff 166 30 May 18:30 build.sh xxxx@pearmain crexsel %

Next change to the resources folder

xxxx@pearmain crexsel % cd Sources/Resources xxxx@pearmain Resources % ls -l total 120 -rw-r--r--@ 1 hsfr staff 32588 30 May 18:30 xsl2rexsel.rxsl xxxx@pearmain crexsel %

The file that you need is 'xsl2rexsel.rxsl' which is the Rexsel source file for the uncompiler (there may be a compiled version already there). The 'xsl2rexsel.xsl' file is the compiled version in XSLT. The latter needs to be updated to reflect the latest version of the uncompiler, and then transfered to the '/usr/local/bin' folder.

xxxx@pearmain crexsel % crexsel xsl2rexsel.rxsl -e xxxx@pearmain crexsel % cp xsl2rexsel.xsl /usr/local/bin xxxx@pearmain crexsel %

And that should be sufficient to load Rexsel.

Copyright 2025 Hugh Field-Richards. All Rights Reserved.