Link Search Menu Expand Document
\( % cbs-katex.sty % \newcommand{\STYLE}[2]{\htmlClass{cbs-#1}{#2}} \newcommand{\DECL}[3]{\htmlId{#1:#2}{#3}} \newcommand{\REF}[3]{\href{###1:#2}{#3}} \newcommand{\HYPER}[5]{\href{#1/#2/index.html###3:#4}{#5}} % \SHADE{MATH} can be defined to produce a shaded background to highlight % inline MATH in running text: \newcommand{\SHADE}[1]{#1} % \KEY{TEXT}, \STRING{TEXT}, \ATOM{TEXT}, \LEX{TEXT} can be used in math mode: \newcommand{\KEY}[1]{\textsf{\textit{\STYLE{Key}{#1}}}} \newcommand{\STRING}[1]{\textsf{``\texttt{#1}''}} \newcommand{\ATOM}[1]{\textsf{`\texttt{#1}'}} \newcommand{\LEX}[1]{\textsf{\STYLE{Key}{`}\texttt{#1}\STYLE{Key}{'}}} % The following commands produce ASCII characters that are treated specially by LaTeX: \newcommand{\HASH}{\char`\#} \newcommand{\DOLLAR}{\char`\$} \newcommand{\PERCENT}{\char`\%} \newcommand{\AMPERSAND}{\char`\&} \newcommand{\APOSTROPHE}{\char`\'} \newcommand{\BACKSLASH}{\char`\\} \newcommand{\CARET}{\char`\^} \newcommand{\UNDERSCORE}{\char`\_} \newcommand{\GRAVE}{\char`\`} \newcommand{\LEFTBRACE}{\char`\{} \newcommand{\RIGHTBRACE}{\char`\}} \newcommand{\TILDE}{\textasciitilde} % {\char`\~} % \NAME{name} highlights the name; % \NAMEDECL{name} declares Name.name as the target of links to name; % \NAMEREF{name} links name to the target Name.name in the current file; % \NAMEHYPER{url}{file}{name} links name to Name.name at url/file/file.pdf. % Similarly for \VAR{partvariable}, \SYN{syntaxname}, \SEM{semanticsName}, % and \SECT{sectionnumber} % The kerns in \SUB and \VAR avoid overlaps with primes: \newcommand{\SUB}[1]{_{\kern-2mu\STYLE{PartVariable}{\textsf{#1}}}} % PLAIN \newcommand{\VAR}[1]{\STYLE{PartVariable}{\textsf{\textit{#1}\kern2mu}}} \newcommand{\NAME}[1]{\STYLE{Name}{\textsf{#1}}} \newcommand{\SYN}[1]{\STYLE{SyntaxName}{\textsf{#1}}} \newcommand{\SEM}[1]{\STYLE{SemanticsName}{\textsf{#1}}} \newcommand{\SECT}[1]{\STYLE{SectionNumber}{\textsf{#1}}} % DECL \newcommand{\VARDECL}[1]{\DECL{PartVariable}{#1}{\VAR{#1}}} \newcommand{\NAMEDECL}[1]{\DECL{Name}{#1}{\NAME{#1}}} \newcommand{\SYNDECL}[1]{\DECL{SyntaxName}{#1}{\SYN{#1}}} \newcommand{\SEMDECL}[1]{\DECL{SemanticsName}{#1}{\SEM{#1}}} \newcommand{\SECTDECL}[1]{\DECL{SectionNumber}{#1}{\textsf{#1}}} % REF \newcommand{\VARREF}[1]{\REF{PartVariable}{#1}{\VAR{#1}}} \newcommand{\NAMEREF}[1]{\REF{Name}{#1}{\NAME{#1}}} \newcommand{\SYNREF}[1]{\REF{SyntaxName}{#1}{\SYN{#1}}} \newcommand{\SEMREF}[1]{\REF{SemanticsName}{#1}{\SEM{#1}}} \newcommand{\SECTREF}[1]{\REF{SectionNumber}{#1}{\SECT{#1}}} % HYPER \newcommand{\VARHYPER}[3]{\HYPER{#1}{#2}{PartVariable}{#3}{\VAR{#3}}} \newcommand{\NAMEHYPER}[3]{\HYPER{#1}{#2}{Name}{#3}{\NAME{#3}}} \newcommand{\SYNHYPER}[3]{\HYPER{#1}{#2}{SyntaxName}{#3}{\SYN{#3}}} \newcommand{\SEMHYPER}[3]{\HYPER{#1}{#2}{SemanticsName}{#3}{\SEM{#3}}} \newcommand{\SECTHYPER}[3]{\HYPER{#1}{#2}{SectionNumber}{#3}{\SECT{#3}}} % \LEFTPHRASE MATH \RIGHTPHRASE produces [[ MATH ]] with proper brackets: \newcommand{\LEFTPHRASE}{\llbracket} \newcommand{\RIGHTPHRASE}{\rrbracket} % \LEFTGROUP MATH \RIGHTGROUP produces ( MATH ) where the parentheses are % highlighted the same as keywords: \newcommand{\LEFTGROUP}{\STYLE{Key}{(}} \newcommand{\RIGHTGROUP}{\STYLE{Key}{)}} % MATH\PLUS produces a superscript + % MATH\STAR produces a superscript * % MATH\QUERY produces a superscript ? \newcommand{\PLUS}{{}^{\texttt{+}}} \newcommand{\STAR}{{}^{\texttt{*}}} \newcommand{\QUERY}{{}^{\texttt{?}}} % \RULE{& PREMISE \\ & ...}{& FORMULA ... \\ & ...} produces an inference rule % with separately aligned premises and conclusion % PREMISE % ... % ----------- % FORMULA ... % ... \newcommand{\RULE}[2] {\frac{\begin{aligned}#1\end{aligned}}{\begin{aligned}#2\end{aligned}}} % \AXIOM{& FORMULA ... \\ & ...} produces an aligned formula % % FORMULA ... % ... \newcommand{\AXIOM}[1]{\begin{aligned}#1\end{aligned}} % \TO TYPE produces => TYPE \newcommand{\TO}{\mathop{\Rightarrow}} % TERM \TRANS TERM produces TERM ---> TERM \newcommand{\TRANS}{\longrightarrow} % TERM \xrightarrow{LABEL} TERM puts the label above the long arrow % \)

Languages-beta : OC-L-01-Lexical-Conventions.cbs | PLAIN | PDF

OUTLINE

\[\KEY{Language} \quad \STRING{OCaml Light}\]

\(\SECT{1}\) Lexical conventions

Identifiers

\[\begin{align*} \KEY{Lexis} \quad \VARDECL{I} : \SYNDECL{ident} \ ::= \ & \ \SYNREF{capitalized-ident} \mid \SYNREF{lowercase-ident} \\ \VARDECL{CI} : \SYNDECL{capitalized-ident} \ ::= \ & \ \SYNREF{uppercase} \ \LEFTGROUP \SYNREF{uppercase} \mid \SYNREF{lowercase} \mid \SYNREF{decimal} \mid \LEX{{\UNDERSCORE}} \mid \LEX{{\APOSTROPHE}} \RIGHTGROUP\STAR \\ \VARDECL{LI} : \SYNDECL{lowercase-ident} \ ::= \ & \ \SYNREF{lowercase} \ \LEFTGROUP \SYNREF{uppercase} \mid \SYNREF{lowercase} \mid \SYNREF{decimal} \mid \LEX{{\UNDERSCORE}} \mid \LEX{{\APOSTROPHE}} \RIGHTGROUP\STAR \\ \ \mid \ & \ \LEX{{\UNDERSCORE}} \ \LEFTGROUP \SYNREF{uppercase} \mid \SYNREF{lowercase} \mid \SYNREF{decimal} \mid \LEX{{\UNDERSCORE}} \mid \LEX{{\APOSTROPHE}} \RIGHTGROUP\PLUS \\ \SYNDECL{uppercase} \ ::= \ & \ \LEX{A} {-} \LEX{Z} \\ \SYNDECL{lowercase} \ ::= \ & \ \LEX{a} {-} \LEX{z} \\ \SYNDECL{decimal} \ ::= \ & \ \LEX{0} {-} \LEX{9} \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{id} \LEFTPHRASE \ \_ : \SYNREF{ident} \ \RIGHTPHRASE : \NAMEHYPER{../../../../../Funcons-beta/Computations/Normal}{Binding}{ids} \\ \KEY{Rule} \quad & \SEMREF{id} \LEFTPHRASE \ \VARREF{I} \ \RIGHTPHRASE = \textsf{\textquotedblleft}\VAR{I}\textsf{\textquotedblright} \end{align*}\]

Integer literals

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{IL} : \SYNDECL{integer-literal} \ ::= \ & \ \LEX{{-}}\QUERY \_ \SYNREF{natural-literal} \\ \VARDECL{NL} : \SYNDECL{natural-literal} \ ::= \ & \ \SYNREF{decimal-plus} \\ \ \mid \ & \ \LEFTGROUP \LEX{0x} \mid \LEX{0X} \RIGHTGROUP \ \SYNREF{hexadecimal-plus} \\ \ \mid \ & \ \LEFTGROUP \LEX{0o} \mid \LEX{0O} \RIGHTGROUP \ \SYNREF{octal-plus} \\ \ \mid \ & \ \LEFTGROUP \LEX{0b} \mid \LEX{0B} \RIGHTGROUP \ \SYNREF{binary-plus} \\ \KEY{Lexis} \quad \VARDECL{DP} : \SYNDECL{decimal-plus} \ ::= \ & \ \SYNREF{decimal}\PLUS \\ \VARDECL{HP} : \SYNDECL{hexadecimal-plus} \ ::= \ & \ \LEFTGROUP \SYNREF{decimal} \mid \LEX{A} {-} \LEX{F} \mid \LEX{a} {-} \LEX{f} \RIGHTGROUP\PLUS \\ \VARDECL{OP} : \SYNDECL{octal-plus} \ ::= \ & \ \LEFTGROUP \LEX{0} {-} \LEX{7} \RIGHTGROUP\PLUS \\ \VARDECL{BP} : \SYNDECL{binary-plus} \ ::= \ & \ \LEFTGROUP \LEX{0} \mid \LEX{1} \RIGHTGROUP\PLUS \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{integer-value} \LEFTPHRASE \ \_ : \SYNREF{integer-literal} \ \RIGHTPHRASE : \TO \NAMEHYPER{../.}{OC-L-02-Values}{implemented-integers} \\ \KEY{Rule} \quad & \SEMREF{integer-value} \LEFTPHRASE \ \LEX{{-}} \ \VARREF{NL} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Integers}{integer-negate} ( \SEMREF{integer-value} \LEFTPHRASE \ \VAR{NL} \ \RIGHTPHRASE ) \\ \KEY{Rule} \quad & \SEMREF{integer-value} \LEFTPHRASE \ \VARREF{DP} \ \RIGHTPHRASE = \NAMEHYPER{../.}{OC-L-02-Values}{implemented-integer} \ \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Integers}{decimal-natural} ( \textsf{\textquotedblleft}\VAR{DP}\textsf{\textquotedblright} ) \end{align*}\]

