Skip to content

Commit 4c80d66

Browse files
committed
Change ExpressionParser methods names (remove redundant parts).
1 parent 0291b09 commit 4c80d66

File tree

4 files changed

+43
-45
lines changed

4 files changed

+43
-45
lines changed

Visual_Studio_2017/GraphicalDebugging/ExpressionLoader.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ protected ExpressionDrawer.Point LoadPointParsed(Debugger debugger, string name,
579579
bool okx = true, oky = true;
580580
double x = 0, y = 0;
581581
if (count > 0)
582-
okx = ExpressionParser.TryLoadAsDoubleParsed(debugger, ptrName + "[0]", out x);
582+
okx = ExpressionParser.TryLoadDouble(debugger, ptrName + "[0]", out x);
583583
if (count > 1)
584-
oky = ExpressionParser.TryLoadAsDoubleParsed(debugger, ptrName + "[1]", out y);
584+
oky = ExpressionParser.TryLoadDouble(debugger, ptrName + "[1]", out y);
585585
return Util.IsOk(okx, oky)
586586
? new ExpressionDrawer.Point(x, y)
587587
: null;
@@ -918,7 +918,7 @@ public override void Load(Loaders loaders, MemoryReader mreader, Debugger debugg
918918
Geometry.Point center = pointLoader.LoadPoint(mreader, debugger,
919919
m_center, pointType);
920920
double radius = 0;
921-
bool ok = ExpressionParser.TryLoadAsDoubleParsed(debugger, m_radius, out radius);
921+
bool ok = ExpressionParser.TryLoadDouble(debugger, m_radius, out radius);
922922

923923
result = Util.IsOk(center, ok)
924924
? new ExpressionDrawer.NSphere(center, radius)
@@ -1706,7 +1706,7 @@ ContainerLoader ElementsLoader(Loaders loaders, Debugger debugger,
17061706

17071707
int LoadSize(Debugger debugger, string name)
17081708
{
1709-
return ExpressionParser.LoadSizeParsed(debugger, name + ".m_members.values_count");
1709+
return ExpressionParser.LoadSize(debugger, name + ".m_members.values_count");
17101710
}
17111711

17121712
string RootNodePtr(string name)
@@ -1724,7 +1724,7 @@ bool IsLeaf(Debugger debugger, string nodePtrName, out bool result)
17241724
result = false;
17251725

17261726
int which = 0;
1727-
if (!ExpressionParser.TryLoadIntParsed(debugger, nodePtrName + "->which_", out which))
1727+
if (!ExpressionParser.TryLoadInt(debugger, nodePtrName + "->which_", out which))
17281728
return false;
17291729

17301730
result = (which == 0);
@@ -1778,10 +1778,10 @@ public override void Load(Loaders loaders, MemoryReader mreader, Debugger debugg
17781778
result = null;
17791779

17801780
double x0 = 0, y0 = 0, x1 = 0, y1 = 0;
1781-
bool okx0 = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".points_[0].coords_[0]", out x0);
1782-
bool oky0 = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".points_[0].coords_[1]", out y0);
1783-
bool okx1 = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".points_[1].coords_[0]", out x1);
1784-
bool oky1 = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".points_[1].coords_[1]", out y1);
1781+
bool okx0 = ExpressionParser.TryLoadDouble(debugger, name + ".points_[0].coords_[0]", out x0);
1782+
bool oky0 = ExpressionParser.TryLoadDouble(debugger, name + ".points_[0].coords_[1]", out y0);
1783+
bool okx1 = ExpressionParser.TryLoadDouble(debugger, name + ".points_[1].coords_[0]", out x1);
1784+
bool oky1 = ExpressionParser.TryLoadDouble(debugger, name + ".points_[1].coords_[1]", out y1);
17851785

