コード例 #1
0
 public DogeSymbolTable(DogeSymbolTableType symbolTableType = DogeSymbolTableType.Namespace) : this(
         name : "",
         fullName : new List <string>(),
         symbolTableType : symbolTableType,
         parent : null)
 {
 }
コード例 #2
0
 public DogeSymbolTable GetOrAddSymbolTable(string key, DogeSymbolTableType symbolTableType) =>
 SymbolTables.TryGetValue(key, out var newSymbolTable)
         ? newSymbolTable
         : (SymbolTables[key]
                = new DogeSymbolTable(
                      key,
                      FullName.With(key),
                      symbolTableType,
                      this));
コード例 #3
0
 public DogeSymbolTable(string name, IList <string> fullName, DogeSymbolTableType symbolTableType, DogeSymbolTable?parent = null) : this(
         name : name,
         fullName : fullName,
         symbolTables : new Dictionary <string, DogeSymbolTable>(),
         symbols : new Dictionary <string, DogeSymbol>(),
         symbolTableType : symbolTableType,
         parent : parent)
 {
 }
コード例 #4
0
 public DogeSymbolTable(string name, IList <string> fullName, IDictionary <string, DogeSymbolTable> symbolTables, IDictionary <string, DogeSymbol> symbols, DogeSymbolTableType symbolTableType, DogeSymbolTable?parent = null)
 {
     Name            = name;
     FullName        = fullName;
     SymbolTables    = symbolTables;
     Symbols         = symbols;
     SymbolTableType = symbolTableType;
     Parent          = parent;
 }
コード例 #5
0
        public DogeSymbolTable GetOrAddSymbolTable(ICollection <string> key, DogeSymbolTableType symbolTableType)
        {
            DogeSymbolTable symbolTable = this;

            foreach (var subkey in key)
            {
                symbolTable = symbolTable.GetOrAddSymbolTable(subkey, symbolTableType);
            }

            return(symbolTable);
        }