本文整理汇总了C#中VBAParser.GetText方法的典型用法代码示例。如果您正苦于以下问题:C# VBAParser.GetText方法的具体用法?C# VBAParser.GetText怎么用?C# VBAParser.GetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VBAParser
的用法示例。
在下文中一共展示了VBAParser.GetText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProcedureAccessibility
/// <summary>
/// Gets the <c>Accessibility</c> for a procedure member.
/// </summary>
private Accessibility GetProcedureAccessibility(VBAParser.VisibilityContext visibilityContext)
{
var visibility = visibilityContext == null
? "Implicit" // "Public"
: visibilityContext.GetText();
return (Accessibility)Enum.Parse(typeof(Accessibility), visibility);
}
示例2: DeclareExplicitVariant
private string DeclareExplicitVariant(VBAParser.ArgContext context, out string instruction)
{
if (context == null)
{
instruction = null;
return null;
}
instruction = context.GetText();
return instruction + ' ' + Tokens.As + ' ' + Tokens.Variant;
}
示例3: ProcedureNode
private ProcedureNode(ParserRuleContext context, string scope, string localScope,
VBProcedureKind kind,
VBAParser.VisibilityContext visibility,
VBAParser.AmbiguousIdentifierContext name,
Func<VBAParser.AsTypeClauseContext> asType)
: base(context, scope, localScope)
{
_kind = kind;
_name = name.GetText();
_accessibility = visibility.GetAccessibility();
_visibilityContext = visibility;
if (asType != null)
{
var returnTypeClause = asType();
_isImplicitReturnType = returnTypeClause == null;
_returnType = returnTypeClause == null
? Tokens.Variant
: returnTypeClause.type().GetText();
}
}
示例4: EnterAmbiguousIdentifier
public override void EnterAmbiguousIdentifier(VBAParser.AmbiguousIdentifierContext context)
{
DeclarationType type;
if (!ScopingContextTypes.TryGetValue(context.Parent.GetType(), out type))
{
return;
}
_currentScope = Tuple.Create(context.GetText(), type);
}
示例5: ExitOptionPrivateModuleStmt
public override void ExitOptionPrivateModuleStmt(VBAParser.OptionPrivateModuleStmtContext context)
{
OnNewDeclaration(CreateDeclaration(context.GetText(), string.Empty, Accessibility.Implicit, DeclarationType.ModuleOption, context, context.GetSelection()));
}
示例6: GetMemberAccessibility
/// <summary>
/// Gets the <c>Accessibility</c> for a non-procedure member.
/// </summary>
private Accessibility GetMemberAccessibility(VBAParser.VisibilityContext visibilityContext)
{
var visibility = visibilityContext == null
? "Implicit" // "Private"
: visibilityContext.GetText();
return (Accessibility)Enum.Parse(typeof(Accessibility), visibility, true);
}
示例7: EnterOptionExplicitStmt
public override void EnterOptionExplicitStmt(VBAParser.OptionExplicitStmtContext context)
{
_declarations.Add(CreateDeclaration(context.GetText(), string.Empty, Accessibility.Implicit, DeclarationType.ModuleOption, context, context.GetSelection()));
}