private string GetSignature(VBAParser.FunctionStmtContext context) { if (context == null) { return(null); } var @static = context.STATIC() == null ? string.Empty : context.STATIC().GetText() + ' '; var keyword = context.FUNCTION().GetText() + ' '; var args = context.argList() == null ? "()" : context.argList().GetText() + ' '; var asTypeClause = context.asTypeClause() == null ? string.Empty : context.asTypeClause().GetText(); var visibility = context.visibility() == null ? string.Empty : context.visibility().GetText() + ' '; return(visibility + @static + keyword + context.functionName().identifier().GetText() + args + asTypeClause); }
public ProcedureNode(VBAParser.FunctionStmtContext context, string scope, string localScope) : this(context, scope, localScope, VBProcedureKind.Function, context.visibility(), context.ambiguousIdentifier(), () => context.asTypeClause()) { _argsListContext = context.argList(); _staticNode = context.STATIC(); _keyword = context.FUNCTION(); _asTypeClauseContext = context.asTypeClause(); }
public static string Signature(this VBAParser.FunctionStmtContext context) { var visibility = context.visibility(); var visibilityText = visibility == null ? string.Empty : visibility.GetText(); var identifierText = context.ambiguousIdentifier().GetText(); var argsText = context.argList().GetText(); var asType = context.asTypeClause(); var asTypeText = asType == null ? string.Empty : asType.GetText(); return((visibilityText + ' ' + Tokens.Function + ' ' + identifierText + argsText + ' ' + asTypeText).Trim()); }