19 #ifndef PYTHON_CONTEXT_PARSER_HH
20 #define PYTHON_CONTEXT_PARSER_HH
31 namespace ost {
namespace gui {
45 return parent_ == NULL;
52 {
return sub_contexts_; }
62 range_.length = token.
GetRange().
End()-range_.location;
63 token_list_.push_back(token);
68 for (
size_t i = 0; i < token_list_.size(); ++i) {
69 std::cout << token_list_[i].GetValue().toStdString() << std::endl;
83 sub_contexts_.push_back(context);
84 sub_contexts_.back()->parent_ =
this;
93 std::vector<PythonContext*> sub_contexts_;
95 std::vector<PythonToken> token_list_;
110 this->PrintRecursively(root_,0);
121 return root_->GetContextAtLocation(location,context);
130 void PrintRecursively(
const PythonContext* context,
int level)
132 typedef std::vector<PythonContext*>::const_iterator const_it;
134 for (
int j = 0; j < level; ++j)
145 this->PrintRecursively(*i,level+1);
149 PythonTokenizer tokenizer_;
150 PythonContext* root_;
const std::vector< PythonContext * > & GetSubContexts() const
void AddToken(const PythonToken &token)
bool FindFirstToken(PythonToken::Type type, const QString &value, PythonToken &token)
bool FindLastToken(PythonToken::Type type, const QString &value, PythonToken &token)
const Range & GetRange() const
void SetRange(const Range &range)
bool GetContextAtLocation(size_t location, PythonContext *&context)
void AddContext(PythonContext *context)
const PythonContext * GetParent() const
void Parse(const QString &command)
const QString & GetCommand() const
bool GetContextAtLocation(size_t location, PythonContext *&context)
void Parse(PythonContext *&context)
const Range & GetRange() const
#define DLLEXPORT_OST_GUI
ImageStateConstModIPAlgorithm< ClearFnc > Clear
pointer_it< T > end(const std::vector< T > &values)