I have this simple recursive grammar:
T --> a | aT
Are there some best practices?
Anyway, my idea is pretty simple but I am not sure if it is a good one.
public abstract class Tclass {
}
public class Tclass1 extends Tclass{
private String a;
}
public class Tclass2 extends Tclass{
private String a;
private Tclass t;
}