283
edits
KalmanKeri (talk | contribs) |
KalmanKeri (talk | contribs) (→Syntax) |
||
| Line 80: | Line 80: | ||
\begin{alignat}{2} | \begin{alignat}{2} | ||
& \mbox{Atoms}~ & | & \mbox{Atoms}~ & a, b \rule & \mathsf{A} \mid \mathsf{B} \mid \mathsf{'foo} \mid \mathsf{'bar} \mid ... \\ | ||
& \mbox{Variables}~ & v, w \rule & \mathsf{v} \mid \mathsf{w} \mid ... \\ | & \mbox{Variables}~ & v, w \rule & \mathsf{v} \mid \mathsf{w} \mid ... \\ | ||
& \mbox{Terms}~ & s, t, u \rule & ~ | & \mbox{Terms}~ & s, t, u \rule & ~ | ||
\show | \show a \seq s \mid \match a \seq s | ||
\mid \mathsf{v} | \mid \mathsf{v} | ||
\mid (s) | \mid (s) | ||
| Line 94: | Line 94: | ||
</math> | </math> | ||
'''Atoms''' are unscoped symbols. We assume a countably infinite set of atoms that is disjunct from the set of constants (operators and | '''Atoms''' are unscoped symbols. We assume a countably infinite set of atoms that is disjunct from the set of constants (operators, keywords and punctuation). | ||
There are two '''synchronization''' prefixes, <math>\show a \seq s</math> and <math>\match a \seq s</math>. | |||
'''Sequences''' are temporally ordered actions. The symbol <math>\succeed</math> denotes an empty sequence which can be interpreted as successful termination. | |||
Prefixes can be treated as specialized indivisible sequences. | |||
'''Sequences''' are ordered | |||
'''Nondeterministic choice''' is an enumeration of alternatives. <math>\textbf{fail}</math> denotes the lack of choices, or intuitively a failure to find any viable alternative. | '''Nondeterministic choice''' is an enumeration of alternatives. <math>\textbf{fail}</math> denotes the lack of choices, or intuitively a failure to find any viable alternative. | ||
| Line 109: | Line 106: | ||
<math>\pass</math> denotes a passive pipeline that transfers its input unchanged to the output. | <math>\pass</math> denotes a passive pipeline that transfers its input unchanged to the output. | ||
For better readability, let's define some syntax sugar that will be used throughout this article. Extend the syntax of | For better readability, let's define some syntax sugar that will be used throughout this article. Extend the syntax of terms as follows. | ||
<math>\mbox{ | <math>\mbox{Terms}~ s, t ::= ... \mid a \pto s \mid a \nto s \mbox{, where}</math> | ||
<math> | <math> | ||
\begin{alignat}{ | \begin{alignat}{1} | ||
~~~~ & a \pto s & = & ~\ | ~~~~ & a \pto s & = & ~\show a \seq s \\ | ||
~~~~ & a \nto s & = & ~\ | ~~~~ & a \nto s & = & ~\match a \seq s \\ | ||
\end{alignat} | \end{alignat} | ||
</math> | </math> | ||
| Line 129: | Line 126: | ||
|- | |- | ||
! style="text-align:left;"| Symbol | ! style="text-align:left;"| Symbol | ||
! style="text-align:left;"| Associativity<ref> | ! style="text-align:left;"| Associativity<ref> | ||
Notice that ''left or right associativity'' is a grammatical property of a binary operator, | Notice that ''left or right associativity'' is a grammatical property of a binary operator, | ||
| Line 138: | Line 134: | ||
! style="text-align:left;"| Precedence | ! style="text-align:left;"| Precedence | ||
|- | |- | ||
| <math>\seq~\pto~\nto</math> | | <math>\seq~\pto~\nto</math> || right || highest | ||
|- | |- | ||
| <math>\mid</math> | | <math>\mid</math> || right || | ||
|- | |- | ||
| <math>\rhd</math> | | <math>\rhd</math> || right || lowest | ||
|} | |} | ||
edits