Floating-point literals

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{FL} : \SYNDECL{float-literal} \ ::= \ & \ \LEX{{-}}\QUERY \_ \SYNREF{non-negative-float-literal} \\ \VARDECL{NNFL} : \SYNDECL{non-negative-float-literal} \ ::= \ & \ \SYNREF{decimal-plus} \_ \LEX{{.}} \_ \SYNREF{decimal-plus} \\ \ \mid \ & \ \SYNREF{decimal-plus} \_ \LEX{{.}} \\ \ \mid \ & \ \SYNREF{decimal-plus} \_ \LEX{{.}} \_ \SYNREF{decimal-plus} \_ \SYNREF{float-exponent} \\ \ \mid \ & \ \SYNREF{decimal-plus} \_ \LEX{{.}} \_ \SYNREF{float-exponent} \\ \ \mid \ & \ \SYNREF{decimal-plus} \_ \SYNREF{float-exponent} \\ \VARDECL{FE} : \SYNDECL{float-exponent} \ ::= \ & \ \LEFTGROUP \LEX{e} \mid \LEX{E} \RIGHTGROUP \_ \LEFTGROUP \LEX{{+}} \mid \LEX{{-}} \RIGHTGROUP\QUERY \_ \SYNREF{decimal-plus} \end{align*}\] \[\begin{align*} \KEY{Rule} \quad & \LEFTPHRASE \ \VARREF{DP}\SUB{1} \ \LEX{{.}} \ \VARREF{DP}\SUB{2} \ \RIGHTPHRASE : \SYNREF{non-negative-float-literal} = \LEFTPHRASE \ \VAR{DP}\SUB{1} \ \LEX{{.}} \ \VAR{DP}\SUB{2} \ \LEX{e} \ \LEX{1} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \VARREF{DP} \ \LEX{{.}} \ \RIGHTPHRASE : \SYNREF{non-negative-float-literal} = \LEFTPHRASE \ \VAR{DP} \ \LEX{{.}} \ \LEX{0} \ \LEX{e} \ \LEX{1} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \VARREF{DP} \ \LEX{{.}} \ \VARREF{FE} \ \RIGHTPHRASE : \SYNREF{non-negative-float-literal} = \LEFTPHRASE \ \VAR{DP} \ \LEX{{.}} \ \LEX{0} \ \VAR{FE} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \VARREF{DP} \ \VARREF{FE} \ \RIGHTPHRASE : \SYNREF{non-negative-float-literal} = \LEFTPHRASE \ \VAR{DP} \ \LEX{{.}} \ \LEX{0} \ \VAR{FE} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \LEX{e} \ \LEX{{+}} \ \VARREF{DP} \ \RIGHTPHRASE : \SYNREF{float-exponent} = \LEFTPHRASE \ \LEX{e} \ \VAR{DP} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \LEX{E} \ \LEX{{+}} \ \VARREF{DP} \ \RIGHTPHRASE : \SYNREF{float-exponent} = \LEFTPHRASE \ \LEX{e} \ \VAR{DP} \ \RIGHTPHRASE \\ \KEY{Rule} \quad & \LEFTPHRASE \ \LEX{E} \ \LEX{{-}} \ \VARREF{DP} \ \RIGHTPHRASE : \SYNREF{float-exponent} = \LEFTPHRASE \ \LEX{e} \ \LEX{{-}} \ \VAR{DP} \ \RIGHTPHRASE \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{float-value} \LEFTPHRASE \ \_ : \SYNREF{float-literal} \ \RIGHTPHRASE : \TO \NAMEHYPER{../.}{OC-L-02-Values}{implemented-floats} \end{align*}\]

