]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdInterpreter.h
MFV r353613: 10731 zfs: NULL pointer errors
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdInterpreter.h
1 //===-- MICmdInterpreter.h --------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 #pragma once
10
11 // In-house headers:
12 #include "MICmdData.h"
13 #include "MICmnBase.h"
14 #include "MIUtilSingletonBase.h"
15
16 // Declarations:
17 class CMICmdFactory;
18
19 //++
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
24 //          MI application.
25 //          A singleton class.
26 //--
27 class CMICmdInterpreter : public CMICmnBase,
28                           public MI::ISingleton<CMICmdInterpreter> {
29   friend MI::ISingleton<CMICmdInterpreter>;
30
31   // Methods:
32 public:
33   // Methods:
34 public:
35   bool Initialize() override;
36   bool Shutdown() override;
37   bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid,
38                     bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
39
40   // Methods:
41 private:
42   /* ctor */ CMICmdInterpreter();
43   /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
44   void operator=(const CMICmdInterpreter &);
45
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;
52
53   // Overridden:
54 private:
55   // From CMICmnBase
56   /* dtor */ ~CMICmdInterpreter() override;
57
58   // Attributes:
59 private:
60   SMICmdData m_miCmdData; // Filled in on each new line being interpreted
61   CMICmdFactory &m_rCmdFactory;
62 };