• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

自作言語nullptrのインタープリターです。


Commit MetaInfo

Revision3fe66ee3ed4c9b6729ac53759a7112cbee4b171d (tree)
Time2015-08-15 00:27:41
AuthorVOSystems <diverge.vosystems@gmai...>
CommiterVOSystems

Log Message

Preprocesor is almost finished. NEXT->Interpreter

Change Summary

Incremental Difference

Binary files a/nullptr.sdf and b/nullptr.sdf differ
--- a/nullptr/Preprocessor.cpp
+++ b/nullptr/Preprocessor.cpp
@@ -175,6 +175,33 @@ void Preprocessor::LoadLib(Library& module)
175175 }
176176 }
177177
178+void RegID(VOSystemsNullptr::System::IdentifierList& idlist, uint8_t type, const VOSystemsNullptr::System::FileOperator& fope, string line)
179+{
180+ VOSystemsNullptr::System::Identifier id;
181+ id.type=type;
182+ id.pos=fope.GetStreamOffset();
183+
184+ string::iterator start,end;
185+ switch(type){
186+ case VOSystemsNullptr::System::NotFound:
187+ default:
188+ break;
189+
190+ case VOSystemsNullptr::System::IntType:
191+ start=line.begin()+4;
192+ break;
193+ case VOSystemsNullptr::System::StringType:
194+ start=line.begin()+7;
195+ case VOSystemsNullptr::System::BoolType:
196+ start=line.begin()+5;
197+ }
198+ id.name=string(start,line.begin()+line.find_first_of('('));
199+
200+ idlist.push_back(id);
201+
202+ return;
203+}
204+
178205 void Preprocessor::LoadId(System::IdentifierList& list)
179206 {
180207 regex
@@ -184,19 +211,17 @@ void Preprocessor::LoadId(System::IdentifierList& list)
184211
185212 System::FileOperator fope(m_src,";");
186213 string line;
187- System::Identifier id;
188-
189214 do{
190215 line=fope();
191216
192217 if(regex_match(line,bool_regex)){
193- id.type=System::BoolType;
218+ RegID(list,System::BoolType,fope,line);
194219
195220 }else if(regex_match(line,int_regex)){
196- id.type=System::IntType;
221+ RegID(list,System::IntType,fope,line);
197222
198223 }else if(regex_match(line,str_regex)){
199- id.type=System::StringType;
224+ RegID(list,System::StringType,fope,line);
200225
201226 }
202227
--- a/nullptr/nullptr.h
+++ b/nullptr/nullptr.h
@@ -111,6 +111,8 @@ namespace VOSystemsNullptr
111111 std::string operator()(void);
112112 std::string operator()(size_t startpoint);
113113 std::string operator=(std::string source);
114+
115+ streamoff GetStreamOffset(void) const;
114116 };
115117
116118 class StringModule