\(\SHADE{\SEMREF{float-value} \LEFTPHRASE \ \_ \ \RIGHTPHRASE }\) is unspecified if the literal value is not representable in \(\SHADE{\NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Floats}{floats} ( \NAMEHYPER{../.}{OC-L-02-Values}{implemented-floats-format} )}\).

\[\begin{align*} \KEY{Rule} \quad & \SEMREF{float-value} \LEFTPHRASE \ \LEX{{-}} \ \VARREF{NNFL} \ \RIGHTPHRASE = \\&\quad \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Floats}{float-negate} ( \NAMEHYPER{../.}{OC-L-02-Values}{implemented-floats-format}, \SEMREF{float-value} \LEFTPHRASE \ \VAR{NNFL} \ \RIGHTPHRASE ) \\ \KEY{Rule} \quad & \SEMREF{float-value} \LEFTPHRASE \ \VARREF{DP}\SUB{1} \ \LEX{{.}} \ \VARREF{DP}\SUB{2} \ \LEX{e} \ \VARREF{DP}\SUB{3} \ \RIGHTPHRASE = \\&\quad \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Floats}{decimal-float} ( \\&\quad\quad \NAMEHYPER{../.}{OC-L-02-Values}{implemented-floats-format}, \textsf{\textquotedblleft}\VAR{DP}\SUB{1}\textsf{\textquotedblright}, \textsf{\textquotedblleft}\VAR{DP}\SUB{2}\textsf{\textquotedblright}, \textsf{\textquotedblleft}\VAR{DP}\SUB{3}\textsf{\textquotedblright} ) \\ \KEY{Rule} \quad & \SEMREF{float-value} \LEFTPHRASE \ \VARREF{DP}\SUB{1} \ \LEX{{.}} \ \VARREF{DP}\SUB{2} \ \LEX{e} \ \LEX{{-}} \ \VARREF{DP}\SUB{3} \ \RIGHTPHRASE = \\&\quad \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Floats}{decimal-float} ( \\&\quad\quad \NAMEHYPER{../.}{OC-L-02-Values}{implemented-floats-format}, \textsf{\textquotedblleft}\VAR{DP}\SUB{1}\textsf{\textquotedblright}, \textsf{\textquotedblleft}\VAR{DP}\SUB{2}\textsf{\textquotedblright}, \NAMEHYPER{../../../../../Funcons-beta/Values/Composite}{Lists}{cons} ( \ATOM{{-}}, \textsf{\textquotedblleft}\VAR{DP}\SUB{3}\textsf{\textquotedblright} ) ) \end{align*}\]

