本文整理汇总了C#中SymbolTable.GetSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# SymbolTable.GetSymbol方法的具体用法?C# SymbolTable.GetSymbol怎么用?C# SymbolTable.GetSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymbolTable
的用法示例。
在下文中一共展示了SymbolTable.GetSymbol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doModifyRecords
/**
* Looks at the modify records and does the adjustments in the records.
*
* @param mod the Module whose modify records should be calculated
* @param symb the SymbolTable that contains the symbols in the specified Module
*
* @refcode
* OB4
* @errtest
* @errmsg
* ES.50, ES.51, ES.56
* @author Mark Mathis
* @creation May 22, 2011
* @modlog
* @teststandard Andrew Buelow
* @codestandard Mark Mathis
*/
private void doModifyRecords(Module mod, SymbolTable symb)
{
var mRec = mod.ModifyRecords;
foreach (var rec in mRec)
{
int word = mRec[rec.Key].Word;
int s = Convert.ToInt32(Convert.ToString(word, 2).PadLeft(16, '0').Substring(6), 2);
//string sbin = Convert.ToString(word, 2).PadRight(10,'0');
//string swhat = sbin.Substring(6);
//int s = Convert.ToInt32(swhat, 2);
List<string> adjs = mRec[rec.Key].Adjustments;
for (int i = 0; i < adjs.Count; i += 2)
{
string sign = adjs[i];
string label = adjs[i + 1];
try
{
if (sign == "+")
{
word += symb.GetSymbol(label).LinkerValue;
s += symb.GetSymbol(label).LinkerValue;
}
else if (sign == "-")
{
word -= symb.GetSymbol(label).LinkerValue;
s -= symb.GetSymbol(label).LinkerValue;
}
else
{
// error, the sign should only be a + or -
errPrinter.PrintError(ErrCat.Serious, 50);
continue;
}
}
catch (Assembler.SymbolException)
{
// error, symbol doesn't exist in symbol table
errPrinter.PrintError(ErrCat.Serious, 51);
continue;
}
}
try
{
mod.GetTextRecord(mRec[rec.Key].Location).Word = word;
}
catch (NullReferenceException)
{
errPrinter.PrintError(ErrCat.Serious, 56);
}
}
}