Jargon

Here we describe the source language and language lingo.

OPERATION AND RESULT

When a parse occurs, the result has 2 features that describes the success of the parse: size and flag. The size is how many items (characters in tokenization or tokens in analyzation) that were parse. The flag is a boolean that tells if the operation was successful - true for yes or false for no. For a parse to be considered successful, the size must be greater than 0 or the flag be true. In the case of there is multiple parse for the same location in text, the parser will choose the most successful parse - true and largest size.

[1] @char

The above will produce a result of size:1, flag:true.

[0] @char

The above will produce a result of size:0, flag:true.

# Imaging parsing the text ABC with the below
[1] "CAT"

The above scenario will produce a result of size:0, flag:false.

INSTRUCTIONS

Parser source instructions are grouped into options, series and items.

OPTION: ITEM | ITEM | ITEM
SERIES: ITEM ITEM ITEM
ITEM: COMMANDS, SERIES, OPTIONS

Options are separated by |, series are separated by spaces and a single item is an item. Each item in a series must be successful for the entire series to be successful, while only one of the option needs to be successful.

CMD1 CMD2 | CMD3 CMD4

So the above instruction would read #. process CMD1 then CMD2 OR #. process CMD3 then CMD4

CMD1 (CMD2 | CMD3) CMD4

We can use curve brackets to control which set of commands the or operator affects. So in the case of above: #. process CMD1 then (CMD2 or CMD3) then CMD4

The machine of the parser will test all or options to find the best (most successful) one unless the user use the FIRST command which makes the machine choose the first option that produces a successful result.