Character literals

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{CL} : \SYNDECL{char-literal} \ ::= \ & \ \LEX{{\APOSTROPHE}} \_ \SYNREF{regular-char} \_ \LEX{{\APOSTROPHE}} \\ \ \mid \ & \ \LEX{{\APOSTROPHE}} \_ \SYNREF{escape-sequence} \_ \LEX{{\APOSTROPHE}} \\ \VARDECL{ES} : \SYNDECL{escape-sequence} \ ::= \ & \ \LEX{{\BACKSLASH}} \_ \SYNREF{escaped-char} \\ \ \mid \ & \ \LEX{{\BACKSLASH}} \_ \SYNREF{escaped-char-code} \\ \KEY{Lexis} \quad \VARDECL{RC} : \SYNDECL{regular-char} \ ::= \ & \ \mathop{\sim} \LEFTGROUP \LEX{{\APOSTROPHE}} \mid \LEX{{\BACKSLASH}} \RIGHTGROUP \\ \VARDECL{EC} : \SYNDECL{escaped-char} \ ::= \ & \ \LEX{{\BACKSLASH}} \mid \LEX{{"}} \mid \LEX{{\APOSTROPHE}} \mid \LEX{n} \mid \LEX{t} \mid \LEX{b} \mid \LEX{r} \mid \LEX{~} \\ \VARDECL{ECC} : \SYNDECL{escaped-char-code} \ ::= \ & \ \SYNREF{decimal} \ \SYNREF{decimal} \ \SYNREF{decimal} \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{character-value} \LEFTPHRASE \ \_ : \SYNREF{char-literal} \ \RIGHTPHRASE : \TO \NAMEHYPER{../.}{OC-L-02-Values}{implemented-characters} \\ \KEY{Rule} \quad & \SEMREF{character-value} \LEFTPHRASE \ \LEX{{\APOSTROPHE}} \ \VARREF{RC} \ \LEX{{\APOSTROPHE}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{ascii-character} ( \textsf{\textquotedblleft}\VAR{RC}\textsf{\textquotedblright} ) \\ \KEY{Rule} \quad & \SEMREF{character-value} \LEFTPHRASE \ \LEX{{\APOSTROPHE}} \ \VARREF{ES} \ \LEX{{\APOSTROPHE}} \ \RIGHTPHRASE = \SEMREF{capture} \LEFTPHRASE \ \VAR{ES} \ \RIGHTPHRASE \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{capture} \LEFTPHRASE \ \_ : \SYNREF{escape-sequence} \ \RIGHTPHRASE : \NAMEHYPER{../.}{OC-L-02-Values}{implemented-characters} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{{\BACKSLASH}} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{backslash} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{{\APOSTROPHE}} \ \RIGHTPHRASE = \ATOM{{\APOSTROPHE}} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{n} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{line-feed} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{t} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{horizontal-tab} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{b} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{backspace} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \LEX{r} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{carriage-return} \\ \KEY{Rule} \quad & \SEMREF{capture} \LEFTPHRASE \ \LEX{{\BACKSLASH}} \ \VARREF{ECC} \ \RIGHTPHRASE = \\&\quad \NAMEHYPER{../../../../../Funcons-beta/Computations/Abnormal}{Failing}{checked} \ \NAMEHYPER{../.}{OC-L-02-Values}{implemented-character} \ \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{unicode-character} \ \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Integers}{decimal-natural} ( \textsf{\textquotedblleft}\VAR{ECC}\textsf{\textquotedblright} ) \end{align*}\]

String literals

\[\begin{align*} \KEY{Syntax} \quad \VARDECL{SL} : \SYNDECL{string-literal} \ ::= \ & \ \LEX{{"}} \_ \SYNREF{string-character-star} \_ \LEX{{"}} \\ \VARDECL{SCS} : \SYNDECL{string-character-star} \ ::= \ & \ \SYNREF{string-character} \_ \SYNREF{string-character-star} \\ \ \mid \ & \ \LEFTGROUP \RIGHTGROUP \\ \VARDECL{SC} : \SYNDECL{string-character} \ ::= \ & \ \SYNREF{regular-string-char} \\ \ \mid \ & \ \SYNREF{escape-sequence} \\ \KEY{Lexis} \quad \VARDECL{RSC} : \SYNDECL{regular-string-char} \ ::= \ & \ \mathop{\sim} \LEFTGROUP \LEX{{"}} \mid \LEX{{\BACKSLASH}} \RIGHTGROUP \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{string-value} \LEFTPHRASE \ \_ : \SYNREF{string-literal} \ \RIGHTPHRASE : \TO \NAMEHYPER{../.}{OC-L-02-Values}{implemented-strings} \\ \KEY{Rule} \quad & \SEMREF{string-value} \LEFTPHRASE \ \LEX{{"}} \ \VARREF{SCS} \ \LEX{{"}} \ \RIGHTPHRASE = \\&\quad \NAMEHYPER{../../../../../Funcons-beta/Computations/Abnormal}{Failing}{checked} \ \NAMEHYPER{../.}{OC-L-02-Values}{implemented-string} \ [ \SEMREF{string-chars} \LEFTPHRASE \ \VAR{SCS} \ \RIGHTPHRASE ] \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{string-chars} \LEFTPHRASE \ \_ : \SYNREF{string-character-star} \ \RIGHTPHRASE : \TO \NAMEHYPER{../.}{OC-L-02-Values}{implemented-characters}\STAR \\ \KEY{Rule} \quad & \SEMREF{string-chars} \LEFTPHRASE \ \ \RIGHTPHRASE = \ \\ \KEY{Rule} \quad & \SEMREF{string-chars} \LEFTPHRASE \ \VARREF{SC} \ \VARREF{SCS} \ \RIGHTPHRASE = \SEMREF{string-capture} \LEFTPHRASE \ \VAR{SC} \ \RIGHTPHRASE , \SEMREF{string-chars} \LEFTPHRASE \ \VAR{SCS} \ \RIGHTPHRASE \end{align*}\] \[\begin{align*} \KEY{Semantics} \quad & \SEMDECL{string-capture} \LEFTPHRASE \ \_ : \SYNREF{string-character} \ \RIGHTPHRASE : \NAMEHYPER{../.}{OC-L-02-Values}{implemented-characters} \\ \KEY{Rule} \quad & \SEMREF{string-capture} \LEFTPHRASE \ \VARREF{RSC} \ \RIGHTPHRASE = \NAMEHYPER{../../../../../Funcons-beta/Values/Primitive}{Characters}{ascii-character} ( \textsf{\textquotedblleft}\VAR{RSC}\textsf{\textquotedblright} ) \\ \KEY{Rule} \quad & \SEMREF{string-capture} \LEFTPHRASE \ \VARREF{ES} \ \RIGHTPHRASE = \SEMREF{capture} \LEFTPHRASE \ \VAR{ES} \ \RIGHTPHRASE \end{align*}\]

Prefix and infix symbols

\[\begin{align*} \KEY{Lexis} \quad \VARDECL{PS} : \SYNDECL{prefix-symbol} \ ::= \ & \ \LEX{{!}} \ \SYNREF{operator-char}\STAR \\ \ \mid \ & \ \LEFTGROUP \LEX{{?}} \mid \LEX{{\TILDE}} \RIGHTGROUP \ \SYNREF{operator-char}\PLUS \\ \SYNDECL{operator-char} \ ::= \ & \ \LEX{{!}} \mid \LEX{{\DOLLAR}} \mid \LEX{{\PERCENT}} \mid \LEX{{\AMPERSAND}} \mid \LEX{{*}} \mid \LEX{{+}} \mid \LEX{{-}} \mid \LEX{{.}} \mid \LEX{{/}} \\ \ \mid \ & \ \LEX{{:}} \mid \LEX{{<}} \mid \LEX{{=}} \mid \LEX{{>}} \mid \LEX{{?}} \mid \LEX{{@}} \mid \LEX{{\CARET}} \mid \LEX{{|}} \mid \LEX{{\TILDE}} \\ \SYNDECL{operator-char-not-asterisk} \ ::= \ & \ \LEX{{!}} \mid \LEX{{\DOLLAR}} \mid \LEX{{\PERCENT}} \mid \LEX{{\AMPERSAND}} \mid \LEX{{+}} \mid \LEX{{-}} \mid \LEX{{.}} \mid \LEX{{/}} \\ \ \mid \ & \ \LEX{{:}} \mid \LEX{{<}} \mid \LEX{{=}} \mid \LEX{{>}} \mid \LEX{{?}} \mid \LEX{{@}} \mid \LEX{{\CARET}} \mid \LEX{{|}} \mid \LEX{{\TILDE}} \\ \SYNDECL{operator-char-not-bar} \ ::= \ & \ \LEX{{!}} \mid \LEX{{\DOLLAR}} \mid \LEX{{\PERCENT}} \mid \LEX{{\AMPERSAND}} \mid \LEX{{*}} \mid \LEX{{+}} \mid \LEX{{-}} \mid \LEX{{.}} \mid \LEX{{/}} \\ \ \mid \ & \ \LEX{{:}} \mid \LEX{{<}} \mid \LEX{{=}} \mid \LEX{{>}} \mid \LEX{{?}} \mid \LEX{{@}} \mid \LEX{{\CARET}} \mid \LEX{{\TILDE}} \\ \SYNDECL{operator-char-not-ampersand} \ ::= \ & \ \LEX{{!}} \mid \LEX{{\DOLLAR}} \mid \LEX{{\PERCENT}} \mid \LEX{{*}} \mid \LEX{{+}} \mid \LEX{{-}} \mid \LEX{{.}} \mid \LEX{{/}} \\ \ \mid \ & \ \LEX{{:}} \mid \LEX{{<}} \mid \LEX{{=}} \mid \LEX{{>}} \mid \LEX{{?}} \mid \LEX{{@}} \mid \LEX{{\CARET}} \mid \LEX{{|}} \mid \LEX{{\TILDE}} \end{align*}\]

Keywords

\[\begin{align*} \KEY{Lexis} \quad \SYNDECL{keyword} \ ::= \ & \ \LEX{and} \mid \LEX{as} \mid \LEX{assert} \mid \LEX{asr} \mid \LEX{begin} \mid \LEX{class} \\ \ \mid \ & \ \LEX{constraint} \mid \LEX{do} \mid \LEX{done} \mid \LEX{downto} \mid \LEX{else} \mid \LEX{end} \\ \ \mid \ & \ \LEX{exception} \mid \LEX{external} \mid \LEX{false} \mid \LEX{for} \mid \LEX{fun} \mid \LEX{function} \\ \ \mid \ & \ \LEX{functor} \mid \LEX{if} \mid \LEX{in} \mid \LEX{include} \mid \LEX{inherit} \mid \LEX{initializer} \\ \ \mid \ & \ \LEX{land} \mid \LEX{lazy} \mid \LEX{let} \mid \LEX{lor} \mid \LEX{lsl} \mid \LEX{lsr} \\ \ \mid \ & \ \LEX{lxor} \mid \LEX{match} \mid \LEX{method} \mid \LEX{mod} \mid \LEX{module} \mid \LEX{mutable} \\ \ \mid \ & \ \LEX{new} \mid \LEX{nonrec} \mid \LEX{object} \mid \LEX{of} \mid \LEX{open} \mid \LEX{or} \\ \ \mid \ & \ \LEX{private} \mid \LEX{rec} \mid \LEX{sig} \mid \LEX{struct} \mid \LEX{then} \mid \LEX{to} \\ \ \mid \ & \ \LEX{true} \mid \LEX{try} \mid \LEX{type} \mid \LEX{val} \mid \LEX{virtual} \mid \LEX{when} \\ \ \mid \ & \ \LEX{while} \mid \LEX{with} \end{align*}\]