Форум программистов, компьютерный форум CyberForum.ru
Наши страницы

Пишем свой интерпретатор языка BASIC - C++

Войти
Регистрация
Восстановить пароль
Другие темы раздела
C++ Меню и список http://www.cyberforum.ru/cpp-beginners/thread41194.html
Здравствуйте форумчане. Помоги пожалуйста в следующем вопросе: У меня есть 2связный список, написано меню. Но в моменте когда написано make a list и delete custom необходимо чтобы выводились:...
C++ Здравствуйте! Не могу поместить class в один файл с программой. file.hpp #include "Cat.hpp" // здесь классы "2)" Cat::Cat(int initialAge) { itsAge = initialAge; } Cat::~Cat() { http://www.cyberforum.ru/cpp-beginners/thread41186.html
Массивы строк C++
Привет всем! Задан массив строк. Как узнать который символ встечаетса найбольшое количество раз в етом массиве?
C++ вывод на экран набор треугольников и квадратов, которые произвольно двигаются и меняют размер
Please, help me!!! Вот текст программы, которая выводит на экран набор треугольников и квадратов, которые произвольно двигаются и меняют размер только квадратов. Проблема в том, что необходимо...
C++ Округление дробного числа до целого в большую сторону. http://www.cyberforum.ru/cpp-beginners/thread41139.html
Доброго дня. Я новичок в программирование на Visual C++. Проблема такая программа должна считать кол-во месяцев, если числа целые то программа шла дальше, если дробное то (например 3.33333) ...
C++ Код из Delphi в C++ Нужно написать курсовую на C++. Сам я в программировании плохо шарю (не программист). Попросил у народу помощи, помогли. Но решение на Delphi: {$APPTYPE CONSOLE} type byteset=set of byte; ... подробнее

Показать сообщение отдельно
Evg
Эксперт CАвтор FAQ
17931 / 6155 / 408
Регистрация: 30.03.2009
Сообщений: 16,904
Записей в блоге: 27
25.10.2010, 15:28
Цитата Сообщение от #pragma Посмотреть сообщение
и тогда нельзя будет объявить ещё одну такую же переменную где бы то ни было
Это что, в бэйсике так придумано? С виду выглядит через ж...у, но логика вроде бы такая, что переменная с модификатором SHARED - это в чистом виде глобал, а без модификатора - локал. При этом возникает понятие локальной переменной для всего модуля, но вроже бы как ничему не противоречит. Кроме, возможно, случая, когда исходник состоит из нескольких файлов, но я не уверен, что такое хозяйство у кого-то работает на интерпретаторах, скорее всего такое только в компиляторах

Добавлено через 9 минут
На всякий случай лог сборки компилятором g++-4.1.2 - много warning'ов.
У меня qt или нет или кривая версия, а потому оно не собралось. Систему configure надо бы научить это дело понимать, выдавать предупреждение, что у вас не будет GUI и не запускать его сборку

