CompilersPrinciples homework: a simple language~(By Ruby)