Module token

Source
Expand description

A leaf or branch node of a token tree. Used for parsing.

Leaf tokens have the following types:

Subgoal, Comma, Semicolon, LParen, RParen

Branch tokens contain child tokens. Valid types are: Group, And, Or

The precedence of branch tokens, from highest to lowest, is:

Group
And
Or

For the goal (mother($X, $Y); father($X, $Y)),
the corresponding token types would be:

LParen Subgoal Semicolon Subgoal RParen

Enums§

Token
Used for tokenizing Suiron source.
TokenType
Identifies tokens in the token tree and on the parse stack.

Functions§

make_branch_token
Makes a branch token from a vector of child tokens.
make_leaf_token
Makes a leaf token from the given string.