Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ParserKeywords.cc

Go to the documentation of this file.
00001 // Tekkodu Library
00002 #include "Kodu/Parsing/Parser.h"
00003 
00004 namespace Kodu {
00005 
00006     std::string Parser::koduDefaultDesignator;
00007     std::string Parser::koduDefaultCompOperator;
00008 
00009     std::set<std::string> Parser::koduColorKeywords;
00010     std::set<std::string> Parser::koduCompKeywords;
00011     std::set<std::string> Parser::koduScoreLetterKeywords;
00012 
00013     void Parser::initializeKeywordsAndDefaults() {
00014         // assign the default values for comparison operators and designators (colors and scoring letters)
00015         koduDefaultDesignator = "red";
00016         koduDefaultCompOperator = "equals";
00017 
00018         // initialize the color name set
00019         koduColorKeywords.insert("blue");
00020         koduColorKeywords.insert("green");
00021         koduColorKeywords.insert(koduDefaultDesignator);
00022         
00023         // initialize the comparison operator set
00024         koduCompKeywords.insert("above");
00025         koduCompKeywords.insert("below");
00026         koduCompKeywords.insert(koduDefaultCompOperator);
00027         koduCompKeywords.insert("not_equals");
00028         koduCompKeywords.insert(">=");
00029         koduCompKeywords.insert("<=");
00030 
00031         // initialize the score letter set
00032         std::string scoreName = "score_?";
00033         for (int i = 65; i <= 90; i++) {
00034             scoreName[scoreName.size() - 1] = static_cast<char>(i);
00035             koduScoreLetterKeywords.insert(scoreName);
00036         }
00037     }
00038 
00039     void Parser::clearKeywordsAndDefaults() {
00040         // clear keywords
00041         koduColorKeywords.clear();
00042         koduCompKeywords.clear();
00043         koduScoreLetterKeywords.clear();
00044 
00045         // clear default values
00046         koduDefaultDesignator.clear();
00047         koduDefaultCompOperator.clear();
00048     }
00049 }

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:45 2016 by Doxygen 1.6.3