RAD Studio
ContentsIndex
PreviousUpNext
Whitespace

Whitespace is the collective name given to spaces (blanks), horizontal and vertical tabs, newline characters, and comments. Whitespace can serve to indicate where tokens start and end, but beyond this function, any surplus whitespace is discarded. For example, the two sequences

int i; float f;

and

int i;
   float f;

are lexically equivalent and parse identically to give the six tokens:

  • int
  • i
  • ;
  • float
  • f
  • ;
The ASCII characters representing whitespace can occur within literal strings, in which case they are protected from the normal parsing process (they remain as part of the string). For example,

char name[] = "CodeGear Corporation";

parses to seven tokens, including the single literal-string token "CodeGear Corporation" 

Line splicing with \ 

A special case occurs if the final newline character encountered is preceded by a backslash (\). The backslash and new line are both discarded, allowing two physical lines of text to be treated as one unit.

"CodeGear \
Corporation"

is parsed as "CodeGear Corporationl" (see String constants for more information).

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!