1 //===-- MICmdInterpreter.h --------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 #include "MICmdData.h"
13 #include "MICmnBase.h"
14 #include "MIUtilSingletonBase.h"
20 //============================================================================
21 // Details: MI command interpreter. It takes text data from the MI driver
22 // (which got it from Stdin singleton) and validate the text to see if
23 // matches Machine Interface (MI) format and commands defined in the
27 class CMICmdInterpreter : public CMICmnBase,
28 public MI::ISingleton<CMICmdInterpreter> {
29 friend MI::ISingleton<CMICmdInterpreter>;
35 bool Initialize() override;
36 bool Shutdown() override;
37 bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid,
38 bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
42 /* ctor */ CMICmdInterpreter();
43 /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
44 void operator=(const CMICmdInterpreter &);
46 bool HasCmdFactoryGotMiCmd(const SMICmdData &vCmdData) const;
47 bool MiHasCmdTokenEndingHyphen(const CMIUtilString &vTextLine);
48 bool MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine);
49 bool MiHasCmd(const CMIUtilString &vTextLine);
50 bool MiHasCmdTokenPresent(const CMIUtilString &vTextLine);
51 const SMICmdData &MiGetCmdData() const;
56 /* dtor */ ~CMICmdInterpreter() override;
60 SMICmdData m_miCmdData; // Filled in on each new line being interpreted
61 CMICmdFactory &m_rCmdFactory;