Сборка компилятором g++-4.1.2
$ make
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/debug/error_handler.cpp -o Interpreter/debug/error_handler.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/main.cpp -o Interpreter/main.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/lib/lib.cpp -o Interpreter/lib/lib.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/cmd/options.cpp -o Interpreter/cmd/options.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/memory/memory.cpp -o Interpreter/memory/memory.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/frontend/parser.cpp -o Interpreter/frontend/parser.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/frontend/syntax.cpp -o Interpreter/frontend/syntax.o
Interpreter/frontend/syntax.cpp: In function 'expr_Node_t* syntax_Procedure(var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:481: warning: 'params' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'expr_Node_t* syntax_Primary(var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:346: warning: 'zero' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:359: warning: 'ind' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:373: warning: 'ind' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:145: warning: 'expr' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtDIM(var_Arr_t*, arr_Arr_t*)':
Interpreter/frontend/syntax.cpp:1183: warning: 'arr_elem_type' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1128: warning: 'start_indexes' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1127: warning: 'indexes' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1074: warning: 'var_type' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtCLEAR(stmt_List_t*)':
Interpreter/frontend/syntax.cpp:1514: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1515: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtBEEP(stmt_List_t*)':
Interpreter/frontend/syntax.cpp:1507: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1508: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtEND(stmt_List_t*)':
Interpreter/frontend/syntax.cpp:1501: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1502: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtCLS(stmt_List_t*)':
Interpreter/frontend/syntax.cpp:1494: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1495: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtCIRCLE(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1469: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1488: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtLINE(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1411: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1463: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtPRESET(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1389: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1405: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtSCREEN(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1374: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1383: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtCALL(stmt_List_t*)':
Interpreter/frontend/syntax.cpp:1354: warning: 'name' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1359: warning: 'parameters' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1360: warning: 'function_call' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1363: warning: 'return_from_call' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_Label(stmt_List_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1032: warning: 'addr' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1038: warning: 'label' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtGOTO(stmt_List_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:1009: warning: 'label' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1016: warning: 'label' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtINPUT(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:649: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:650: warning: 'var_list' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:417: warning: 'zero' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:446: warning: 'ind' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:432: warning: 'ind' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_stmtPRINT(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:599: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:602: warning: 'print_expr_list' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:607: warning: 'print_expr_list' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'stmt_Node_t* syntax_stmtLET(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:515: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:539: warning: 'indexes' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:562: warning: 'indexes' is used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'stmt_Node_t* syntax_stmtFOR(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:818: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:856: warning: 'cbr_stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:857: warning: 'loop' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:973: warning: 'increment' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:975: warning: 'check' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:977: warning: 'lbl_on_true' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:979: warning: 'lbl_on_false' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:855: warning: 'rel_expr' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'stmt_Node_t* syntax_CBranch(stmt_List_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/frontend/syntax.cpp:727: warning: 'label_finish' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:751: warning: 'lbl_on_false' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:776: warning: 'label_finish' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:793: warning: 'lbl_on_false' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:802: warning: 'cbr_stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:803: warning: 'loop' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:805: warning: 'check' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:807: warning: 'lbl_on_true' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:809: warning: 'lbl_on_false' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:987: warning: 'loop' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:991: warning: 'cbr_stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:992: warning: 'lbl_on_true' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:994: warning: 'lbl_on_false' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:786: warning: 'label_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:784: warning: 'lbl_on_false' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:783: warning: 'lbl_to_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:770: warning: 'label_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:764: warning: 'lbl_on_false' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:763: warning: 'lbl_to_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:758: warning: 'lbl_on_true' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:739: warning: 'label_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:737: warning: 'lbl_on_false' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:735: warning: 'lbl_to_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:710: warning: 'label_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:703: warning: 'lbl_on_false' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:702: warning: 'lbl_to_finish' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:697: warning: 'lbl_on_true' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:693: warning: 'cbr_stmt' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp: In function 'void syntax_Check()':
Interpreter/frontend/syntax.cpp:1788: warning: 'stmt' is used uninitialized in this function
Interpreter/frontend/syntax.cpp:1314: warning: 'exit_from_call' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1307: warning: 'function_call' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1306: warning: 'parameters' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1338: warning: 'body_end' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1335: warning: 'exit_from' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1280: warning: 'addr' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1268: warning: 'lcl_lbls' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1267: warning: 'lcl_arrs' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1266: warning: 'lcl_vars' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1263: warning: 'arrs_val_stack' may be used uninitialized in this function
Interpreter/frontend/syntax.cpp:1255: warning: 'name' may be used uninitialized in this function
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/value.cpp -o Interpreter/intermediate/value.o
Interpreter/intermediate/value.cpp: In member function 'Value Value::operator/(const Value&)':
Interpreter/intermediate/value.cpp:485: warning: passing 'double' for argument 1 to 'void Value::Set_ival(_int_t)'
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/variable.cpp -o Interpreter/intermediate/variable.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/expression.cpp -o Interpreter/intermediate/expression.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/statement.cpp -o Interpreter/intermediate/statement.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/array.cpp -o Interpreter/intermediate/array.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/intermediate/label.cpp -o Interpreter/intermediate/label.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/runtime/interp.cpp -o Interpreter/runtime/interp.o
Interpreter/runtime/interp.cpp: In function 'Value interp_CalcExpr(const expr_Node_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/runtime/interp.cpp:383: warning: 'parameters' is used uninitialized in this function
Interpreter/runtime/interp.cpp: In function 'stmt_Node_t* interp_stmtLET(stmt_Node_t*, var_Arr_t*, arr_Arr_t*, lab_Arr_t*)':
Interpreter/runtime/interp.cpp:466: warning: 'value' is used uninitialized in this function
Interpreter/runtime/interp.cpp:480: warning: 'value' is used uninitialized in this function
Interpreter/runtime/interp.cpp: In function 'void interp_Run()':
Interpreter/runtime/interp.cpp:404: warning: 'parameters' may be used uninitialized in this function
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/runtime/function.cpp -o Interpreter/runtime/function.o
Interpreter/runtime/function.cpp: In function 'Value func_Calculate(const expr_Node_t*, val_Arr_t*)':
Interpreter/runtime/function.cpp:286: warning: 't' may be used uninitialized in this function
Interpreter/runtime/function.cpp:304: warning: 't' may be used uninitialized in this function
Interpreter/runtime/function.cpp:323: warning: 't2' may be used uninitialized in this function
Interpreter/runtime/function.cpp:323: warning: 't1' may be used uninitialized in this function
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/runtime/graphics/graphics.cpp -o Interpreter/runtime/graphics/graphics.o
Interpreter/runtime/graphics/graphics.cpp: In function 'void graphics_PRESET(val_Arr_t*)':
Interpreter/runtime/graphics/graphics.cpp:215: warning: 'color' may be used uninitialized in this function
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/runtime/tracer/tracer.cpp -o Interpreter/runtime/tracer/tracer.o
g++ -c -MD -ansi -pedantic -pedantic-errors -Wall -O2 -Os -I. -IInterpreter/runtime -IInterpreter/runtime/graphics -IInterpreter/runtime/tracer -IInterpreter/cmd -IInterpreter/config -IInterpreter/debug -IInterpreter/frontend -IInterpreter/intermediate -IInterpreter/lib -IInterpreter/include -IInterpreter/memory -IInterpreter Interpreter/runtime/pool.cpp -o Interpreter/runtime/pool.o
Interpreter/runtime/pool.cpp:293:1: warning: "/*" within comment
Interpreter/runtime/pool.cpp: In member function '_bool_t Pool::isConflictingDeclaration(std::string, unsigned int)':
Interpreter/runtime/pool.cpp:208: warning: 'and' of mutually exclusive equal-tests is always 0
Interpreter/runtime/pool.cpp:221: warning: 'and' of mutually exclusive equal-tests is always 0
Interpreter/runtime/pool.cpp:234: warning: 'and' of mutually exclusive equal-tests is always 0
Interpreter/runtime/pool.cpp:247: warning: 'and' of mutually exclusive equal-tests is always 0
g++ -lSDL Interpreter/debug/error_handler.o Interpreter/main.o Interpreter/lib/lib.o Interpreter/cmd/options.o Interpreter/memory/memory.o Interpreter/frontend/parser.o Interpreter/frontend/syntax.o Interpreter/intermediate/value.o Interpreter/intermediate/variable.o Interpreter/intermediate/expression.o Interpreter/intermediate/statement.o Interpreter/intermediate/array.o Interpreter/intermediate/label.o Interpreter/runtime/interp.o Interpreter/runtime/function.o Interpreter/runtime/graphics/graphics.o Interpreter/runtime/tracer/tracer.o Interpreter/runtime/pool.o -o basin \
&& /bin/mv ./basin ./bin/basin
cd ./GUI/Qt/Basin-IDE && /usr/bin/qmake -project \
&& /usr/bin/qmake && /usr/bin/make && cd .. && cd .. && cd .. \
&& /bin/mv ./GUI/Qt/Basin-IDE/Basin-IDE ./bin/Basin-IDE


Сборка GUI
g++ -c -pipe -O2 -march=pentium3 -mtune=pentium4 -pipe -fno-strict-aliasing -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o editor.o editor.cpp
In file included from editor.cpp:22:
editor.h:22:26: error: QPlainTextEdit: No such file or directory
editor.h:36: error: expected class-name before '{' token
editor.h:36: warning: 'class CodeEditor' has virtual functions but non-virtual destructor
editor.h: In constructor 'LineNumberArea::LineNumberArea(CodeEditor*)':
editor.h:64: error: no matching function for call to 'QWidget::QWidget(CodeEditor*&)'
/usr/include/qt4/QtGui/qwidget.h:728: note: candidates are: QWidget::QWidget(const QWidget&)
/usr/include/qt4/QtGui/qwidget.h:669: note: QWidget::QWidget(QWidgetPrivate&, QWidget*, Qt::WindowFlags)
/usr/include/qt4/QtGui/qwidget.h:219: note: QWidget::QWidget(QWidget*, Qt::WindowFlags)
editor.cpp: In constructor 'CodeEditor::CodeEditor(QWidget*)':
editor.cpp:24: error: class 'CodeEditor' does not have any field named 'QPlainTextEdit'
editor.cpp:29: error: 'connect' was not declared in this scope
editor.cpp:43: error: 'setFont' was not declared in this scope
editor.cpp:44: error: 'setLineWidth' was not declared in this scope
editor.cpp:46: error: 'document' was not declared in this scope
editor.cpp: In member function '_int_t CodeEditor::lineNumberAreaWidth()':
editor.cpp:52: error: 'blockCount' was not declared in this scope
editor.cpp:58: error: 'fontMetrics' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::updateLineNumberAreaWidth(_int_t)':
editor.cpp:65: error: 'setViewportMargins' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::updateLineNumberArea(const QRect&, _int_t)':
editor.cpp:76: error: 'viewport' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::resizeEvent(QResizeEvent*)':
editor.cpp:82: error: 'QPlainTextEdit' has not been declared
editor.cpp:84: error: 'contentsRect' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent*)':
editor.cpp:94: error: 'firstVisibleBlock' was not declared in this scope
editor.cpp:95: error: 'class QTextBlock' has no member named 'blockNumber'
editor.cpp:97: error: 'blockBoundingGeometry' was not declared in this scope
editor.cpp:97: error: 'contentOffset' was not declared in this scope
editor.cpp:99: error: 'blockBoundingRect' was not declared in this scope
editor.cpp:103: error: 'class QTextBlock' has no member named 'isVisible'
editor.cpp:108: error: 'fontMetrics' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::highlightCurrentLine()':
editor.cpp:125: error: 'textCursor' was not declared in this scope
editor.cpp:129: error: 'setExtraSelections' was not declared in this scope
editor.cpp: In member function 'void CodeEditor::highlightCurrentErrorLine(const QString&)':
editor.cpp:140: error: 'textCursor' was not declared in this scope
editor.cpp:160: error: 'setTextCursor' was not declared in this scope
editor.cpp:161: error: 'setExtraSelections' was not declared in this scope
editor.cpp:162: error: 'ensureCursorVisible' was not declared in this scope
make[1]: *** [editor.o] Error 1


Добавлено через 26 минут
Написал пример:

PureBasic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DIM SHARED glob AS INTEGER
LET glob = 10
 
SUB func1
  LET loc = loc + 1
  PRINT "func1: glob="; glob; "; loc="; loc
  LET glob = glob - 1
  IF glob > 0 THEN
    CALL func2
  END IF 
END SUB
 
SUB func2
  LET loc = loc + 1
  PRINT "func2: glob="; glob; "; loc="; loc
  CALL func1
END SUB
 
CALL func1
 
PRINT "main end: glob="; glob; "; loc="; loc
Интерпретатор не захотел понимать вызов функции до того, как она будет объявлена

Код
file: a.bas line: 9 error: Undefined function: FUNC2
После чего "CALL func2" заменил на "CALL func1" (чтобы обойтись рекурсией внутри одной функции), на что интерпретатор фатально сломался:

Код
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check
Aborted
Экспериментальным путём наблюл, что сие падени из-за наличия второй функции. Удалил всю func2, после чего падаем:

Код
basin: Interpreter/intermediate/value.cpp:193: Value Value::operator+(const Value&): Assertion `0' failed.
Aborted
Это уже из-за работы с переменной loc внутри функции

В общем, так и не получилось что-то вменяемое протестировать. Скачивал tar.gz по ссылке из первого поста. Неплохо было бы, чтобы интерпретатор умел печатать свою версию (которая, например, совпадала бы с номером ревизии). Как сделать так, чтобы svn автоматически писал нормер ревизии в файл - навскидку не помню, но вечером могу из дома ссылку прислать

Добавлено через 1 минуту
Странно, но форум заменил "loc" на "LOC" - видимо какое-то ключевое слово. Но суть от этого не меняется (вместо "loc" можно написать "venik")
2
 
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Рейтинг@Mail.ru