Next Previous Contents

3. Vocabulary and Representation

Wherever it is possible, we use also EBNF for description of lexical symbols through ASCII set characters. Otherwise, we will use natural language sentences in < and >. Lexical symbols are identifiers, numbers, character constants, strings, operators, delimiters, and comments. White characters (blanks and line breaks) must not occur within the symbols (except in comments, and blanks in strings). White characters are ignored unless they are essential to separate two consecutive lexical symbols. Upper- and lower-case letters are considered to be distinct.

  1. An identifier is a sequence of letters and digits starting with a letter. The underline is believed to be a valid letter in an identifier.
              Ident = Letter {Letter | Digit}
    
              Letter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j"
                     | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t"
                     | "u" | "v" | "w" | "x" | "y" | "z"
                     | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
                     | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T"
                     | "U" | "V" | "W" | "X" | "Y" | "Z"
                     | "_"
    
              OctalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7"
    
              Digit = OctalDigit | "8" | "9"
    
    Examples:
              line  line2  next_line  NextLine
    
  2. Numbers are (unsigned) decimal integer or floating point numbers. Numbers start with a digit. Floating point numbers are distinguished by the presence of decimal point . or an exponent in the number.
              Number = Integer | FloatingPointNumber
    
              Integer = Digit {Digit}
    
              FloatingPointNumber = Digit {Digit} "." { Digit } [Exponent]
                                  | Digit {Digit} [Exponent]
    
              Exponent = ("e" | "E") [ "+" | "-" ] Digit { Digit }
    
    Examples:
              10
              100.
              1e2
              100.0E+0
    
  3. A Dino character constant denotes an ASCII character. The following sequences starting with the backslash have a special meaning inside a Dino character constant: To denote a single quote mark use the sequence \'. The double quote mark can be represented either by \" or simply by ". To represent a backslash inside the character constant, use two consecutive ASCII backslashes.
              Character = "'" Char "'"
    
              Char = <any ASCII character except for the single quote ',
                      backslash \, or line break>
                   | SimpleEscapeSeq
                   | OctalEscapeSeq
    
              SimpleEscapeSeq = <one of  \'  \"  \\  \a  \b  \f  \n  \r  \t  \v>
    
              OctalEscapeSeq = "\" OctalDigit [ OctalDigit [ OctalDigit ] ]
    
    Examples:
              'a'  '\''  '\\'  '\12'  '"'
    
  4. A string is sequence of ASCII characters enclosed in double quotes. There are the same sequences of ASCII characters with special meaning as in a character constant. To denote a double quote mark use sequence \". The single quote mark can be represented either by \' or simply by '. To represent a backslash inside the character constant, use two consecutive ASCII backslashes.
              String = '"' {Char} '"'
    
    Examples:
              "This is Dino"  "Don't worry\n"
    
  5. The remaining essential symbols are called operators and delimiters. Operators are used for forming expressions, delimiters are used for forming syntax constructions. There is a special kind of operators and delimiters which look like identifiers containing only lower-case letters. They are reserved identifiers (keywords). Keywords can not be used in the place of an identifier.
              OperatorOrDelimeter = "?" | ":" | "|" | "||" | "&" | "&&" | "^"
                                  | "==" | "!=" | "===" | "!==" | "<" | ">"
                                  | "<=" | ">=" | "<<" | ">>" | ">>>" | "@"
                                  | "+" | "-" | "/" | "*" | "%" | "!" | "+"
                                  | "-" | "~" | "#" | "(" | ")" | "[" | "]"
                                  | "{" | "}" | "." | "," | ";" | "="
                                  | "*=" | "/=" | "%=" | "+=" | "-="
                                  | "@=" | "<<=" | ">>=" | ">>>=" | "&="
                                  | "^=" | "|=" | "++" | "--" | "..." | "<=>"
                                  | Keyword
    
              Keyword = "break" | "catch" | "char" | "class" | "continue"
                      | "else" | "ext" | "extern"
                      | "final" | "float" | "for" | "friend" | "func"
                      | "hide" | "hideblock" | "if" | "in" | "int"
                      | "new" | "nil" | "public" | "private" | "return"
                      | "table" | "thread" | "throw" | "try" | "type"
                      | "var" | "vector" | "wait"
    
  6. Comments are considered analogous to blanks on the syntax level of the program. There are two types of comments. The first type is an arbitrary character sequence starting with /* and finishing with */. The second type of comment starts with // and finishes with the first line break or with the end of file.
              Comment = "/*" <arbitrary char. sequence not containing pair */> "*/"
                      | "//" <arbitrary char. sequence finishing on line break>
    


Next Previous Contents