Rev | Line | |
---|
[1097] | 1 | #ifndef MXCMDPARSER_INCLUDED // -*- C++ -*-
|
---|
| 2 | #define MXCMDPARSER_INCLUDED
|
---|
| 3 | #if !defined(__GNUC__)
|
---|
| 4 | # pragma once
|
---|
| 5 | #endif
|
---|
| 6 |
|
---|
| 7 | /************************************************************************
|
---|
| 8 |
|
---|
| 9 | MxCmdParser
|
---|
| 10 |
|
---|
| 11 | Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details.
|
---|
| 12 |
|
---|
| 13 | $Id: MxCmdParser.h,v 1.1 2002/09/24 16:53:54 wimmer Exp $
|
---|
| 14 |
|
---|
| 15 | ************************************************************************/
|
---|
| 16 |
|
---|
| 17 | #include "MxDynBlock.h"
|
---|
| 18 | #include "MxAsp.h"
|
---|
| 19 |
|
---|
| 20 | typedef MxDynBlock<char *> MxCmdPhrase;
|
---|
| 21 |
|
---|
| 22 | class MxCmd
|
---|
| 23 | {
|
---|
| 24 | public:
|
---|
| 25 | char *op;
|
---|
| 26 | MxDynBlock<MxCmdPhrase> phrases;
|
---|
| 27 |
|
---|
| 28 | MxCmd(int N) : phrases(N) { op=NULL; }
|
---|
| 29 | };
|
---|
| 30 |
|
---|
| 31 | class MxCmdParser
|
---|
| 32 | {
|
---|
| 33 | private:
|
---|
| 34 | MxCmd cmd;
|
---|
| 35 | MxAspStore store;
|
---|
| 36 |
|
---|
| 37 | public:
|
---|
| 38 | bool will_ignore_unknown;
|
---|
| 39 |
|
---|
| 40 | public:
|
---|
| 41 | MxCmdParser();
|
---|
| 42 |
|
---|
| 43 | MxAspStore *asp_store() { return &store; }
|
---|
| 44 |
|
---|
| 45 | void parse_line(char *, void *closure=NULL);
|
---|
| 46 |
|
---|
| 47 | virtual bool execute_command(const MxCmd& cmd, void *closure=NULL);
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 | // MXCMDPARSER_INCLUDED
|
---|
| 51 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.