view qt-interpreter.cpp @ 19:9e2211f5f293 default tip

NOTES: more updates
author John W. Eaton <jwe@octave.org>
date Tue, 28 May 2019 23:06:08 -0400
parents 1e5a1e15fa56
children
line wrap: on
line source

#include <string>

#include <QString>

#include "interpreter.h"
#include "qt-interpreter.h"

namespace calc
{
  qt_interpreter::qt_interpreter (void)
    : m_interpreter ()
  {
    m_interpreter.set_error_handler ([this] (const char *msg)
                                     { emit this->error_signal (msg); });

    m_interpreter.set_result_handler ([this] (double value)
                                      { emit this->result_ready (value); });
  }

  void qt_interpreter::execute (void)
  {
  }

  void qt_interpreter::accept_input_line (const QString& line)
  {
    m_interpreter.parse_and_execute (line.toStdString ());
  }
}