The representation of (terminal) symbols in terms of characters is defined using the ASCII set. Symbols are identifiers, numbers, strings, operators, and delimiters. The following lexical rules must be observed: Blanks and line breaks must not occur within symbols (except in comments, and blanks in strings). They are ignored unless they are essential to separate two consecutive symbols. Capital and lower-case letters are considered as distinct.
ident = letter {letter | digit}.
Examples:
x Scan Oberon2 GetSymbol firstLetter
A real number always contains a decimal point. Optionally it may also contain a decimal scale factor. The letter E (or D) means "times ten to the power of". A real number is of type REAL, unless it has a scale factor containing the letter D. In this case it is of type LONGREAL.
number = integer | real.
integer = digit {digit} | digit{hexDigit}"H".
real = digit{digit}"."{digit} [ScaleFactor].
ScaleFactor = ("E" | "D") ["+" | "-"] digit {digit}.
hexDigit = digit |"A"|"B"|"C"|"D"|"E"|"F".
digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9".
Examples:
1991 INTEGER 1991 0DH SHORTINT 13 12.3 REAL 12.3 4.567E8 REAL 456700000 0.57712566D-6 LONGREAL 0.00000057712566
character = digit {hexDigit} "X".
string = '"' {char} '"' | "'" {char} "'".
Examples:
"Oberon-2" "Don't worry!" "x"
+ := ARRAY IMPORT RETURN - ^ BEGIN IN THEN * = BY IS TO / # CASE LOOP TYPE ~ < CONST MOD UNTIL & > DIV MODULE VAR . <= DO NIL WHILE , >= ELSE OF WITH ; .. ELSIF OR | : END POINTER ( ) EXIT PROCEDURE [ ] FOR RECORD { } IF REPEAT