1 //===-- MICmdInterpreter.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
13 #include "MICmdData.h"
14 #include "MICmnBase.h"
15 #include "MIUtilSingletonBase.h"
21 //============================================================================
22 // Details: MI command interpreter. It takes text data from the MI driver
23 // (which got it from Stdin singleton) and validate the text to see if
24 // matches Machine Interface (MI) format and commands defined in the
28 class CMICmdInterpreter : public CMICmnBase,
29 public MI::ISingleton<CMICmdInterpreter> {
30 friend MI::ISingleton<CMICmdInterpreter>;
36 bool Initialize() override;
37 bool Shutdown() override;
38 bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid,
39 bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
43 /* ctor */ CMICmdInterpreter();
44 /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
45 void operator=(const CMICmdInterpreter &);
47 bool HasCmdFactoryGotMiCmd(const SMICmdData &vCmdData) const;
48 bool MiHasCmdTokenEndingHyphen(const CMIUtilString &vTextLine);
49 bool MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine);
50 bool MiHasCmd(const CMIUtilString &vTextLine);
51 bool MiHasCmdTokenPresent(const CMIUtilString &vTextLine);
52 const SMICmdData &MiGetCmdData() const;
57 /* dtor */ ~CMICmdInterpreter() override;
61 SMICmdData m_miCmdData; // Filled in on each new line being interpreted
62 CMICmdFactory &m_rCmdFactory;