comparison tty-main.cpp @ 12:894be158b32d

define parser as a class and eliminate some global variables
author John W. Eaton <jwe@octave.org>
date Thu, 23 May 2019 17:57:20 -0400
parents 69f5d5e42d2b
children
comparison
equal deleted inserted replaced
11:b652a5528fb1 12:894be158b32d
22 << "Semicolon terminates statement.\n" 22 << "Semicolon terminates statement.\n"
23 << "GNU Readline available for history editing.\n" << std::endl; 23 << "GNU Readline available for history editing.\n" << std::endl;
24 24
25 calc::interpreter interp; 25 calc::interpreter interp;
26 26
27 calc::parser& parser = interp.get_parser ();
28
27 for (;;) 29 for (;;)
28 { 30 {
29 char *tmp = readline (parser::beg_of_stmt ? ">> " : ""); 31 char *tmp = readline (parser.beg_of_stmt () ? ">> " : "");
30 32
31 if (! tmp) 33 if (! tmp)
32 { 34 {
33 std::cout << "\n"; 35 std::cout << "\n";
34 break; 36 break;