Specification
IGL 0.5. The normative document is the specification held in the source repository; these pages are generated from the same registries the compiler is generated from, so a block or a diagnostic described here is one the reference implementation actually accepts.
Lexical structure
A model is a sequence of blocks. A block header begins in column zero; every statement belonging to it is indented. That single rule is what lets a block end implicitly at the next header, with no closing token and no nesting to track.
BLOCK Name <- header, column zero, optional identifier
key value <- statement, indented
key = expression
# comment to end of line
Names are global. A reservoir and a process cannot share one, because a
qualified path such as Groundwater.Cr(VI).delta53Cr would
otherwise be ambiguous, and a language that resolves ambiguity by precedence
makes the reader carry the precedence table.
Statement keys are keywords only by position. IGL reserves no words globally:
a species may be called process if a model wants one, because the
parser decides what a token is from where it sits, not from a list.
Profiles
A profile is a set of capabilities an implementation claims, not a level it
passes. Core is always accepted whatever else is declared, so
--profile identification validates a model that mixes both, which
is the common case: an identification rests on isotopes and standards.
| Profile | Blocks | Which |
|---|---|---|
| core | 16 | CONDITIONS, DATABASE, EXPORT, FRACTIONATION, ISOTOPES, KINETICS, META, MODEL, OUTPUT, PARAMETERS, PROCESS, RESERVOIR, SPECIES, STANDARD, TITLE, UNITS |
| identification | 2 | IDENTIFY, SAMPLE |
| extended | 13 | ADSORPTION, DATASET, EXCHANGE, FIT, INITIAL, LAW, MONTE_CARLO, PHREEQC, PLOT, RAYLEIGH, REPORT, SENSITIVITY, SOLUTION |
An implementation that meets a block belonging to a profile it does not claim reports IG005 and refuses. It does not skip the block: silently ignoring one produces a numerically plausible result from an incomplete model, which is worse than a refusal.
Reserved names
Eight block names belong to the language and have no statements defined yet:
SOLUTION, INITIAL, DATASET,
FIT, MONTE_CARLO, SENSITIVITY,
PLOT and REPORT. They are recognised so that a model
using one is not told it invented a block, and so the name cannot be taken for
something else in the meantime. A model may write one; nothing inside it is
checked, nothing reads it, and an implementation reports
IG011 rather than pass over it in
silence.
Versioning
Four numbers move independently, because they describe four things that change at different rates.
| What | Version | Meaning |
|---|---|---|
| Language | 0.5 | What a model may say. Declared by META language. |
| Intermediate representation | 1.3 | What an engine consumes. |
| Results format | 1.1 | What an engine produces. |
| IGDB | 1.1 | What a fractionation database contains. |
Within a major version, a reader ignores fields it does not recognise. Refusing them would make every addition breaking and forbid minor versions entirely. Refusing an unimplemented major version stands.