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...
Type: Posts; User: Kerr
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...
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!
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....
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...
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...