]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdInterpreter.h
Merge llvm, clang, compiler-rt, libc++, lld, and lldb release_80 branch
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdInterpreter.h
1 //===-- MICmdInterpreter.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #pragma once
11
12 // In-house headers:
13 #include "MICmdData.h"
14 #include "MICmnBase.h"
15 #include "MIUtilSingletonBase.h"
16
17 // Declarations:
18 class CMICmdFactory;
19
20 //++
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
25 //          MI application.
26 //          A singleton class.
27 //--
28 class CMICmdInterpreter : public CMICmnBase,
29                           public MI::ISingleton<CMICmdInterpreter> {
30   friend MI::ISingleton<CMICmdInterpreter>;
31
32   // Methods:
33 public:
34   // Methods:
35 public:
36   bool Initialize() override;
37   bool Shutdown() override;
38   bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid,
39                     bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
40
41   // Methods:
42 private:
43   /* ctor */ CMICmdInterpreter();
44   /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
45   void operator=(const CMICmdInterpreter &);
46
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;
53
54   // Overridden:
55 private:
56   // From CMICmnBase
57   /* dtor */ ~CMICmdInterpreter() override;
58
59   // Attributes:
60 private:
61   SMICmdData m_miCmdData; // Filled in on each new line being interpreted
62   CMICmdFactory &m_rCmdFactory;
63 };