Appendix B: Keywords
Every reserved keyword in Archlang, split by where it’s recognized.
Keywords in .arch files
| Keyword | Context | Effect | Chapter |
|---|---|---|---|
type | Top-level | Declares a type | 15 |
in | Module / process header | Attaches declaration to a parent module declared elsewhere | 4, 7 |
labels | Body | Opens a labels block | 9 |
required | Type body | Mandatory blank — instance must fill or drop | 16 |
cascade | Type body, field modifier | Field value flows to descendants with override semantics | 17 |
cascade * | Type body, field modifier | Declares a cascade-group root; sub-fields under the path are part of the group and replacement of the root drops the group | 17 |
append | Type body, field modifier | Field value composes with descendants’ values | 17 |
override | Body | Replace inherited entity with non-subtype kind | 18 |
drop | Body | Remove inherited entity from this scope and below | 18 |
subscribes | Interface body | Wire handler to an event interface | 5 |
process | Top-level / module body | Declares a process | 7 |
subprocess | Top-level / module body / process body | Declares a reusable subprocess | 7 |
do | Process body | Invoke a subprocess | 7 |
if, else | Process body | Conditional branch | 7 |
switch | Process body | Multi-way branch by case label | 7 |
parallel | Process body | Concurrent branches | 7 |
each | Process body | Iterate over a collection | 7 |
try, catch | Process body | Error path | 7 |
fail, finish | Process body | Terminate process with explicit outcome | 7 |
view | Top-level | Declares a view | 8 |
focus | View body | Include only nodes matching the label | 8 |
group | View body | Group by label (used with by) | 8 |
by | View body | Companion to group | 8 |
layout | View body | Pick layout algorithm | 8 |
include | View body | Include nodes matching glob pattern | 8 |
exclude | View body | Exclude nodes matching glob pattern | 8 |
true, false | Field/label values | Boolean literals | 9 |
Keywords in package.archspace files only
| Keyword | Context | Effect | Chapter |
|---|---|---|---|
use | Manifest / .arch file | Import types from another package | 11 |
from | use clause | Names source package | 11 |
as | use clause | Local rename | 11 |
export | Type declaration / use clause | Make type visible to importers / re-export | 11, 15 |
dependencies | Manifest | Opens dependencies block | 11 |
name, version, and widgets are recognized as manifest field names but are not reserved — they don’t shadow identifiers anywhere.
Context-restricted keywords
Some keywords are only legal in specific bodies. Use outside that context is a parse error.
| Keyword | Legal only in |
|---|---|
if, else, switch, each, try, catch, parallel, do, fail, finish | Process bodies |
focus, group, by, layout, include, exclude | View bodies |
subscribes | Interface bodies |
cascade, append, required | Type bodies |
What’s not a keyword
User-defined kinds — service, database, command, query, etc. — are not keywords. They’re identifiers introduced by type module … / type facet … / type interface … declarations. The parser resolves them contextually against the active kind registry.
The three base kinds module, facet, interface are likewise not keywords. They appear as parent kinds in type module service { … } and can be used directly to declare generic instances.
Reserved keyword names
User-defined kinds, fields, and labels cannot reuse reserved keywords. Attempting to declare type module process { ... } or use required as a label name is a parse error.
See also
- Appendix A: Grammar — EBNF for every construct
- Appendix C: Stdlib kinds — built-in kinds (not keywords, but conventionally available)