Next: Languages
Up: Lexical Analysis
Previous: Lexical Analysis
-
- Alphabet - a finite set of symbols. A member of an
alphabet is a "character" or "symbol".
- Example: A = {0,1} is the binary alphabet.
- Example: ASCII and EBCDIC are two programming alphabets.
- String - a finite sequence of symbols.
- |
| = the number of symbols in string
(length of
)
= string of length 0 (null or empty string)
- Example: 001101 is a string of length 6
- Concatenation of strings
and y - the string formed by
appending the symbols of
to the symbols of
, written as
or
.
- Example: Let
= abc and
= de (a,b,c,d,e are symbols;
,
are
strings).
= abcde
=
=
- Let
=
(i
's concatenated) and
=
. Then
=
= abcabc.
Note: Concatenation of strings is analogous to multiplication with
= 1, but is not commutative.
CS 631 Class Account
2009-10-13