next up previous contents index
Next: Warnings about the NULL Up: The NASL2 grammar Previous: Syntax   Contents   Index

Types

NASL2 handles the following data types:

  1. integers
    Any sequence of digits with an optional minus sign is an integer. NASL2 uses the C syntax: octal numbers can be enter by starting with 0 and hexadecimal with 0x (i.e. 0x10 = 020 = 16)
  2. strings, which can exist in two flavors: ``pure'' and ``impure''2.

    1. ``Impure'' strings are entered between double quotes and are not converted: backslashes remain backslashes. ``Impure'' strings are transformed into ``pure'' string by the internal string function.
    2. ``Pure'' strings are returned by string or are entered between simple quotes. In this case, a few escape sequences are transformed3.
  3. arrays, which can be indexed with integers4 or strings5.
  4. And the NULL value, which is what you get if you read an initialized variable, or what internal functions returns in case of severe error.
    Read the warning below!
  5. Booleans are not a standalone type. The comparison operators return 0 for FALSE and 1 for TRUE. Any other value is converted :

All built-in or user-defined functions can handle or return all those types (even arrays!).



Subsections
next up previous contents index
Next: Warnings about the NULL Up: The NASL2 grammar Previous: Syntax   Contents   Index
Michel Arboi 2005-04-29