示例#1
0
        ISymbolTableEntry ISymbolTable.Enter(string entry_name)
        {
            SymbolTableEntry entry = new SymbolTableEntry(entry_name, this);

            m_SymbolTable.Add(entry_name, entry);
            return(entry);
        }
示例#2
0
        public static void RecordTableEntry(SymbolTableEntry entry)
        {
            Append(entry.m_Name);
            var attributes = entry.m_Attributes;

            foreach (var attribute in attributes)
            {
                if (attribute.Key == SymbolTableAttributeKeyType.ConstantValue)
                {
                    Append($" const: {(int)attribute.Value}");
                }
                else if (attribute.Key == SymbolTableAttributeKeyType.Offset)
                {
                    Append($" offset: {(int)attribute.Value}");
                }
                else if (attribute.Key == SymbolTableAttributeKeyType.Address)
                {
                    Append($" address: {(int)attribute.Value}");
                }
            }
            Append("\n");
        }