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 //===----------------------------------------------------------------------===//
11 // File: MICmdInterpreter.h
13 // Overview: CMICmdInterpreter interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
25 #include "MICmnBase.h"
26 #include "MICmdData.h"
27 #include "MIUtilSingletonBase.h"
32 //++ ============================================================================
33 // Details: MI command interpreter. It takes text data from the MI driver
34 // (which got it from Stdin singleton) and validate the text to see if
35 // matches Machine Interface (MI) format and commands defined in the
39 // Authors: Illya Rudkin 18/02/2014.
42 class CMICmdInterpreter : public CMICmnBase, public MI::ISingleton<CMICmdInterpreter>
44 friend MI::ISingleton<CMICmdInterpreter>;
50 bool Initialize(void);
52 bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
56 /* ctor */ CMICmdInterpreter(void);
57 /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
58 void operator=(const CMICmdInterpreter &);
60 bool HasCmdFactoryGotMiCmd(const SMICmdData &vCmdData) const;
61 bool MiHasCmdTokenEndingHypthen(const CMIUtilString &vTextLine);
62 bool MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine);
63 bool MiHasCmd(const CMIUtilString &vTextLine);
64 bool MiHasCmdTokenPresent(const CMIUtilString &vTextLine);
65 const SMICmdData &MiGetCmdData() const;
70 /* dtor */ virtual ~CMICmdInterpreter(void);
74 SMICmdData m_miCmdData; // Filled in on each new line being interpreted
75 CMICmdFactory &m_rCmdFactory;