|
2 | 2 | title: "IDebugExpressionEvaluator3::Parse2 | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -helpviewer_keywords: |
| 5 | +helpviewer_keywords: |
6 | 6 | - "IDebugExpressionEvaluator3::Parse2"
|
7 | 7 | ms.assetid: 78099628-d600-4f76-b7c8-ee07c864af1e
|
8 | 8 | author: "gregvanl"
|
9 | 9 | ms.author: "gregvanl"
|
10 | 10 | manager: jillfra
|
11 |
| -ms.workload: |
| 11 | +ms.workload: |
12 | 12 | - "vssdk"
|
13 | 13 | ---
|
14 | 14 | # IDebugExpressionEvaluator3::Parse2
|
15 |
| -Converts an expression string to a parsed expression given the symbol provider and the address of the evaluating frame. |
16 |
| - |
17 |
| -## Syntax |
18 |
| - |
19 |
| -```cpp |
20 |
| -HRESULT Parse2 ( |
21 |
| - LPCOLESTR upstrExpression, |
22 |
| - PARSEFLAGS dwFlags, |
23 |
| - UINT nRadix, |
24 |
| - IDebugSymbolProvider* pSymbolProvider, |
25 |
| - IDebugAddress* pAddress, |
26 |
| - BSTR* pbstrError, |
27 |
| - UINT* pichError, |
28 |
| - IDebugParsedExpression** ppParsedExpression |
29 |
| -); |
30 |
| -``` |
31 |
| - |
32 |
| -```csharp |
33 |
| -HRESULT Parse2 ( |
34 |
| - string upstrExpression, |
35 |
| - enum_PARSEFLAGS dwFlags, |
36 |
| - uint nRadix, |
37 |
| - IDebugSymbolProvider pSymbolProvider, |
38 |
| - IDebugAddress pAddress, |
39 |
| - out string pbstrError, |
40 |
| - out uint pichError, |
41 |
| - out IDebugParsedExpression ppParsedExpression |
42 |
| -); |
43 |
| -``` |
44 |
| - |
45 |
| -#### Parameters |
46 |
| - `upstrExpression` |
47 |
| - [in] The expression string to be parsed. |
48 |
| - |
49 |
| - `dwFlags` |
50 |
| - [in] A collection of [PARSEFLAGS](../../../extensibility/debugger/reference/parseflags.md) constants that determine how the expression is to be parsed. |
51 |
| - |
52 |
| - `nRadix` |
53 |
| - [in] Radix to be used to interpret any numerical information. |
54 |
| - |
55 |
| - `pSymbolProvider` |
56 |
| - [in] Interface of the symbol provider. |
57 |
| - |
58 |
| - `pAddress` |
59 |
| - [in] Address of the evaluating frame. |
60 |
| - |
61 |
| - `pbstrError` |
62 |
| - [out] Returns the error as human-readable text. |
63 |
| - |
64 |
| - `pichError` |
65 |
| - [out] Returns the character position of the start of the error in the expression string. |
66 |
| - |
67 |
| - `ppParsedExpression` |
68 |
| - [out] Returns the parsed expression in an [IDebugParsedExpression](../../../extensibility/debugger/reference/idebugparsedexpression.md) object. |
69 |
| - |
70 |
| -## Return Value |
71 |
| - If successful, returns `S_OK`; otherwise, returns an error code. |
72 |
| - |
73 |
| -## Remarks |
74 |
| - This method produces a parsed expression, not an actual value. A parsed expression is ready to be evaluated, that is, converted to a value. |
75 |
| - |
76 |
| -## Example |
77 |
| - The following example shows how to implement this method for a **CEE** object that exposes the [IDebugExpressionEvaluator3](../../../extensibility/debugger/reference/idebugexpressionevaluator3.md) interface. |
78 |
| - |
79 |
| -```cpp |
80 |
| -HRESULT CEE::Parse2 ( LPCOLESTR in_szExprText, |
81 |
| - PARSEFLAGS in_FLAGS, |
82 |
| - UINT in_RADIX, |
83 |
| - IDebugSymbolProvider *pSymbolProvider, |
84 |
| - IDebugAddress *pAddress, |
85 |
| - BSTR* out_pbstrError, |
86 |
| - UINT* inout_pichError, |
87 |
| - IDebugParsedExpression** out_ppParsedExpression ) |
88 |
| -{ |
89 |
| - // precondition |
90 |
| - REQUIRE( NULL != in_szExprText ); |
91 |
| - //REQUIRE( NULL != out_pbstrError ); |
92 |
| - REQUIRE( NULL != inout_pichError ); |
93 |
| - REQUIRE( NULL != out_ppParsedExpression ); |
94 |
| - |
95 |
| - if (NULL == in_szExprText) |
96 |
| - return E_INVALIDARG; |
97 |
| - |
98 |
| - if (NULL == inout_pichError) |
99 |
| - return E_POINTER; |
100 |
| - |
101 |
| - if (NULL == out_ppParsedExpression) |
102 |
| - return E_POINTER; |
103 |
| - |
104 |
| - if (out_pbstrError) |
105 |
| - *out_pbstrError = NULL; |
106 |
| - |
107 |
| - *out_ppParsedExpression = NULL; |
108 |
| - |
109 |
| - INVARIANT( this ); |
110 |
| - |
111 |
| - if (!this->ClassInvariant()) |
112 |
| - return E_UNEXPECTED; |
113 |
| - |
114 |
| - // function body |
115 |
| - EEDomain::fParseExpression DomainVal = |
116 |
| - { |
117 |
| - this, // CEE* |
118 |
| - in_szExprText, // LPCOLESTR |
119 |
| - in_FLAGS, // EVALFLAGS |
120 |
| - in_RADIX, // RADIX |
121 |
| - out_pbstrError , // BSTR* |
122 |
| - inout_pichError, // UINT* |
123 |
| - pSymbolProvider, |
124 |
| - out_ppParsedExpression // Output |
125 |
| - }; |
126 |
| - |
127 |
| - return (*m_LanguageSpecificUseCases.pfParseExpression)(DomainVal); |
128 |
| -} |
129 |
| -``` |
130 |
| - |
131 |
| -## See Also |
132 |
| - [IDebugExpressionEvaluator3](../../../extensibility/debugger/reference/idebugexpressionevaluator3.md) |
| 15 | +Converts an expression string to a parsed expression given the symbol provider and the address of the evaluating frame. |
| 16 | + |
| 17 | +## Syntax |
| 18 | + |
| 19 | +```cpp |
| 20 | +HRESULT Parse2 ( |
| 21 | + LPCOLESTR upstrExpression, |
| 22 | + PARSEFLAGS dwFlags, |
| 23 | + UINT nRadix, |
| 24 | + IDebugSymbolProvider* pSymbolProvider, |
| 25 | + IDebugAddress* pAddress, |
| 26 | + BSTR* pbstrError, |
| 27 | + UINT* pichError, |
| 28 | + IDebugParsedExpression** ppParsedExpression |
| 29 | +); |
| 30 | +``` |
| 31 | + |
| 32 | +```csharp |
| 33 | +HRESULT Parse2 ( |
| 34 | + string upstrExpression, |
| 35 | + enum_PARSEFLAGS dwFlags, |
| 36 | + uint nRadix, |
| 37 | + IDebugSymbolProvider pSymbolProvider, |
| 38 | + IDebugAddress pAddress, |
| 39 | + out string pbstrError, |
| 40 | + out uint pichError, |
| 41 | + out IDebugParsedExpression ppParsedExpression |
| 42 | +); |
| 43 | +``` |
| 44 | + |
| 45 | +#### Parameters |
| 46 | +`upstrExpression` |
| 47 | +[in] The expression string to be parsed. |
| 48 | + |
| 49 | +`dwFlags` |
| 50 | +[in] A collection of [PARSEFLAGS](../../../extensibility/debugger/reference/parseflags.md) constants that determine how the expression is to be parsed. |
| 51 | + |
| 52 | +`nRadix` |
| 53 | +[in] Radix to be used to interpret any numerical information. |
| 54 | + |
| 55 | +`pSymbolProvider` |
| 56 | +[in] Interface of the symbol provider. |
| 57 | + |
| 58 | +`pAddress` |
| 59 | +[in] Address of the evaluating frame. |
| 60 | + |
| 61 | +`pbstrError` |
| 62 | +[out] Returns the error as human-readable text. |
| 63 | + |
| 64 | +`pichError` |
| 65 | +[out] Returns the character position of the start of the error in the expression string. |
| 66 | + |
| 67 | +`ppParsedExpression` |
| 68 | +[out] Returns the parsed expression in an [IDebugParsedExpression](../../../extensibility/debugger/reference/idebugparsedexpression.md) object. |
| 69 | + |
| 70 | +## Return Value |
| 71 | +If successful, returns `S_OK`; otherwise, returns an error code. |
| 72 | + |
| 73 | +## Remarks |
| 74 | +This method produces a parsed expression, not an actual value. A parsed expression is ready to be evaluated, that is, converted to a value. |
| 75 | + |
| 76 | +## Example |
| 77 | +The following example shows how to implement this method for a **CEE** object that exposes the [IDebugExpressionEvaluator3](../../../extensibility/debugger/reference/idebugexpressionevaluator3.md) interface. |
| 78 | + |
| 79 | +```cpp |
| 80 | +HRESULT CEE::Parse2 ( LPCOLESTR in_szExprText, |
| 81 | + PARSEFLAGS in_FLAGS, |
| 82 | + UINT in_RADIX, |
| 83 | + IDebugSymbolProvider *pSymbolProvider, |
| 84 | + IDebugAddress *pAddress, |
| 85 | + BSTR* out_pbstrError, |
| 86 | + UINT* inout_pichError, |
| 87 | + IDebugParsedExpression** out_ppParsedExpression ) |
| 88 | +{ |
| 89 | + // precondition |
| 90 | + REQUIRE( NULL != in_szExprText ); |
| 91 | + //REQUIRE( NULL != out_pbstrError ); |
| 92 | + REQUIRE( NULL != inout_pichError ); |
| 93 | + REQUIRE( NULL != out_ppParsedExpression ); |
| 94 | + |
| 95 | + if (NULL == in_szExprText) |
| 96 | + return E_INVALIDARG; |
| 97 | + |
| 98 | + if (NULL == inout_pichError) |
| 99 | + return E_POINTER; |
| 100 | + |
| 101 | + if (NULL == out_ppParsedExpression) |
| 102 | + return E_POINTER; |
| 103 | + |
| 104 | + if (out_pbstrError) |
| 105 | + *out_pbstrError = NULL; |
| 106 | + |
| 107 | + *out_ppParsedExpression = NULL; |
| 108 | + |
| 109 | + INVARIANT( this ); |
| 110 | + |
| 111 | + if (!this->ClassInvariant()) |
| 112 | + return E_UNEXPECTED; |
| 113 | + |
| 114 | + // function body |
| 115 | + EEDomain::fParseExpression DomainVal = |
| 116 | + { |
| 117 | + this, // CEE* |
| 118 | + in_szExprText, // LPCOLESTR |
| 119 | + in_FLAGS, // EVALFLAGS |
| 120 | + in_RADIX, // RADIX |
| 121 | + out_pbstrError, // BSTR* |
| 122 | + inout_pichError, // UINT* |
| 123 | + pSymbolProvider, |
| 124 | + out_ppParsedExpression // Output |
| 125 | + }; |
| 126 | + |
| 127 | + return (*m_LanguageSpecificUseCases.pfParseExpression)(DomainVal); |
| 128 | +} |
| 129 | +``` |
| 130 | +
|
| 131 | +## See Also |
| 132 | +[IDebugExpressionEvaluator3](../../../extensibility/debugger/reference/idebugexpressionevaluator3.md) |
0 commit comments