X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FTPushParser.hh;h=04edacb6378c465e483085adec42df4e1ac15acb;hb=a407cfb9bc31c5f9b94eb437d642e7582b641fc4;hp=c104eb28c4c3a49ccfff0078fea5f53fd2cb5273;hpb=f761deff2f2f8c0cce674d2885b22a94a972ea85;p=helm.git diff --git a/helm/DEVEL/mathml_editor/src/TPushParser.hh b/helm/DEVEL/mathml_editor/src/TPushParser.hh index c104eb28c..04edacb63 100644 --- a/helm/DEVEL/mathml_editor/src/TPushParser.hh +++ b/helm/DEVEL/mathml_editor/src/TPushParser.hh @@ -13,14 +13,20 @@ class TPushParser : public APushParser { public: - TPushParser(const class TDictionary&); - TPushParser(const class TDictionary&, class TListener&); + TPushParser(class ALogger&, const class TDictionary&); + TPushParser(class ALogger&, class AMathMLFactory&, const class TDictionary&); virtual ~TPushParser(); + virtual void reset(void); virtual void push(const TToken&); - virtual void setCursor(const std::string&); + virtual std::string drop(bool); + virtual void setCursorHint(const std::string&); + virtual bool hideCursor(void); + virtual bool showCursor(void); - TDocument document(void) const { return doc; } + virtual bool thaw(void); + + DOM::Document document(void) const { return doc.document().cloneNode(true); } private: void init(void); @@ -28,43 +34,58 @@ private: std::string PRIME(void) const; bool isPrimes(const TNode&) const; - void do_begin(void); - void do_end(void); - void do_shift(void); - void do_align(void); - void do_eol(void); - void do_parameter(const std::string&); - void do_superscript(void); - void do_subscript(void); - void do_space(const std::string&); - void do_letter(const std::string&); - void do_digit(const std::string&); - void do_other(const std::string&); - void do_active(const std::string&); - void do_comment(void); - void do_control(const std::string&); + + + bool do_begin(void); + bool do_end(void); + bool do_shift(void); + bool do_align(void); + bool do_eol(void); + bool do_parameter(const std::string&); + bool do_superscript(void); + bool do_subscript(void); + bool do_space(const std::string&); + bool do_letter(const std::string&); + bool do_digit(const std::string&); + bool do_other(const std::string&); + bool do_active(const std::string&); + bool do_comment(void); + bool do_control(const std::string&); + + + std::string drop_prev_token(bool); + std::string drop_prev_script(bool); + std::string drop_prev_group(bool); + std::string drop_prev_macro(bool); + std::string drop_prev(bool); + void rgreplace_father(void); + std::string do_drop_script(bool); + std::string do_drop_macro(bool); + std::string do_drop_groupId(bool); + std::string do_drop_phantom_group(bool); + std::string do_drop(bool); - void do_cr(void); - void do_apostrophe(void); + bool do_cr(void); + bool do_apostrophe(void); void advance(const TNode&); + bool correctBrace(void); - void process(const TToken&); + bool process(const TToken&); struct Frame { Frame(const TDictionary::Entry& e) : entry(e), pos(0) { }; + Frame(const TDictionary::Entry&e, unsigned p) : entry(e), pos(p) { }; const TDictionary::Entry& entry; unsigned pos; }; std::stack frames; - //std::list buffer; unsigned nextId; TDocument doc; TNode cursor; - + unsigned hiddenCursor; const class TDictionary& dictionary; - class TListener* listener; }; #endif // __TPushParser_hh__