I'm following the tutorial here. Under the heading The Cradle, you can see the code:
const TAB = ^I;
well this is a pascal code, actually I'm trying to re-implement those pascal code to Java or groovy(so that I can build a kind of compiler using Java or groovy). But what does the above coding statement meant in pascal?
How I can represent it in Java or Groovy?
Thanks in advance.
The
^I
is simply a short-hand forControl+I
, which is a representation of ASCII tab character (code 9). On old terminals, pressing (and holding) the control key while pressing a character produced the characters from the ASCII control character range (e.g., Ctrl+A = ASCII 1, ..., Ctrl+M = ASCII 13 = Newline, etc.)In Groovy, you should probably use
final char Tab = '\t'