Line | |
---|
1 | #ifndef __cmt_sequence_h__ |
---|
2 | #define __cmt_sequence_h__ |
---|
3 | |
---|
4 | #include "cmt_awk.h" |
---|
5 | |
---|
6 | /** |
---|
7 | * This very simplified sequence interpreter is meant for |
---|
8 | * internal use only, for driving demo or test scenarios. |
---|
9 | * This is run as follows: |
---|
10 | * |
---|
11 | * > cd ../demo |
---|
12 | * > cmt run_sequence xxx.cmt |
---|
13 | * |
---|
14 | * where xxx.cmt is a text file containing descriptions of sequence steps: |
---|
15 | * |
---|
16 | * sequence_step : |
---|
17 | * package-creation |
---|
18 | * | file-description |
---|
19 | * | package-access |
---|
20 | * | cmt-action |
---|
21 | * | comment |
---|
22 | * |
---|
23 | * package-creation : |
---|
24 | * "%%package" <package-name> requirements-file |
---|
25 | * |
---|
26 | * This creates a package from the current location, at version v1 |
---|
27 | * structuration style is considered. |
---|
28 | * Requirements file follows the statement. |
---|
29 | * |
---|
30 | * requirements-file : |
---|
31 | * file-contents |
---|
32 | * |
---|
33 | * file-description : |
---|
34 | * "%%file" <file-path> file-contents |
---|
35 | * |
---|
36 | * Create a files relatively to the last created package. |
---|
37 | * |
---|
38 | * package-access : |
---|
39 | * "%%cdpackage" <package-name> |
---|
40 | * |
---|
41 | * Move to the cmt directory of the specified package |
---|
42 | * |
---|
43 | * cmt-action : |
---|
44 | * "%%cmt" <arguments> |
---|
45 | * |
---|
46 | * Perform the specified cmt action. |
---|
47 | * |
---|
48 | * file-contents : |
---|
49 | * line ... |
---|
50 | * |
---|
51 | * comment : |
---|
52 | * %%% ... |
---|
53 | * |
---|
54 | */ |
---|
55 | class SequenceRunner : public FAwk |
---|
56 | { |
---|
57 | public: |
---|
58 | |
---|
59 | SequenceRunner (); |
---|
60 | void begin (); |
---|
61 | void filter (const cmt_string& line); |
---|
62 | void end (); |
---|
63 | |
---|
64 | private: |
---|
65 | bool started; |
---|
66 | bool running; |
---|
67 | cmt_string style; |
---|
68 | cmt_string vdir; |
---|
69 | cmt_string package; |
---|
70 | cmt_string version; |
---|
71 | cmt_string filename; |
---|
72 | cmt_string buffer; |
---|
73 | cmt_string pwd; |
---|
74 | }; |
---|
75 | |
---|
76 | |
---|
77 | #endif |
---|
78 | |
---|
Note: See
TracBrowser
for help on using the repository browser.