ing -> error $ "undefined pointer variable: " ++ s
    Just pr -> return pr

alreadyDefinedVar :: Var -> State CompileState Bool
alreadyDefinedVar v = do
  vars <- use (frame.intVars)
  return $ case lookup v vars of
    Nothing -> False
    Just _  -> True

alreadyDefinedPtr :: Var -> State CompileState Bool             
extendScope :: State CompileState a -> State CompileState a
extendScope m = do
  fr <- use frame
  ret <- m
  frame .= fr
  return ret

-- 整数の変数を，シンボルテーブルから引っ張ってくる．
extendScope m = do
  fr <- use frame
  ret <- m
  frame .= fr
  return ret

-- 整数の変数を，シンボルテーブルから引っ張ってくる．