Modules/oocAscii

From vishap oberon compiler
Jump to navigation Jump to search

Deutsch (de) | English (en) | հայերեն (hy)

Module oocAscii[edit]

Description[edit]

The Oberon-2 language report defines characters using ASCII (American Standard Code for Information Exchange) representation. Because of this, and for convenience, OOC provides module `Ascii', which defines useful constants corresponding to certain ASCII characters.

ASCII characters can be printable characters, such as letters and digits, and also non-printing characters such as tab and linefeed. ASCII only truly defines 128 characters; this means that the interpretation of the range from `80X' to `0FFX' may vary.

Constants for all of the standard ASCII names for non-printing characters are provided in module `Ascii':

CONST
  nul = 00X;     soh = 01X;     stx = 02X;
  etx = 03X;     eot = 04X;     enq = 05X;
  ack = 06X;     bel = 07X;     bs  = 08X;
  ht  = 09X;     lf  = 0AX;     vt  = 0BX;
  ff  = 0Ĉ;     cr  = 0DX;     so  = 0EX;
  si  = 0FX;     dle = 01X;     dc1 = 11X;
  dc2 = 12X;     dc3 = 13X;     dc4 = 14X;
  nak = 15X;     syn = 16X;     etb = 17X;
  can = 18X;     em  = 19X;     sub = 1AX;
  esc = 1BX;     fs  = 1Ĉ;     gs  = 1DX;
  rs  = 1EX;     us  = 1FX;     del = 7FX;

The most commonly used ASCII names have the following meanings:

bel -- bell
bs -- backspace
ht -- horizontal tabulator
vt -- vertical tabulator
lf -- line feed
ff -- form feed
cr -- carriage return
esc -- escape
del -- delete

Also, some often used synonyms are declared in module Ascii:

CONST 
  sp   = " ";
  xon  = dc1;
  xoff = dc3;

Origin[edit]

This module have been ported from the Optimizing Oberon Compiler's standard library.

This article was created by using Optimizing Oberon Compiler's Reference Manual as a source.