Scarlet Line home page Scarlet Line - SOFTWARE DESIGN & DEVELOPMENT

[Home]->[Documentation]->[Syntac Universal Parser]->[Glossary]

Expand All
Collapse All
Contents

syntac glossary

Alternation Node

Any one of the child nodes.

This is often thought of as OR because it matches node one or node two or ...

The example will match either of the following two sub-strings:

A
B

Declaration

union_ ::= 'A|B'

Composition


State Machine


Concatenation Node

Each of the child nodes, in the order defined.

This is sometimes thought of as AND because it matches node one and then node two and then ...

In the example the following sub-string will match:

AB

Declaration

concatenate ::= 'AB'

Composition


State Machine


Iteration Node

Zero or more instances of the child node.

In the example, the following sub-strings, including the empty string, will match:


A
AA
AAA
AAAA
...

Declaration

iterate ::= 'A*'

Composition


State Machine


Unconsumed Tail Node

This indicates a pattern that needs to be matched, but the matching sub-string is not consumed, and is thus available for subsequent patterns.

In the example, the following sub-string will match (and the B will be the first character for subsequent pattern matching):

AB

Declaration

unconsumed ::= 'A/B'

Composition


State Machine


Terminal

A terminal matches one of the characters listed within the square brackets.
Here is the complete 7-bit ASCII range in familiar form:

[\x00-\x06\a\b\t\n\v\f\r\x0E-\x1F !\"#$%&\'()*+,\-\./0-9:;<=>?@A-Z\[\\\]^_`a-z{|}~\x7F]

In the example, any of the following ten single character length sub-strings will match:

0
1
2
3
4
5
6
7
8
9

Declaration

digits ::= '[0-9]'

Composition


State Machine


Special Terminals

These are the special terminals that have meaning other than as a single character match.

Finalize

If this node is reached, then only the most direct path is kept, and alternate match paths are discarded. This is useful, for example, when writing a telnet line based interpreter, or to speed up complicated parsers.

Declaration

final ::= 'A' !

Composition


State Machine


Never Match

Matches no character whatsoever. This never matches. Compare with "Match Nothing" below.

Declaration

never ::= ~

Composition


State Machine


Match Nothing

Match the zero length string. This always matches. Compare with "Never Match" above.

Declaration

nothing ::= @

Composition


State Machine


Start of Line

Match only if at the start of a line.

Declaration

start_of_line ::= '^A'

Composition


State Machine


End of File

Match only if at the end of the file.

Declaration

end_of_file ::= '\z'

Composition


State Machine