@Override
    public Atom parseAtom() throws IOException {
        Atom atom = null;

        switch (curToken.type) {
            case NUMBER:
                if (curToken.c.contains(".")) {
                    atom = new NumberAtom(Double.parseDouble(curToken.c));
                } else {
                    atom = new NumberAtom(Integer.parseInt(curToken.c));
                }
                curToken = lexer.getToken();
                break;
            case NAME:
                String name = curToken.c;

                curToken = lexer.getToken();
                if (curToken.type == Lexer.Type.LEFT_PARENTHESIS) {
                    curToken = lexer.getToken();
                    ParamList paramList = parseParamList();
                    if (curToken.type == Lexer.Type.RIGHT_PARENTHESIS) {
                        curToken = lexer.getToken();
                    } else {
                        throw new IOException("missing RIGHT_PARENTHESIS - ) : "
                                + curToken.row + ":" + curToken.column);
                    }
                    atom = new MethodCallAtom(name, paramList);
                } else {
                    atom = new NameAtom(name);
                }

                break;
            case LEFT_PARENTHESIS:
                curToken = lexer.getToken();
                atom = new ExpressionAtom(parseExpression());

                if (curToken.type == RIGHT_PARENTHESIS) {
                    curToken = lexer.getToken();
                } else {
                    throw new IOException("missing )");
                }
                break;
            default:
                throw new IOException("missing atom");
        }

        return atom;
    }