next up previous contents
Next: Core Syntax Up: Ur Syntax Previous: Ur Syntax   Contents

Lexical Conventions

We give the Ur language definition in LATEX$ \;$ math mode, since that is prettier than monospaced ASCII. The corresponding ASCII syntax can be read off directly. Here is the key for mapping math symbols to ASCII character sequences.

LATEX ASCII
$ \to$ ->
$ \longrightarrow$ ->
$ \times$ *
$ \lambda$ fn
$ \Rightarrow$ =>
$ \Longrightarrow$ ==>
$ \neq$ <>
$ \leq$ <=
$ \geq$ >=
   
$ x$ Normal textual identifier, not beginning with an uppercase letter
$ X$ Normal textual identifier, beginning with an uppercase letter

We often write syntax like $ e^*$ to indicate zero or more copies of $ e$ , $ e^+$ to indicate one or more copies, and $ e,^*$ and $ e,^+$ to indicate multiple copies separated by commas. Another separator may be used in place of a comma. The $ e$ term may be surrounded by parentheses to indicate grouping; those parentheses should not be included in the actual ASCII.

We write $ \ell$ for literals of the primitive types, for the most part following C conventions. There are $ \mathsf{int}$ , $ \mathsf{float}$ , $ \mathsf{char}$ , and $ \mathsf{string}$ literals. Character literals follow the SML convention instead of the C convention, written like #"a" instead of 'a'.

This version of the manual doesn't include operator precedences; see src/urweb.grm for that.

As in the ML language family, the syntax (* ... *) is used for (nestable) comments. Within XML literals, Ur/Web also supports the usual <!- ... -> XML comments.


next up previous contents
Next: Core Syntax Up: Ur Syntax Previous: Ur Syntax   Contents
2014-07-14