forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsedCommand.h
More file actions
63 lines (46 loc) · 1.2 KB
/
sedCommand.h
File metadata and controls
63 lines (46 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Filename: sedCommand.h
// Created by: drose (24Oct00)
//
////////////////////////////////////////////////////////////////////
#ifndef SEDCOMMAND_H
#define SEDCOMMAND_H
#include "ppremake.h"
#include <sys/types.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#else
#include "gnu_regex.h"
#endif
class SedScript;
class SedContext;
class SedAddress;
///////////////////////////////////////////////////////////////////
// Class : SedCommand
// Description : This represents a single command (of several
// possible, separated by semicolons) to a SedProgram.
////////////////////////////////////////////////////////////////////
class SedCommand {
public:
SedCommand();
~SedCommand();
bool parse_command(const string &line, size_t &p);
void run(SedScript &script, SedContext &context);
private:
bool parse_s_params(const string &line, size_t &p);
void do_command(SedScript &script, SedContext &context);
void do_s_command(SedContext &context);
SedAddress *_addr1;
SedAddress *_addr2;
char _command;
string _text;
regex_t _re;
string _string1;
string _string2;
enum Flags {
F_have_re = 0x001,
F_g = 0x002,
};
int _flags;
bool _active;
};
#endif