Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Manuel d'utilisateur Page 9

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 82
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 8
File-based Decoding User Manual Chapter 2: Values
LeCroy Corporation 3
Chapter 2: Values
There are five value types that may be manipulated by a script: integers, strings, lists,
raw bytes, and null. CSL is not a strongly typed language. Value types need not be
p
re-declared. Literals, variables and constants can take on any of the five value types,
and the types can be reassigned dynamically.
2.1 Literals
Literals are data that remain unchanged when the program is compiled. Literals are a way
of expressing hard-coded data in a script.
Integers
Integer literals represent numeric values with no fractions or decimal points.
Hexadecimal, octal, decimal, and binary notation are supported:
Hexadecimal numbers must be preceded by 0x: 0x2A, 0x54, 0xFFFFFF01
Octal numbers must begin with 0: 0775, 017, 0400
Decimal numbers are written as usual: 24, 1256, 2
Binary numbers are denoted with 0b: 0b01101100, 0b01, 0b100000
Strings
String literals are used to represent text. A string consists of zero or more characters and
can include numbers, letters, spaces, and punctuation. An empty string ("") contains
n
o characters and evaluates to false in an expression, whereas a non-empty string
evaluates to true. Double quotes surround a string, and some standard backslash (
\)
escape sequences are supported.
"Quote: \"This is a string
literal.\""
Quote: "This is a string literal."
"256"
"abcd!$%&*"
"June 26, 2001"
"[ 1, 2, 3 ]"
String Represented Text
256
**Note that this does not represent the
integer 256, but only the characters that
make up the number.
abcd!$%&*
June 26, 2001
[ 1, 2, 3 ]
Table 2.1 Examples of String Literals
Vue de la page 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 81 82

Commentaires sur ces manuels

Pas de commentaire