17861786
if (! Util.IsOk(okx0, oky0, okx1, oky1))
17871787
return;
@@ -1806,10 +1806,10 @@ public override void Load(Loaders loaders, MemoryReader mreader, Debugger debugg
18061806
result = null;
18071807

18081808
double xl = 0, xh = 0, yl = 0, yh = 0;
1809-
bool okxl = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".ranges_[0].coords_[0]", out xl);
1810-
bool okxh = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".ranges_[0].coords_[1]", out xh);
1811-
bool okyl = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".ranges_[1].coords_[0]", out yl);
1812-
bool okyh = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".ranges_[1].coords_[1]", out yh);
1809+
bool okxl = ExpressionParser.TryLoadDouble(debugger, name + ".ranges_[0].coords_[0]", out xl);
1810+
bool okxh = ExpressionParser.TryLoadDouble(debugger, name + ".ranges_[0].coords_[1]", out xh);
1811+
bool okyl = ExpressionParser.TryLoadDouble(debugger, name + ".ranges_[1].coords_[0]", out yl);
1812+
bool okyh = ExpressionParser.TryLoadDouble(debugger, name + ".ranges_[1].coords_[1]", out yh);
18131813

18141814
if (! Util.IsOk(okxl, okxh, okyl, okyh))
18151815
return;
@@ -1955,7 +1955,7 @@ public override void Load(Loaders loaders, MemoryReader mreader, Debugger debugg
19551955
result = null;
19561956

19571957
int which = 0;
1958-
if (!ExpressionParser.TryLoadIntParsed(debugger, name + ".which_", out which))
1958+
if (!ExpressionParser.TryLoadInt(debugger, name + ".which_", out which))
19591959
return;
19601960

19611961
List<string> tparams = Util.Tparams(type);
@@ -1986,8 +1986,8 @@ public override Geometry.Traits LoadTraits(string type)
19861986
protected override ExpressionDrawer.Point LoadPointParsed(Debugger debugger, string name, string type)
19871987
{
19881988
double x = 0, y = 0;
1989-
bool okx = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".first", out x);
1990-
bool oky = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + ".second", out y);
1989+
bool okx = ExpressionParser.TryLoadDouble(debugger, name + ".first", out x);
1990+
bool oky = ExpressionParser.TryLoadDouble(debugger, name + ".second", out y);
19911991
return Util.IsOk(okx, oky)
19921992
? new ExpressionDrawer.Point(x, y)
19931993
: null;
@@ -2384,7 +2384,7 @@ protected void LoadParsed(Debugger debugger, string name,
23842384
bool ok = loader.ForEachElement(debugger, name, delegate (string elName)
23852385
{
23862386
double value = 0;
2387-
bool okV = ExpressionParser.TryLoadAsDoubleParsed(debugger, elName, out value);
2387+
bool okV = ExpressionParser.TryLoadDouble(debugger, elName, out value);
23882388
if (okV)
23892389
values.Add(value);
23902390
return okV;
@@ -2517,8 +2517,8 @@ public override Geometry.Traits LoadTraits(string type)
25172517
protected override ExpressionDrawer.Point LoadPointParsed(Debugger debugger, string name, string type)
25182518
{
25192519
double x = 0, y = 0;
2520-
bool okx = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + "." + member_x, out x);
2521-
bool oky = ExpressionParser.TryLoadAsDoubleParsed(debugger, name + "." + member_y, out y);
2520+
bool okx = ExpressionParser.TryLoadDouble(debugger, name + "." + member_x, out x);
2521+
bool oky = ExpressionParser.TryLoadDouble(debugger, name + "." + member_y, out y);
25222522
return Util.IsOk(okx, oky)
25232523
? new ExpressionDrawer.Point(x, y)
25242524
: null;

Visual_Studio_2017/GraphicalDebugging/ExpressionLoader_BoostGil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public override void Load(Loaders loaders, MemoryReader mreader, Debugger debugg
3939
// memory random size could be loaded here. Then also the memory probably points
4040
// to some random place in memory (maybe protected?) so the result will probably
4141
// be another exception which is fine or an image containing noise from memory.
42-
int width = ExpressionParser.LoadSizeParsed(debugger, name + "._view._dimensions.x");
43-
int height = ExpressionParser.LoadSizeParsed(debugger, name + "._view._dimensions.y");
42+
int width = ExpressionParser.LoadSize(debugger, name + "._view._dimensions.x");
43+
int height = ExpressionParser.LoadSize(debugger, name + "._view._dimensions.y");
4444
if (width < 1 || height < 1)
4545
return;
4646

Visual_Studio_2017/GraphicalDebugging/ExpressionLoader_ContainerLoader.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public override string ElementName(string name, string elType)
222222

223223
public override int LoadSize(Debugger debugger, string name)
224224
{
225-
return ExpressionParser.LoadSizeParsed(debugger, name + ".m_holder.m_size");
225+
return ExpressionParser.LoadSize(debugger, name + ".m_holder.m_size");
226226
}
227227
}
228228

@@ -254,7 +254,7 @@ public override string ElementName(string name, string elType)
254254

255255
public override int LoadSize(Debugger debugger, string name)
256256
{
257-
return ExpressionParser.LoadSizeParsed(debugger, name + ".m_size");
257+
return ExpressionParser.LoadSize(debugger, name + ".m_size");
258258
}
259259
}
260260

@@ -264,7 +264,7 @@ class BoostCircularBuffer : RandomAccessContainer
264264

265265
public override int LoadSize(Debugger debugger, string name)
266266
{
267-
return ExpressionParser.LoadSizeParsed(debugger, name + ".m_size");
267+
return ExpressionParser.LoadSize(debugger, name + ".m_size");
268268
}
269269

270270
public override string ElementName(string name, string elType)
@@ -338,7 +338,7 @@ public override bool ForEachMemoryBlock(MemoryReader mreader, Debugger debugger,
338338
private void LoadSizes(Debugger debugger, string name, out int size1, out int size2)
339339
{
340340
int size = LoadSize(debugger, name);
341-
int size_fe = ExpressionParser.LoadSizeParsed(debugger, "(" + name + ".m_end - " + name + ".m_first)");
341+
int size_fe = ExpressionParser.LoadSize(debugger, "(" + name + ".m_end - " + name + ".m_first)");
342342

343343
size1 = size;
344344
size2 = 0;
@@ -366,7 +366,7 @@ public override string ElementName(string name, string elType)
366366

367367
public override int LoadSize(Debugger debugger, string name)
368368
{
369-
return ExpressionParser.LoadSizeParsed(debugger, SizeStr(name));
369+
return ExpressionParser.LoadSize(debugger, SizeStr(name));
370370
}
371371

372372
private string FirstStr(string name)
@@ -415,7 +415,7 @@ public override bool ForEachMemoryBlock(MemoryReader mreader, Debugger debugger,
415415

416416
// Map size
417417
int mapSize = 0;
418-
if (! ExpressionParser.TryLoadIntParsed(debugger, MapSizeStr(name), out mapSize))
418+
if (! ExpressionParser.TryLoadInt(debugger, MapSizeStr(name), out mapSize))
419419
return false;
420420

421421
// Map - array of pointers
@@ -425,12 +425,12 @@ public override bool ForEachMemoryBlock(MemoryReader mreader, Debugger debugger,
425425

426426
// Block size
427427
int dequeSize = 0;
428-
if (! ExpressionParser.TryLoadIntParsed(debugger, "((int)" + name + "._EEN_DS)", out dequeSize))
428+
if (! ExpressionParser.TryLoadInt(debugger, "((int)" + name + "._EEN_DS)", out dequeSize))
429429
return false;
430430

431431
// Offset
432432
int offset = 0;
433-
if (! ExpressionParser.TryLoadIntParsed(debugger, OffsetStr(name), out offset))
433+
if (! ExpressionParser.TryLoadInt(debugger, OffsetStr(name), out offset))
434434
return false;
435435

436436
// Initial indexes
@@ -483,7 +483,7 @@ public override bool ForEachMemoryBlock(MemoryReader mreader, Debugger debugger,
483483

484484
public override int LoadSize(Debugger debugger, string name)
485485
{
486-
return ExpressionParser.LoadSizeParsed(debugger, SizeStr(name));
486+
return ExpressionParser.LoadSize(debugger, SizeStr(name));
487487
}
488488

489489
private string MapSizeStr(string name)
@@ -600,7 +600,7 @@ public override bool ForEachMemoryBlock(MemoryReader mreader, Debugger debugger,
600600

601601
public override int LoadSize(Debugger debugger, string name)
602602
{
603-
return ExpressionParser.LoadSizeParsed(debugger, SizeStr(name));
603+
return ExpressionParser.LoadSize(debugger, SizeStr(name));
604604
}
605605

606606
public override bool ForEachElement(Debugger debugger, string name, ElementPredicate elementPredicate)
@@ -733,7 +733,7 @@ private bool ForEachMemoryBlockRecursive(MemoryReader mreader,
733733

734734
public override int LoadSize(Debugger debugger, string name)
735735
{
736-
return ExpressionParser.LoadSizeParsed(debugger, SizeStr(name));
736+
return ExpressionParser.LoadSize(debugger, SizeStr(name));
737737
}
738738

739739
public override bool ForEachElement(Debugger debugger, string name, ElementPredicate elementPredicate)
@@ -800,7 +800,7 @@ public override string ElementType(string type)
800800

801801
public override int LoadSize(Debugger debugger, string name)
802802
{
803-
return ExpressionParser.LoadSizeParsed(debugger, name + ".Length");
803+
return ExpressionParser.LoadSize(debugger, name + ".Length");
804804
}
805805

806806
public override string ElementName(string name, string elType)
@@ -825,7 +825,7 @@ class CSList : ContiguousContainer
825825

826826
public override int LoadSize(Debugger debugger, string name)
827827
{
828-
return ExpressionParser.LoadSizeParsed(debugger, name + ".Count");
828+
return ExpressionParser.LoadSize(debugger, name + ".Count");
829829
}
830830

831831
public override string RandomAccessElementName(string rawName, int i)

Visual_Studio_2017/GraphicalDebugging/ExpressionParser.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,25 @@ namespace GraphicalDebugging
1616
{
1717
class ExpressionParser
1818
{
19-
// TODO: change names - remove "Parsed"
20-
21-
public int LoadSizeParsed(string name)
19+
public int LoadSize(string name)
2220
{
23-
return LoadSizeParsed(debugger, name);
21+
return LoadSize(debugger, name);
2422
}
2523

26-
public static int LoadSizeParsed(Debugger debugger, string name)
24+
public static int LoadSize(Debugger debugger, string name)
2725
{
2826
Expression expr = debugger.GetExpression(name);
2927
return expr.IsValidValue
3028
? Math.Max(Util.ParseInt(expr.Value, debugger.HexDisplayMode), 0)
3129
: 0;
3230
}
3331

34-
public bool TryLoadIntParsed(string name, out int result)
32+
public bool TryLoadInt(string name, out int result)
3533
{
36-
return TryLoadIntParsed(debugger, name, out result);
34+
return TryLoadInt(debugger, name, out result);
3735
}
3836

39-
public static bool TryLoadIntParsed(Debugger debugger, string name, out int result)
37+
public static bool TryLoadInt(Debugger debugger, string name, out int result)
4038
{
4139
result = 0;
4240
Expression expr = debugger.GetExpression(name);
@@ -46,12 +44,12 @@ public static bool TryLoadIntParsed(Debugger debugger, string name, out int resu
4644
return true;
4745
}
4846

49-
public bool TryLoadAsDoubleParsed(string name, out double result)
47+
public bool TryLoadDouble(string name, out double result)
5048
{
51-
return TryLoadAsDoubleParsed(debugger, name, out result);
49+
return TryLoadDouble(debugger, name, out result);
5250
}
5351

54-
public static bool TryLoadAsDoubleParsed(Debugger debugger, string name, out double result)
52+
public static bool TryLoadDouble(Debugger debugger, string name, out double result)
5553
{
5654
result = 0.0;
5755
Expression expr = debugger.GetExpression("(double)" + name);

0 commit comments

Comments
 (0)