]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdInterpreter.h
Add ELF Tool Chain's brandelf(1) to contrib
[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 //++
11 // File:        MICmdInterpreter.h
12 //
13 // Overview:    CMICmdInterpreter interface.
14 //
15 // Environment: Compilers:  Visual C++ 12.
16 //                          gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 //              Libraries:  See MIReadmetxt.
18 //
19 // Copyright:   None.
20 //--
21
22 #pragma once
23
24 // In-house headers:
25 #include "MICmnBase.h"
26 #include "MICmdData.h"
27 #include "MIUtilSingletonBase.h"
28
29 // Declarations:
30 class CMICmdFactory;
31
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
36 //          MI application.
37 //          A singleton class.
38 // Gotchas: None.
39 // Authors: Illya Rudkin 18/02/2014.
40 // Changes: None.
41 //--
42 class CMICmdInterpreter : public CMICmnBase, public MI::ISingleton<CMICmdInterpreter>
43 {
44     friend MI::ISingleton<CMICmdInterpreter>;
45
46     // Methods:
47   public:
48     // Methods:
49   public:
50     bool Initialize(void);
51     bool Shutdown(void);
52     bool ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesValid, bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
53
54     // Methods:
55   private:
56     /* ctor */ CMICmdInterpreter(void);
57     /* ctor */ CMICmdInterpreter(const CMICmdInterpreter &);
58     void operator=(const CMICmdInterpreter &);
59
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;
66
67     // Overridden:
68   private:
69     // From CMICmnBase
70     /* dtor */ virtual ~CMICmdInterpreter(void);
71
72     // Attributes:
73   private:
74     SMICmdData m_miCmdData; // Filled in on each new line being interpreted
75     CMICmdFactory &m_rCmdFactory;
76 };