Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TokenParserKeywords.cc

Go to the documentation of this file.
00001 // Tekkodu Library
00002 #include "Kodu/Parsing/Parser.h"
00003 
00004 // C++ Library
00005 #include <set>
00006 
00007 namespace Kodu {
00008 
00009     std::set<std::string> Parser::TokenParser::koduKeywords;
00010 
00011     void Parser::TokenParser::initializeKeywordSet() {
00012         // add the color keywords
00013         koduKeywords.insert(koduColorKeywords.begin(), koduColorKeywords.end());
00014         
00015         // add the numeric comparison keywords
00016         koduKeywords.insert(koduCompKeywords.begin(), koduCompKeywords.end());
00017 
00018         // add the score letter keywords
00019         koduKeywords.insert(koduScoreLetterKeywords.begin(), koduScoreLetterKeywords.end());
00020 
00021         // add the PAGE, WHEN, and DO identifiers
00022         koduKeywords.insert("PAGE");
00023         koduKeywords.insert("WHEN");
00024         koduKeywords.insert("DO");
00025 
00026         // add the following conditions to the keyword set
00027         koduKeywords.insert("always");
00028         koduKeywords.insert("bump");
00029         koduKeywords.insert("got");
00030         koduKeywords.insert("scored");
00031         koduKeywords.insert("see");
00032         koduKeywords.insert("timer");
00033   koduKeywords.insert("hear");
00034 
00035         // add the following actions to the keyword set
00036         koduKeywords.insert("do_nothing");
00037         koduKeywords.insert("drop");
00038         koduKeywords.insert("grab");
00039         koduKeywords.insert("move");
00040         koduKeywords.insert("switch_to_page");
00041         koduKeywords.insert("play");
00042         koduKeywords.insert("say");
00043         koduKeywords.insert("score");
00044         koduKeywords.insert("set_score");
00045         koduKeywords.insert("subtract");
00046         koduKeywords.insert("turn");           
00047   koduKeywords.insert("give");
00048 
00049         // add the following modifiers to the keyword set
00050         // any modifier
00051         koduKeywords.insert("any");
00052 
00053         // direction specifiers
00054         koduKeywords.insert("east");
00055         koduKeywords.insert("north");
00056         koduKeywords.insert("south");
00057         koduKeywords.insert("west");
00058 
00059         // motion modifiers
00060 
00061         koduKeywords.insert("direction");
00062         koduKeywords.insert("forward");
00063         koduKeywords.insert("left");
00064         koduKeywords.insert("right");
00065       koduKeywords.insert("move");
00066         koduKeywords.insert("towards");
00067         koduKeywords.insert("wander");
00068         
00069         // not modifier
00070         koduKeywords.insert("not");
00071         
00072         // object types/names and references
00073         koduKeywords.insert("it");
00074         koduKeywords.insert("apple");
00075         koduKeywords.insert("rock");
00076         koduKeywords.insert("tree");
00077       koduKeywords.insert("octopus");
00078       koduKeywords.insert("kodu");
00079         koduKeywords.insert("robot");
00080       koduKeywords.insert("cycle");
00081       koduKeywords.insert("turtle");
00082         // once modifier
00083         koduKeywords.insert("once");
00084         
00085         // random modifier
00086         koduKeywords.insert("random");
00087 
00088         // rate modifiers
00089         koduKeywords.insert("quickly");
00090         koduKeywords.insert("slowly");
00091 
00092         // regional specifiers
00093         koduKeywords.insert("to_left");
00094         koduKeywords.insert("to_right");
00095         koduKeywords.insert("in_front");
00096         koduKeywords.insert("behind");
00097 
00098         // object distance
00099         koduKeywords.insert("close_by");
00100         koduKeywords.insert("far_away");
00101   
00102   // Gamepad Keywords
00103   koduKeywords.insert("gamepad");
00104   koduKeywords.insert("button");
00105   koduKeywords.insert("press");
00106   koduKeywords.insert("release");
00107   koduKeywords.insert("A");
00108   koduKeywords.insert("Y");
00109   koduKeywords.insert("B");
00110   koduKeywords.insert("X");
00111   koduKeywords.insert("right");
00112   koduKeywords.insert("left");
00113     koduKeywords.insert("L-stick");
00114   koduKeywords.insert("bumpers");
00115   koduKeywords.insert("joystick");
00116 
00117     //Comparison
00118     koduKeywords.insert("equals");
00119     koduKeywords.insert("not_equals");
00120     koduKeywords.insert("<=");
00121     koduKeywords.insert(">=");
00122     koduKeywords.insert("above");
00123     koduKeywords.insert("below");
00124   
00125   
00126     }
00127 
00128     void Parser::TokenParser::clearKeywordSet() {
00129         koduKeywords.clear();
00130     }
00131 }

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