예제 #1
0
        public virtual TResult VisitLabel(ILabelSymbol symbol)
        {
#pragma warning disable CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TResult' is a non-nullable reference type.
            return(DefaultVisit(symbol));

#pragma warning restore CS8717 // A member returning a [MaybeNull] value introduces a null value when 'TResult' is a non-nullable reference type.
        }
예제 #2
0
 public ForEachLoopOperation(ImmutableArray <ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, IOperation loopControlVariable,
                             IOperation collection, ImmutableArray <IOperation> nextVariables, bool isAsynchronous, IOperation body, ForEachLoopOperationInfo info,
                             SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional <object> constantValue, bool isImplicit) :
     this(loopControlVariable, collection, nextVariables, isAsynchronous, LoopKind.ForEach, body, locals, continueLabel, exitLabel, semanticModel, syntax, type, constantValue, isImplicit)
 {
     Info = info;
 }
 private static int CombineHashCodes(ILabelSymbol x, int currentHash)
 {
     return(Hash.Combine(
                x.Name,
                Hash.Combine(x.Locations.FirstOrDefault(), currentHash)
                ));
 }
예제 #4
0
파일: Label.cs 프로젝트: E024/NativeSharp
        internal void Parse(ILabelSymbol labelSymbol)
        {
            if (labelSymbol == null)
            {
                throw new ArgumentNullException();
            }

            this.LabelName = LabelStatement.GetUniqueLabel(labelSymbol);
        }
예제 #5
0
        public static string GetUniqueLabel(ILabelSymbol label)
        {
            var lbl = label.Name;

            if (!RequiresUniqueName(lbl))
            {
                return(label.Name);
            }

            var firstTime = false;

            lbl += string.Format("_{0}", CCodeWriterBase.GetId(label, out firstTime));

            return(lbl);
        }
예제 #6
0
 public override void VisitLabel(ILabelSymbol symbol)
 {
     base.VisitLabel(symbol);
 }
예제 #7
0
 public IBranchStatement Goto(ILabelSymbol label) => (IBranchStatement)proxy.Invoke(nameof(Goto), label);
 public override void VisitLabel(ILabelSymbol symbol)
 {
 }
예제 #9
0
 public LazyForLoopOperation(ImmutableArray <ILocalSymbol> locals, ImmutableArray <ILocalSymbol> conditionLocals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional <object> constantValue, bool isImplicit) :
     this(conditionLocals, LoopKind.For, locals, continueLabel, exitLabel, semanticModel, syntax, type, constantValue, isImplicit)
 {
 }
예제 #10
0
 public virtual TResult?VisitLabel(ILabelSymbol symbol)
 {
     return(DefaultVisit(symbol));
 }
 public override object VisitLabel(ILabelSymbol labelSymbol)
 {
     WriteType(SymbolKeyType.BodyLevel);
     BodyLevelSymbolKey.Create(labelSymbol, this);
     return(null);
 }
예제 #12
0
 public ILabelStatement Label(ILabelSymbol label) => (ILabelStatement)proxy.Invoke(nameof(Label), label);
예제 #13
0
 public override SymbolKey VisitLabel(ILabelSymbol labelSymbol)
 {
     return(new NonDeclarationSymbolKey <ILabelSymbol>(labelSymbol, this));
 }
예제 #14
0
 public virtual void VisitLabel(ILabelSymbol symbol)
 {
     DefaultVisit(symbol);
 }
예제 #15
0
 public static ILabelStatement Update(this ILabelStatement self, ILabelSymbol @label, IOperation @body) => self;
예제 #16
0
 public virtual TResult VisitLabel(ILabelSymbol symbol, TArgument argument)
 {
     return(DefaultVisit(symbol, argument));
 }
 public sealed override void VisitLabel(ILabelSymbol symbol)
 {
     // Fine.
 }
예제 #18
0
 public override void VisitLabel(ILabelSymbol symbol)
 {
     builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name));
 }
예제 #19
0
 public override void VisitLabel(ILabelSymbol symbol)
 {
     base.VisitLabel(symbol);
 }
 public override void VisitLabel(ILabelSymbol symbol)
 {
 }
