~otheb/o

O Compiler and related tools
Removed unnecessary astpathspec file. Modified build task to collect
Wrote remaining semantic analysis code. Returns a complete sFile with
Started making semantic classes.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~otheb/o
read/write
git@git.sr.ht:~otheb/o

You can also use your local clone with git send-email.

                                   ### O ###

This is the main O project manager and compiler. At the moment it just puts
together compiler components, but later on it will provide more advanced
functionality such as testing, package management, and build pipeline tools.

### USAGE

The O compiler uses a syntax similar to that of pacman - Arch's package manager.
The general command format is this:

	o -h|--help
	o -<TASK> [OPTIONS...]

Options may be provided in either short or long form. Some take an argument.
Short form arguments are a single character and are prefixed with a single '-',
where long form arguments may be multiple characters and are prefixed with
'--'. Short form arguments may be provided in groups with multiple characters
together with a single '-' at the start of them.

The task at the start is a single-character option and will have a number of
task-specific options immediately after it.

	TASKS
		-B : Build the project
		-I : Show project information

	OPTIONS
		-l <level> , --log <level> : Set the logging level. Possible values are:
			silent   : No logging at all
			error    : Only log errors
			warn     : Default, log errors and warnings
			info     : Log errors, warnings, and extra information
			verbose  : Log verbose messages
			dbug     : Log excessively
			lexer    : Include internal logging from the lexer
			parser   : Include internal logging from the parser
			semantic : Include internal logging from the semantic
			           analyser
		-p <path> , --project <path> : Set the path of the project. By default,
			the compiler will search upwards from the current working directory
			until it finds a file with a '.op' (O project) extension. If
			provided, the compiler will use the specified file as the project
			file if the path is a file, or it will look for a '.op' file in the
			provided directory if the path is a directory.

### BUILDING

First satisfy dependencies. As the compiler is written in D, you will need the
'dmd' compiler and 'libphobos', D's standard library. Most distros will have a
'dlang' or similarly-named package in their repositories that will provide both
of these. You will also need 'make', which comes pre-installed on just about
every distro.

Note that - at the moment - the compiler targets Linux *only*. It *should* run
on other UNIX-family OSs such as BSDs, but this is not guaranteed.
Multi-platform support is a goal though.

Once you have the dependencies satisfied, it's very easy to build:

	./make.sh

Tidy up:

	./make.sh clean

Build and run with some sane default (read: "the arguments I'm using to test
the bit I'm working on") development arguments for lots of logging to build the
test project:

	./make.sh test

Internally, the script just generates a makefile with all the inter-file
dependencies resolved and then pushes it through make.