public void Resolve(VBAParser.ConstStmtContext context) { foreach (var constStmt in context.constSubStmt()) { ResolveDefault(constStmt.expression()); } }
public override void ExitConstStmt([NotNull] VBAParser.ConstStmtContext context) { if (context.constSubStmt().Length > 1) { _contexts.Add(new QualifiedContext <ParserRuleContext>(CurrentModuleName, context)); } }
public override void ExitConstStmt([NotNull] VBAParser.ConstStmtContext context) { if (context.constSubStmt().Length > 1) { SaveContext(context); } }
public override void EnterConstStmt(VBAParser.ConstStmtContext context) { _members.Add(new QualifiedContext <ParserRuleContext>(_qualifiedName, context)); foreach (var child in context.constSubStmt()) { _members.Add(new QualifiedContext <ParserRuleContext>(_qualifiedName, child)); } }
private string GetDeclarationsText(VBAParser.ConstStmtContext consts) { var keyword = string.Empty; if (consts.visibility() != null) { keyword += consts.visibility().GetText() + ' '; } keyword += consts.CONST().GetText() + ' '; var newContent = new StringBuilder(); foreach (var constant in consts.constSubStmt()) { newContent.AppendLine(keyword + constant.GetText()); } return(newContent.ToString()); }
private static RewriterInfo GetRewriterInfo(VBAParser.ConstSubStmtContext target, VBAParser.ConstStmtContext context) { if (context == null) { throw new ArgumentNullException(nameof(context), @"Context is null. Expecting a VBAParser.ConstStmtContext instance."); } var items = context.constSubStmt(); var itemIndex = items.ToList().IndexOf(target); var count = items.Count; var element = context.Parent as VBAParser.ModuleDeclarationsElementContext; if (element != null) { return(GetModuleConstantRemovalInfo(target, element, count, itemIndex, items)); } return(GetLocalConstantRemovalInfo(target, context, count, itemIndex, items)); }