예제 #21
0
 public override void VisitLabel(ILabelSymbol labelSymbol)
 => throw ExceptionUtilities.Unreachable;
 private bool LabelsAreEquivalent(ILabelSymbol x, ILabelSymbol y)
 {
     return
         x.Name == y.Name &&
         HaveSameLocation(x, y);
 }
예제 #23
0
 public override string VisitLabel(ILabelSymbol symbol)
 {
     return(Wrapped.VisitLabel(symbol, Context));
 }
 private bool LabelsAreEquivalent(ILabelSymbol x, ILabelSymbol y)
 {
     return
         (x.Name == y.Name &&
          HaveSameLocation(x, y));
 }
예제 #25
0
 public static IBranchStatement Update(this IBranchStatement self, ILabelSymbol @label, IOperation @caseExpressionOpt, IOperation @labelExpressionOpt) => self;
예제 #26
0
 public override void VisitLabel(ILabelSymbol symbol)
 {
     builder.Add(CreatePart(SymbolDisplayPartKind.LabelName, symbol, symbol.Name));
 }
예제 #27
0
 public static IWhileUntilLoopStatement Update(this IWhileUntilLoopStatement self, ImmutableArray <ISymbol> @locals, IOperation @condition, IOperation @body, ILabelSymbol @breakLabel, ILabelSymbol @continueLabel) => self;
예제 #28
0
 public ForLoopOperation(ImmutableArray <IOperation> before, IOperation condition, ImmutableArray <IOperation> atLoopBottom, ImmutableArray <ILocalSymbol> locals, ImmutableArray <ILocalSymbol> conditionLocals,
                         ILabelSymbol continueLabel, ILabelSymbol exitLabel, IOperation body, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional <object> constantValue, bool isImplicit) :
     this(before, conditionLocals, condition, atLoopBottom, LoopKind.For, body, locals, continueLabel, exitLabel, semanticModel, syntax, type, constantValue, isImplicit)
 {
 }
예제 #29
0
 public static IForLoopStatement Update(this IForLoopStatement self, ImmutableArray <ISymbol> @outerLocals, IOperation @initializer, ImmutableArray <ISymbol> @innerLocals, IOperation @condition, IOperation @increment, IOperation @body, ILabelSymbol @breakLabel, ILabelSymbol @continueLabel) => self;
예제 #30
0
 public SingleValueCaseClauseOperation(ILabelSymbol label, IOperation value, SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol type, Optional <object> constantValue, bool isImplicit) :
     this(value, CaseKind.SingleValue, label, semanticModel, syntax, type, constantValue, isImplicit)
 {
 }
예제 #31
0
 public static IForEachLoopStatement Update(this IForEachLoopStatement self, Object @enumeratorInfoOpt, Conversion @elementConversion, IOperation @iterationVariableType, ImmutableArray <ISymbol> @iterationVariables, IOperation @expression, IOperation @deconstructionOpt, IOperation @body, Boolean @checked, ILabelSymbol @breakLabel, ILabelSymbol @continueLabel) => self;
예제 #32
0
 public sealed override void VisitLabel(ILabelSymbol symbol)
 {
     // Fine.
 }
예제 #33
0
 public static ISwitchStatement Update(this ISwitchStatement self, IOperation @loweredPreambleOpt, IOperation @expression, ILabelSymbol @constantTargetOpt, ImmutableArray <ISymbol> @innerLocals, ImmutableArray <ISymbol> @innerLocalFunctions, ImmutableArray <IOperation> @switchSections, ILabelSymbol @breakLabel, IMethodSymbol @stringEquality) => self;
 private void AddDescriptionForLabel(ILabelSymbol symbol)
 {
     AddToGroup(SymbolDescriptionGroups.MainDescription,
                Description(FeaturesResources.Label),
                ToMinimalDisplayParts(symbol));
 }
예제 #35
0
 public static ILabelStatement Update(this ILabelStatement self, ILabelSymbol @label) => self;
 private void AddDescriptionForLabel(ILabelSymbol symbol)
 {
     AddToGroup(SymbolDescriptionGroups.MainDescription,
         Description(FeaturesResources.label),
         ToMinimalDisplayParts(symbol));
 }
예제 #37
0
 public virtual void VisitLabel(ILabelSymbol symbol)
 {
     DefaultVisit(symbol);
 }