Exemplo n.º 1
0
 protected internal ATNConfigSet(Antlr4.Runtime.Atn.ATNConfigSet set, bool @readonly)
 {
     if (@readonly)
     {
         this.mergedConfigs = null;
         this.unmerged      = null;
     }
     else
     {
         if (!set.IsReadOnly)
         {
             this.mergedConfigs = new Dictionary <long, ATNConfig>(set.mergedConfigs);
             this.unmerged      = new List <ATNConfig>(set.unmerged);
         }
         else
         {
             this.mergedConfigs = new Dictionary <long, ATNConfig>(set.configs.Count);
             this.unmerged      = new List <ATNConfig>();
         }
     }
     this.configs = new List <ATNConfig>(set.configs);
     this.dipsIntoOuterContext = set.dipsIntoOuterContext;
     this.hasSemanticContext   = set.hasSemanticContext;
     this.outermostConfigSet   = set.outermostConfigSet;
     if (@readonly || !set.IsReadOnly)
     {
         this.uniqueAlt    = set.uniqueAlt;
         this.conflictInfo = set.conflictInfo;
     }
 }
Exemplo n.º 2
0
 public virtual Antlr4.Runtime.Atn.ATNConfigSet Clone(bool @readonly)
 {
     Antlr4.Runtime.Atn.ATNConfigSet copy = new Antlr4.Runtime.Atn.ATNConfigSet(this, @readonly);
     if (!@readonly && this.IsReadOnly)
     {
         copy.AddAll(configs);
     }
     return(copy);
 }
Exemplo n.º 3
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (!(obj is Antlr4.Runtime.Atn.ATNConfigSet))
     {
         return(false);
     }
     Antlr4.Runtime.Atn.ATNConfigSet other = (Antlr4.Runtime.Atn.ATNConfigSet)obj;
     return(this.outermostConfigSet == other.outermostConfigSet && Utils.Equals(conflictInfo, other.conflictInfo) && configs.SequenceEqual(other.configs));
 }