next up previous contents index
Next: The interpretor Up: The parser Previous: The syntactic analyzer   Contents   Index

The syntax tree

You can find a description of the ``cell type'' in nasl_tree.h. The only used data type is the tree_cell structure. Each cell maybe linked to children cells: from 0 (if it is a leaf) to 4 (if I remember correctly, only the ``for'' instruction uses this).
For example, this code:

x = y * 2;

f(arg1: x);

will become this tree:



   1: NODE_VAR Val="x"


      1: NODE_VAR Val="y"

      2: CONST_INT Val=2


   1: NODE_FUN_CALL Val="f"

      1: NODE_ARG Val="arg1"

         1: NODE_VAR Val="x" 

Michel Arboi 2005-04-29