HANDBOOK / LANGUAGE REFERENCE MANUAL /

# Specifications

A Gentle specification is a list of declarations. A declaration introduces a type, a predicate, a context variable, or a context table. Exactly one declaration of a specification must be a root definition, this defining the elaboration of the specification. Declarations may be given in any order.

|  | Example
    'root' bits(-> N) print(N)

    'nonterm' bits(-> INT)
    'rule' bits(-> B): bit(-> B)
    'rule' bits(-> N*2+B): bits(-> N) bit(-> B)

    'nonterm' bit(-> INT)
    'rule' bit(-> 0): "0"
    'rule' bit(-> 1): "1"
This program reads a sequence of binary digits and prints the corresponding decimal value.