pavel-hrdy / basic-interpret Goto Github PK
View Code? Open in Web Editor NEWInterpret of BASIC
Interpret of BASIC
Našel jsem spoustu dialektů na wiki a ani jeden mi nefungoval :D
Příklad:
Řádka se němění, může být konstanta
10 cls
20 print "Hello, world!"
30 sleep
40 end
Funkce které nemění třídu uvnitř by měly být const
Například:
Viz #8 zatím jsi opravil jen jeden warning, co ty zbylé 3?
Nastav si ve VS úroveň warningů alespoň W4
, ideálně Wall
(vyřeš jen ty tvoje).
Potom Ti to napíše něco podobného:
1>------ Build started: Project: cpp_basic_interpret, Configuration: Debug x64 ------
1>cpp_basic_interpret.cpp
1>exceptions.cpp
1>icvm.cpp
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(203): warning C4267: '=': conversion from 'size_t' to 'int32_t', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(210): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(210): warning C4267: 'return': conversion from 'size_t' to 'int32_t', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(211): warning C4267: 'argument': conversion from 'size_t' to 'const int', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(211): warning C4267: 'return': conversion from 'size_t' to 'int32_t', possible loss of data
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\utility(174): warning C4267: 'initializing': conversion from 'size_t' to '_Ty2', possible loss of data
1> with
1> [
1> _Ty2=int32_t
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xmemory0(879): note: see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<int32_t&,unsigned __int64,0>(_Other1,_Other2 &&) noexcept' being compiled
1> with
1> [
1> _Kty=int32_t,
1> _Ty=int32_t,
1> _Other1=int32_t &,
1> _Other2=unsigned __int64
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xmemory0(881): note: see reference to function template instantiation 'std::pair<const _Kty,_Ty>::pair<int32_t&,unsigned __int64,0>(_Other1,_Other2 &&) noexcept' being compiled
1> with
1> [
1> _Kty=int32_t,
1> _Ty=int32_t,
1> _Other1=int32_t &,
1> _Other2=unsigned __int64
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xtree(976): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,int32_t&,unsigned __int64>(_Alloc &,_Objty *const ,int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Alloc=std::allocator<std::_Tree_node<std::pair<const int32_t,int32_t>,std::_Default_allocator_traits<std::allocator<std::pair<const int32_t,int32_t>>>::void_pointer>>,
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Objty=std::pair<const int32_t,int32_t>
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xtree(983): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,int32_t&,unsigned __int64>(_Alloc &,_Objty *const ,int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Alloc=std::allocator<std::_Tree_node<std::pair<const int32_t,int32_t>,std::_Default_allocator_traits<std::allocator<std::pair<const int32_t,int32_t>>>::void_pointer>>,
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Objty=std::pair<const int32_t,int32_t>
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xtree(1154): note: see reference to function template instantiation 'std::_Tree_node<_Ty,std::_Default_allocator_traits<_Alloc>::void_pointer> *std::_Tree_comp_alloc<_Traits>::_Buynode<int32_t&,unsigned __int64>(int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Alloc=std::allocator<std::pair<const int32_t,int32_t>>,
1> _Traits=std::_Tmap_traits<int32_t,int32_t,std::less<int>,std::allocator<std::pair<const int32_t,int32_t>>,false>
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\xtree(1155): note: see reference to function template instantiation 'std::_Tree_node<_Ty,std::_Default_allocator_traits<_Alloc>::void_pointer> *std::_Tree_comp_alloc<_Traits>::_Buynode<int32_t&,unsigned __int64>(int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Alloc=std::allocator<std::pair<const int32_t,int32_t>>,
1> _Traits=std::_Tmap_traits<int32_t,int32_t,std::less<int>,std::allocator<std::pair<const int32_t,int32_t>>,false>
1> ]
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(193): note: see reference to function template instantiation 'std::pair<std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>>,bool> std::_Tree<std::_Tmap_traits<_Kty,int,_Pr,_Alloc,false>>::emplace<int32_t&,unsigned __int64>(int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Kty=int32_t,
1> _Pr=std::less<int>,
1> _Alloc=std::allocator<std::pair<const int32_t,int32_t>>
1> ]
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm.cpp(193): note: see reference to function template instantiation 'std::pair<std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>>,bool> std::_Tree<std::_Tmap_traits<_Kty,int,_Pr,_Alloc,false>>::emplace<int32_t&,unsigned __int64>(int32_t &,unsigned __int64 &&)' being compiled
1> with
1> [
1> _Ty=std::pair<const int32_t,int32_t>,
1> _Kty=int32_t,
1> _Pr=std::less<int>,
1> _Alloc=std::allocator<std::pair<const int32_t,int32_t>>
1> ]
1>icvm_instructions.cpp
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(311): warning C4244: 'argument': conversion from '_Ty' to '_Elem', possible loss of data
1> with
1> [
1> _Ty=uint32_t
1> ]
1> and
1> [
1> _Elem=char
1> ]
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(348): warning C4244: 'argument': conversion from '_Ty' to '_Elem', possible loss of data
1> with
1> [
1> _Ty=uint32_t
1> ]
1> and
1> [
1> _Elem=char
1> ]
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(807): warning C4456: declaration of 'x' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(796): note: see declaration of 'x'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(934): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(948): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(962): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(978): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(992): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1006): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1023): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1020): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1034): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1061): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1083): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1097): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1111): warning C4189: 'type': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\icvm_instructions.cpp(1124): warning C4189: 'type': local variable is initialized but not referenced
1>lexer.cpp
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\lexer.cpp(290): warning C4389: '==': signed/unsigned mismatch
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(1443): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\lexer.cpp(102): note: see reference to function template instantiation '_OutIt std::transform<std::_String_iterator<std::_String_val<std::_Simple_types<_Ty>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Ty>>>,int(__cdecl *)(int)>(const _InIt,const _InIt,_OutIt,_Fn)' being compiled
1> with
1> [
1> _OutIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1> _Ty=char,
1> _InIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1> _Fn=int (__cdecl *)(int)
1> ]
1>parser.cpp
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(373): warning C4456: declaration of 'loadConst' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(349): note: see declaration of 'loadConst'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(374): warning C4456: declaration of 'instr' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(350): note: see declaration of 'instr'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(427): warning C4456: declaration of 'x' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(329): note: see declaration of 'x'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(523): warning C4456: declaration of 'loadConst' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(514): note: see declaration of 'loadConst'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(524): warning C4456: declaration of 'instr' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(515): note: see declaration of 'instr'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(575): warning C4456: declaration of 'loadConst' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(566): note: see declaration of 'loadConst'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(576): warning C4456: declaration of 'instr' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(567): note: see declaration of 'instr'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(686): warning C4457: declaration of 'endIndex' hides function parameter
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(657): note: see declaration of 'endIndex'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(865): warning C4457: declaration of 'endIndex' hides function parameter
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(812): note: see declaration of 'endIndex'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(887): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(884): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(891): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(884): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(913): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(910): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(917): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(910): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(939): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(943): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(947): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(951): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(955): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(959): warning C4456: declaration of 'op' hides previous local declaration
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(936): note: see declaration of 'op'
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(979): warning C4189: 'icvm': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(1003): warning C4189: 'foundNum': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(1131): warning C4189: 'icvm': local variable is initialized but not referenced
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(1286): warning C4189: 'doesExist': local variable is initialized but not referenced
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(1443): warning C4244: '=': conversion from 'int' to 'char', possible loss of data
1>d:\projects\_students\basic-interpret\cpp_basic_interpret\parser.cpp(370): note: see reference to function template instantiation '_OutIt std::transform<std::_String_iterator<std::_String_val<std::_Simple_types<_Ty>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Ty>>>,int(__cdecl *)(int)>(const _InIt,const _InIt,_OutIt,_Fn)' being compiled
1> with
1> [
1> _OutIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1> _Ty=char,
1> _InIt=std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,
1> _Fn=int (__cdecl *)(int)
1> ]
1>token.cpp
1>Generating Code...
1>cpp_basic_interpret.vcxproj -> D:\Projects\_students\BASIC-Interpret\x64\Debug\cpp_basic_interpret.exe
1>Done building project "cpp_basic_interpret.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
to_string
neni noexceot
, co se stane, pokud funkce vyhodí exception?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.