void scanner(char* filename){ newLexer(filename); lexeme* token = lex(); while(strcmp(token->type, ENDOFINPUT) != 0){ if(strcmp(token->type, NUMBER) != 0) printf("%s %s\n", token->type, token->string); else printf("%s %i\n", token->type, token->integer); token = lex(); } printf("%s\n", token->type); }
LexerConf::Ptr_t ColoursAndFontsManager::CopyTheme(const wxString& lexerName, const wxString& themeName, const wxString& sourceTheme) { LexerConf::Ptr_t sourceLexer = GetLexer(lexerName, sourceTheme); CHECK_PTR_RET_NULL(sourceLexer); JSONElement json = sourceLexer->ToJSON(); LexerConf::Ptr_t newLexer(new LexerConf()); newLexer->FromJSON(json); // Update the theme name newLexer->SetThemeName(themeName); // Add it return DoAddLexer(newLexer->ToJSON()); }
LexerConf::Ptr_t ColoursAndFontsManager::CopyTheme(const wxString& lexerName, const wxString& themeName, const wxString& sourceTheme) { LexerConf::Ptr_t sourceLexer = GetLexer(lexerName, sourceTheme); CHECK_PTR_RET_NULL(sourceLexer); wxXmlNode* sourceLexerXml = sourceLexer->ToXml(); LexerConf::Ptr_t newLexer(new LexerConf()); newLexer->FromXml(sourceLexerXml); // Update the theme name newLexer->SetThemeName(themeName); // Add it return DoAddLexer(newLexer->ToXml()); }