Storing a list in an expression list

Lurker #5 lnumber5 at klassmaster.com
Tue Jun 26 18:13:54 PDT 2007


Hi,

I'm starting with D and I want to use it for a project on skool. I want to write a new scriptiing language but I dont' know how to store a list on my expression list.

I have this structure:

class Node(T) {
public:
  T value
  Node!(T) left;
  Node!(T) right;

  // Constructors...
}

And I use it like this:

// a = b + c;
Node!(string) expression = new Node!(string)("=", 
new Node!(string)("a", 
new Node!(string)("=", 
new Node!(string)("b", 
new Node!(string)("c")));

Which gives me smth like:

  =
a  +
  b  c

But i dont' know how to store a list of parameters:

func(1, 2, 3);

expression = new Node!(string)("(", 
new Node!(string)("func"),
... ???
);

What do you suggest?

tnks



More information about the Digitalmars-d mailing list