My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
RegParser.h
Go to the documentation of this file.
1 #ifndef GCP_UTIL_REGPARSER_H
2 #define GCP_UTIL_REGPARSER_H
3 
11 #include "gcp/util/common/RegDescription.h"
12 
13 #include "gcp/control/code/unix/libunix_src/specific/specificregs.h"
14 
15 namespace gcp {
16  namespace util {
17 
18  class RegParser {
19  public:
20 
28  RegParser(bool archivedOnly_=false);
29 
33  virtual ~RegParser();
34 
38  std::vector<RegDescription> inputRegs(std::string regStr,
39  RegInputMode mode=REG_INPUT_RANGE,
40  bool tell=true,
41  bool extend=true,
42  bool splitIndices=false);
43 
48  std::vector<RegDescription> inputRegs(std::string regStr,
49  ArrayMap* arrayMap,
50  RegInputMode mode,
51  bool tell,
52  bool extend,
53  bool splitIndices=false,
54  bool doThrow=true);
55 
68  std::vector<RegDescription> inputRegs(InputStream* stream,
69  bool tell,
70  ArrayMap* arraymap,
71  RegInputMode mode,
72  bool extend,
73  bool splitIndices=false,
74  bool doThrow=true);
75 
79  RegDescription inputReg(std::string regStr,
80  RegInputMode mode=REG_INPUT_RANGE,
81  bool tell=true,
82  bool extend=true);
83 
88  bool tell,
89  RegInputMode mode,
90  bool extend,
91  ArrayMap* arraymap=0);
92 
96  inline RegValidity validity() {
97  return validity_;
98  }
99 
103  static unsigned getSize(RegMapBlock* block, RegAspect aspect, bool extend);
104 
105  private:
106 
107  // An array map
108 
109  ArrayMapBase arrayMap_;
110 
111  RegValidity validity_; // The validity flag of the last read
112  // register specification
113 
114  bool archivedOnly_; // If true, offsets for the archived
115  // register map should be used.
116 
117  // True if the next token is a '.' followed by some string
118 
119  bool wordFollows(InputStream* stream);
120 
124  RegAspect checkAspect(InputStream* stream);
125 
129  RegInteg checkInteg(InputStream* stream);
130 
134  CoordRange readIndexRanges(InputStream* stream);
135 
139  Range<unsigned> readIndexRange(InputStream* stream);
140 
145  void checkValidityOfMode(RegInputMode mode, ArrRegMap* aregmap,
146  RegMapBoard* brd, RegMapBlock* blk,
147  CoordRange& range, unsigned size);
148 
149 
150  }; // End class RegParser
151 
152  } // End namespace util
153 } // End namespace gcp
154 
155 
156 
157 
158 #endif // End #ifndef GCP_UTIL_REGPARSER_H
static unsigned getSize(RegMapBlock *block, RegAspect aspect, bool extend)
Definition: RegParser.cc:798
Definition: input.h:87
Definition: arraymap.h:63
Definition: CoordRange.h:20
RegDescription inputReg(std::string regStr, RegInputMode mode=REG_INPUT_RANGE, bool tell=true, bool extend=true)
Definition: RegParser.cc:597
std::vector< RegDescription > inputRegs(std::string regStr, RegInputMode mode=REG_INPUT_RANGE, bool tell=true, bool extend=true, bool splitIndices=false)
Definition: RegParser.cc:451
Definition: RegParser.h:18
virtual ~RegParser()
Definition: RegParser.cc:21
Definition: ArrayMapBase.h:47
Definition: RegDescription.h:26
RegValidity validity()
Definition: RegParser.h:96
Definition: arraymap.h:177
Definition: Range.h:18
RegParser(bool archivedOnly_=false)
Definition: RegParser.cc:15