\[ \newcommand{\tr}{\Rightarrow} \newcommand{\trs}{\tr^{\!\ast}} \newcommand{\rlnm}[1]{\mathsf{(#1)}} \newcommand{\rred}[1]{\xrightarrow{#1}} \newcommand{\rreds}[1]{\mathrel{\xrightarrow{#1}\!\!^*}} \newcommand{\cl}{\mathsf{Cl}} \newcommand{\pow}{\mathcal{P}} \newcommand{\matches}{\mathrel{\mathsf{matches}}} \newcommand{\kw}[1]{\mathsf{#1}} \newcommand{\andop}{\mathrel{\&\!\&}} \newcommand{\orop}{\parallel} \newcommand{\ff}{\mathsf{false}} \newcommand{\tt}{\mathsf{true}} \newcommand{\abra}[1]{\langle #1 \rangle} \newcommand{\bnfnt}[1]{\abra{\small \textsf{#1}}} \newcommand{\llbracket}{[\![} \newcommand{\rrbracket}{]\!]} \newcommand{\first}{\mathsf{First}} \newcommand{\nullable}{\mathsf{Nullable}} \newcommand{\follow}{\mathsf{Follow}} \newcommand{\tm}[1]{\mathsf{#1}} \newcommand{\nt}[1]{\mathit{#1}} \newcommand{\Coloneqq}{::=} \newcommand{\abs}[1]{|#1|} \]

For Brischeme, the lexemes are the largest substrings not containing whitespace that fall into one of the following classifications (classifications given in bold):

  • The substrings (, ) are the left (lparen) and right (rpraren) parentheses.
  • The substrings +, -, *, /, <, =, not, and, or are the primops (primitive operators).
  • The substring define is the keyword define and the substring lambda is the keyword lambda.
  • Any non-empty sequence of digits 0-9, and the substrings #t and #f are literals (number literals and Boolean literals respectively).
  • Any non-empty substring, not falling into one of the above classes, that:
    • begins with a lowercase letter of the English alphabet
    • proceeds with letters that are either lower or upper case letters of the English alphabet, the underscore, an exclamation mark, a question mark or digits

    is an ident (identifier).