source:
src/dgp/mgraph.hh
@
0a58b3f
| Last change on this file since 0a58b3f was e7de6cc, checked in by Tomasz Obrebski <to@…>, 14 years ago | |
|---|---|
|
|
| File size: 569 bytes | |
| Rev | Line | |
|---|---|---|
| [5f4d9c3] | 1 | #ifndef _MGRAPH_HH |
| 2 | #define _MGRAPH_HH | |
| 3 | ||
| 4 | #include <vector> | |
| 5 | ||
| 6 | #include "const.hh" | |
| 7 | #include "thesymbols.hh" | |
| 8 | #include "../common/common.h" | |
| 9 | ||
| [e7de6cc] | 10 | |
| 11 | using namespace std; | |
| 12 | ||
| [5f4d9c3] | 13 | class MNode |
| 14 | { | |
| 15 | public: | |
| 16 | ||
| 17 | int pos; | |
| [e7de6cc] | 18 | char form[256]; |
| 19 | Cat cat; | |
| 20 | vector<int> pred; | |
| [5f4d9c3] | 21 | vector<int> snodes; |
| 22 | ||
| 23 | void clear() { snodes.clear(); }; | |
| 24 | }; | |
| [e7de6cc] | 25 | |
| [5f4d9c3] | 26 | class MGraph |
| 27 | { | |
| [e7de6cc] | 28 | public: |
| [5f4d9c3] | 29 | |
| [e7de6cc] | 30 | void clear() { nodes.clear(); } |
| 31 | int size() { return nodes.size(); } | |
| [5f4d9c3] | 32 | int add_node(char* seg); |
| [e7de6cc] | 33 | MNode& operator[](int i) { return nodes[i]; } |
| 34 | ||
| 35 | private: | |
| 36 | ||
| 37 | vector<MNode> nodes; | |
| 38 | ||
| [5f4d9c3] | 39 | }; |
| 40 | ||
| 41 | #endif |
Note: See TracBrowser
for help on using the repository browser.