| | |
| | | class Word: public ast_node {}; |
| | | |
| | | class MathInline: public Word { |
| | | std::string *expr; |
| | | std::string expr; |
| | | public: |
| | | MathInline(std::string *e); |
| | | ~MathInline(); |
| | | std::string* get_expr(); |
| | | MathInline(std::string e); |
| | | std::string get_expr(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class Link: public Word { |
| | | std::string *link, *text; |
| | | std::string link, text; |
| | | public: |
| | | Link(std::string *l, std::string *t); |
| | | ~Link(); |
| | | std::string* get_link(); |
| | | std::string* get_text(); |
| | | Link(std::string l, std::string t); |
| | | std::string get_link(); |
| | | std::string get_text(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | |
| | | std::string t; |
| | | public: |
| | | Text(std::string tt); |
| | | std::string* get_text(); |
| | | std::string get_text(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | |
| | | }; |
| | | class Line: public ast_node {}; |
| | | |
| | | class Heading: public Line { |
| | | int level; |
| | | std::vector<Word*> words; |
| | | public: |
| | | Heading(int l, std::vector<Word*> w); |
| | | ~Heading(); |
| | | int get_level(); |
| | | std::vector<Word*>* get_words(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class List: public Line { |
| | | int level, number; |
| | | std::vector<Word*> words; |
| | | public: |
| | | List(int l, int n, std::vector<Word*> w); |
| | | ~List(); |
| | | int get_level(); |
| | | int get_number(); |
| | | std::vector<Word*>* get_words(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class MathDisp: public Line { |
| | | std::string *expr; |
| | | public: |
| | | MathDisp(std::string *e); |
| | | ~MathDisp(); |
| | | std::string* get_expr(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class Line_Word: public Line { |
| | | std::vector<Word*> words; |
| | | public: |
| | |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class Heading: public Line { |
| | | int level; |
| | | Line_Word *words; |
| | | public: |
| | | Heading(int l, Line_Word *w); |
| | | ~Heading(); |
| | | int get_level(); |
| | | Line_Word* get_words(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class List: public Line { |
| | | int level, number; |
| | | Line_Word *words; |
| | | public: |
| | | List(int l, int n, Line_Word *w); |
| | | ~List(); |
| | | int get_level(); |
| | | int get_number(); |
| | | Line_Word* get_words(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class MathDisp: public Line { |
| | | std::string expr; |
| | | public: |
| | | MathDisp(std::string e); |
| | | std::string get_expr(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | |
| | | class Block: public ast_node {}; |
| | | |
| | | class Block_Table: public Block { |
| | | std::vector<std::vector<Line_Word*>> table; |
| | | std::vector<std::vector<Line_Word*>*> table; |
| | | public: |
| | | ~Block_Table(); |
| | | std::vector<std::vector<Line_Word*>> get_table(); |
| | | int add_row(std::vector<Line_Word*> row); |
| | | std::vector<std::vector<Line_Word*>*>* get_table(); |
| | | int add_row(std::vector<Line_Word*>* row); |
| | | std::vector<Line_Word*>* get_row(std::vector<Line_Word*>::size_type i); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | | class Block_Code: public Block { |
| | | std::string *c; |
| | | std::string *lang; |
| | | std::string c; |
| | | std::string lang; |
| | | public: |
| | | Block_Code(std::string *l); |
| | | ~Block_Code(); |
| | | int add_line(std::string *add); |
| | | std::string* get_lang(); |
| | | std::string* get_code(); |
| | | Block_Code(std::string l); |
| | | int add_line(std::string add); |
| | | std::string get_lang(); |
| | | std::string get_code(); |
| | | void* visit(ast_visitor *v); |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | class Document: public ast_node { |
| | | std::string *title, *author, *date; |
| | | std::string title, author, date; |
| | | std::vector<Block*> blocks; |
| | | public: |
| | | Document(std::string *t, std::string *a, std::string *d); |
| | | Document(std::string t, std::string a, std::string d); |
| | | ~Document(); |
| | | std::string* get_title(); |
| | | std::string* get_author(); |
| | | std::string* get_date(); |
| | | std::string get_title(); |
| | | std::string get_author(); |
| | | std::string get_date(); |
| | | std::vector<Block*>* get_blocks(); |
| | | int add_block(Block *b); |
| | | void* visit(ast_visitor *v); |