Search:

Type: Posts; User: Kerr

Search: Search took 0.15 seconds.

  1. Replies
    7
    Views
    6,028

    Re: Best way to implement an abstract syntax tree?

    An update. Have taken a look at ANTLR, and how it does things. So I have decided that I will implement the tree with this class:

    public class Node implements Iterable<Node> {
    private Node...
  2. Replies
    7
    Views
    6,028

    Re: Best way to implement an abstract syntax tree?

    Thanks. I want to write my own parser, but as you suggested I can take a look at how they did it. Quite frankly I think that is a great idea!
  3. Replies
    7
    Views
    6,028

    Re: Best way to implement an abstract syntax tree?

    I guess I can just try and keep it simple. Make a base node and then have other nodes for more specific behaviour. Thing is, I want to avoid too many casts and all that when I use the tree later on....
  4. Replies
    7
    Views
    6,028

    Re: Best way to implement an abstract syntax tree?

    I know how a tree structure works. It is the case of a abstract syntax tree I am unsure of. For example, if I want to implement a function that generates fibonacci numbers, I would maybe do something...
  5. Replies
    7
    Views
    6,028

    Best way to implement an abstract syntax tree?

    Hi all.

    I am making a small scripting language for fun. Have managed to get the tokenizer working, but now I have another problem. Basically, I am dividing the source code into a series of tokens...
Results 1 to 5 of 5