public override void VisitLabelStatement(ILabelStatement labelStatement) { Value = new Statement() { LabelStatement = new LabelStatementFactory(labelStatement).Value }; }
private string GetFormat(string name, ILabelStatement label, bool declarePoint) { if (this.options != null && this.options.Formatter != null) { name = this.options.Formatter.FormatLabelToken(name, label, this.Options, declarePoint); } return(name); }
public override bool Visit(ILabelStatement statement, IStatement context) { _stack.Push(statement); try { return(base.Visit(statement, context)); } finally { _stack.Pop(); } }
public bool TryGetValue(string key, out ILabelStatement value) { foreach (var label in this.GetLabels()) { if (label.Name == key) { value = label; return(true); } } value = null; return(false); }
public override void VisitLabelStatement(ILabelStatement operation) { LogString(nameof(ILabelStatement)); // TODO: Put a better workaround to skip compiler generated labels. if (!operation.Label.IsImplicitlyDeclared) { LogString($" (Label: {operation.Label.Name})"); } LogCommonPropertiesAndNewLine(operation); base.VisitLabelStatement(operation); }
public virtual void TranslateConceptIdentifier(string identifierBase, ILabelStatement label, bool declarePoint) { string name = null; if (options.NameHandler.HandlesName(identifierBase)) { name = options.NameHandler.HandleName(identifierBase); } else { name = identifierBase; } if (this.IsKeyword(name)) { name = EscapeIdentifier(name); } name = this.GetFormat(name, label, declarePoint); this.Write(name, TranslatorFormatterTokenType.Preformatted); }
public string FormatLabelToken(string labelName, ILabelStatement label, IIntermediateCodeTranslatorOptions options, bool declarePoint) { var parentTarget = label.SourceBlock; Stack <int> indices = new Stack <int>(); indices.Push(parentTarget.IndexOf(label)); while (parentTarget.Parent is IStatementBlock) { var oldTarget = parentTarget; parentTarget = (IStatementBlock)parentTarget.Parent; indices.Push(parentTarget.IndexOf((IStatement)oldTarget)); } var parentMember = parentTarget.Parent as IMember; string uniqueIdentifier; string result = labelName; var activeType = options.BuildTrail.FirstOrDefault(p => p is IDeclaredType) as IDeclaredType; if (parentMember == null) { uniqueIdentifier = label.Name; } else { uniqueIdentifier = string.Format("{0}::{{{1}}}", parentMember.GetUniqueIdentifier(), string.Join("}.{", (from i in indices select i.ToString()).ToArray())); } if (declarePoint) { result = string.Format("<a name=\"{0}\"></a>{1}", uniqueIdentifier, result); } string titleText = string.Format("(label) {0}", labelName); result = FormatMemberNameToken(result, TranslatorFormatterMemberType.Label); if (!declarePoint) { result = string.Format("<a style=\"text-decoration:none;\" {3}href=\"{0}#{1}\">{2}</a>", options.GetFileNameOf(activeType), uniqueIdentifier, result, string.IsNullOrEmpty(titleText) ? string.Empty : string.Format("title=\"{0}\" ", titleText)); } return(result); }
public string FormatLabelToken(string labelName, ILabelStatement label, IIntermediateCodeTranslatorOptions options, bool declarePoint) { return(labelName); }
TransformationImpact IStatementVisitor <TransformationImpact> .Visit(ILabelStatement statement) { return(CalculateRefactorImpact(statement)); }
public abstract void TranslateStatement(ILabelStatement labelStatement);
public TestLinkerResult Visit(ILabelStatement statement, ICompilationContext context) { throw new NotImplementedException(); }
public virtual void VisitLabelStatement(ILabelStatement operation) { DefaultVisit(operation); }
public static ILabelStatement Update(this ILabelStatement self, ILabelSymbol @label, IOperation @body) => self;
public abstract IStatement Transform(ILabelStatement statement);
/// <inheritdoc /> public override IOperation VisitLabelStatement(ILabelStatement operation, object argument) { return(base.VisitLabelStatement(operation, argument)); }
public bool Visit(ILabelStatement statement, TContext context) { return(false); }
public void Add(ILabelStatement label) { SnapNodes.Add(new SnapNode(label)); }
public override void TranslateStatement(ILabelStatement labelStatement) { this.Provider.GenerateCodeFromStatement(labelStatement.GenerateCodeDom(this.Options), base.Target, this.Options.Options); }
public override void VisitLabelStatement(ILabelStatement operation) { var label = operation.Label; base.VisitLabelStatement(operation); }
/// <summary><para>Creates a C♯ compiler warning, relative to the abstract model, (level 2) #164:</para><para>This label has not been referenced</para></summary> /// <param name="unreferencedLabel">The <see cref="ILabelStatement"/> which was not referenced /// within the defining method body.</param> public static ICompilerSourceModelWarning <ILabelStatement> WarningCS0164(ILabelStatement unreferencedLabel) { return(new CompilerSourceModelWarning <ILabelStatement>(CS0164, unreferencedLabel, null, LineColumnPair.Zero, LineColumnPair.Zero)); }
public override void VisitLabelStatement([NotNull] ILabelStatement operation) { IncrementStatementCount(operation); base.VisitLabelStatement(operation); }
void IStatementVisitor.Visit(ILabelStatement statement) { this.Translate(statement); }
public override void VisitLabelStatement(ILabelStatement operation) { }
public static ILabelStatement Update(this ILabelStatement self, ILabelSymbol @label) => self;
public virtual void VisitLabelStatement(ILabelStatement labelStatement) { Visit(labelStatement); }
public override void VisitLabelStatement(ILabelStatement operation) { Visit(operation.LabeledStatement); }
public override bool Visit(ILabelStatement statement, IStatement context) { return(true); }
public abstract TransformationImpact CalculateRefactorImpact(ILabelStatement statement);
public GoToStatement(IStatementParent parent, ILabelStatement target) : base(parent, target) { }
protected virtual void Write(string token, TranslatorFormatterTokenType tokenType, ILabelStatement label, bool declarePoint) { string result = GetFormat(token, tokenType); target.Write(result); }
/// <inheritdoc /> public override Expression VisitLabelStatement(ILabelStatement operation, LocalBinder argument) { return(Expression.Label(operation.LabeledStatement.Accept(this, argument))); }