UNB/ CS/ David Bremner/ teaching/ java/ Recurse.java
import java.io.*;

public class Recurse{

    private static boolean matching(StringReader parens){
        if (parens.length()==0) 
            return true;
        if (parens.length()==1)
            return false;

        return atom(parens) && matching(parens);
    }

    private static boolean atom(StringReader parens){
        return (getchar(parens) == '(') &&
            matching(parens) &&
            (getchar(parens) == ')') ;
    }

    private static char getchar(Reader rdr){
        return (char)rdr.read();
            
    }

    public static void main(){
        StringReader s=new StringReader("hello");
        
        System.out.println((char)s.read());
        System.out.println((char)s.read());


    }
}