• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ParserRuleContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ParserRuleContext的典型用法代码示例。如果您正苦于以下问题:C# ParserRuleContext类的具体用法?C# ParserRuleContext怎么用?C# ParserRuleContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ParserRuleContext类属于命名空间,在下文中一共展示了ParserRuleContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ValuedDeclaration

 public ValuedDeclaration(QualifiedMemberName qualifiedName, string parentScope,
     string asTypeName, Accessibility accessibility, DeclarationType declarationType, string value, 
     ParserRuleContext context, Selection selection, bool isBuiltIn = false)
     :base(qualifiedName, parentScope, asTypeName, true, false, accessibility, declarationType, context, selection, isBuiltIn)
 {
     _value = value;
 }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:7,代码来源:ValuedDeclaration.cs


示例2: PhpOutliningParseResultEventArgs

        public PhpOutliningParseResultEventArgs(ITextSnapshot snapshot, IList<ParseErrorEventArgs> errors, TimeSpan elapsedTime, IList<IToken> tokens, ParserRuleContext result, ReadOnlyCollection<ParserRuleContext> outliningTrees)
            : base(snapshot, errors, elapsedTime, tokens, result)
        {
            Contract.Requires<ArgumentNullException>(outliningTrees != null, "outliningTrees");

            _outliningTrees = outliningTrees;
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:7,代码来源:PhpOutliningParseResultEventArgs.cs


示例3: RenameProjectQuickFix

 public RenameProjectQuickFix(ParserRuleContext context, QualifiedSelection selection, Declaration target, RubberduckParserState state, ICodePaneWrapperFactory wrapperFactory)
     : base(context, selection, string.Format(RubberduckUI.Rename_DeclarationType, RubberduckUI.ResourceManager.GetString("DeclarationType_" + DeclarationType.Project, RubberduckUI.Culture)))
 {
     _target = target;
     _state = state;
     _wrapperFactory = wrapperFactory;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:7,代码来源:DefaultProjectNameInspectionResult.cs


示例4: SimulatorState

 public SimulatorState(ParserRuleContext outerContext, DFAState s0, bool useContext, ParserRuleContext remainingOuterContext)
 {
     this.outerContext = outerContext != null ? outerContext : ParserRuleContext.EmptyContext;
     this.s0 = s0;
     this.useContext = useContext;
     this.remainingOuterContext = remainingOuterContext;
 }
开发者ID:antlr,项目名称:antlr4,代码行数:7,代码来源:SimulatorState.cs


示例5: InspectionResultBase

 /// <summary>
 /// Creates an inspection result.
 /// </summary>
 protected InspectionResultBase(IInspection inspection, QualifiedModuleName qualifiedName, ParserRuleContext context, CommentNode comment = null)
 {
     _inspection = inspection;
     _qualifiedName = qualifiedName;
     _context = context;
     _comment = comment;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:10,代码来源:InspectionResultBase.cs


示例6: PositionInText

 public PositionInText(ParserRuleContext context)
 {
     this.StartLine = context.Start.Line;
     this.EndLine = context.Stop.Line;
     this.StartColumn = context.Start.Column;
     this.EndColumn =  context.Stop.Column;
 }
开发者ID:javachengwc,项目名称:many-ql,代码行数:7,代码来源:PositionInText.cs


示例7: PhpEditorNavigationParseResultEventArgs

        public PhpEditorNavigationParseResultEventArgs(ITextSnapshot snapshot, IList<ParseErrorEventArgs> errors, TimeSpan elapsedTime, IList<IToken> tokens, ParserRuleContext result, ReadOnlyCollection<ParserRuleContext> navigationTrees)
            : base(snapshot, errors, elapsedTime, tokens, result)
        {
            Contract.Requires<ArgumentNullException>(navigationTrees != null, "navigationTrees");

            this._navigationTrees = navigationTrees;
        }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:7,代码来源:PhpEditorNavigationParseResultEventArgs.cs


示例8: IgnoreOnceQuickFix

 public IgnoreOnceQuickFix(ParserRuleContext context, QualifiedSelection selection, string inspectionName) 
     : base(context, selection, InspectionsUI.IgnoreOnce)
 {
     _inspectionName = inspectionName;
     _annotationText = "'" + Parsing.Grammar.Annotations.AnnotationMarker +
                       Parsing.Grammar.Annotations.IgnoreInspection + ' ' + inspectionName;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:7,代码来源:IgnoreOnceQuickFix.cs


示例9: RemoveUnusedParameterQuickFix

 public RemoveUnusedParameterQuickFix(ParserRuleContext context, QualifiedSelection selection, 
     RemoveParametersRefactoring quickFixRefactoring, RubberduckParserState parseResult)
     : base(context, selection, InspectionsUI.RemoveUnusedParameterQuickFix)
 {
     _quickFixRefactoring = quickFixRefactoring;
     _parseResult = parseResult;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:7,代码来源:ParameterNotUsedInspectionResult.cs


示例10: doFunctionCall

        private IValue doFunctionCall(ParserRuleContext context, string targetFunctionName, List<IValue> parameters, IValue target, ClepsType targetType, bool allowVoidReturn)
        {
            IValue dereferencedTarget = target == null? null : GetDereferencedRegisterOrNull(target);
            BasicClepsType dereferencedType = target == null? targetType as BasicClepsType : dereferencedTarget.ExpressionType as BasicClepsType;

            if (dereferencedType == null)
            {
                string errorMessage = String.Format("Could not dereference expression on type {0}", targetType.GetClepsTypeString());
                Status.AddError(new CompilerError(FileName, context.Start.Line, context.Start.Column, errorMessage));
                //just return something to avoid stalling
                return CodeGenerator.CreateByte(0);
            }

            ClepsClass targetClepsClass = ClassManager.GetClass(dereferencedType.GetClepsTypeString());


            List<ClepsVariable> functionOverloads;
            bool isStatic;
            if (targetClepsClass.StaticMemberMethods.ContainsKey(targetFunctionName))
            {
                isStatic = true;
                functionOverloads = targetClepsClass.StaticMemberMethods[targetFunctionName];
            }
            else if (target != null && targetClepsClass.MemberMethods.ContainsKey(targetFunctionName))
            {
                isStatic = false;
                functionOverloads = targetClepsClass.MemberMethods[targetFunctionName];
            }
            else
            {
                string errorMessage = String.Format("Class {0} does not contain a {1}static function called {2}.", targetClepsClass.FullyQualifiedName, target == null? "" : "member or ",targetFunctionName);
                Status.AddError(new CompilerError(FileName, context.Start.Line, context.Start.Column, errorMessage));
                //Just return something to avoid stalling compilation
                return CodeGenerator.CreateByte(0);
            }

            int matchedPosition;
            string fnMatchErrorMessage;

            if (!FunctionOverloadManager.FindMatchingFunctionType(TypeManager, functionOverloads, parameters, out matchedPosition, out fnMatchErrorMessage))
            {
                Status.AddError(new CompilerError(FileName, context.Start.Line, context.Start.Column, fnMatchErrorMessage));
                //Just return something to avoid stalling compilation
                return CodeGenerator.CreateByte(0);
            }

            FunctionClepsType chosenFunctionType = functionOverloads[matchedPosition].VariableType as FunctionClepsType;

            if (!allowVoidReturn && chosenFunctionType.ReturnType == VoidClepsType.GetVoidType())
            {
                string errorMessage = String.Format("Function {0} does not return a value", targetFunctionName);
                Status.AddError(new CompilerError(FileName, context.Start.Line, context.Start.Column, errorMessage));
                //Just return something to avoid stalling compilation
                return CodeGenerator.CreateByte(0);
            }

            IValue returnValue = CodeGenerator.GetFunctionCallReturnValue(isStatic? null : dereferencedTarget, dereferencedType, targetFunctionName, chosenFunctionType, parameters);
            return returnValue;
        }
开发者ID:shravanrn,项目名称:Cleps,代码行数:59,代码来源:ClepsFunctionBodyGeneratorVisitor_FunctionCall.cs


示例11: CreateFromRule

 private void CreateFromRule(ParserRuleContext rule)
 {
     if (rule == null) return;
     this.StartLine = rule.Start.Line;
     this.StartPosition = rule.Start.Column + 1;
     this.EndLine = rule.Stop.Line;
     this.EndPosition = rule.Stop.Column + rule.Stop.Text.Length + 1;
 }
开发者ID:Bubesz,项目名称:meta-cs,代码行数:8,代码来源:MetaCompilerDiagnostics.cs


示例12: ParameterNotUsedInspectionResult

 public ParameterNotUsedInspectionResult(string inspection, CodeInspectionSeverity type,
     ParserRuleContext context, QualifiedMemberName qualifiedName, bool isInterfaceImplementation, RemoveParametersRefactoring quickFixRefactoring, VBProjectParseResult parseResult)
     : base(inspection, type, qualifiedName.QualifiedModuleName, context)
 {
     _isInterfaceImplementation = isInterfaceImplementation;
     _quickFixRefactoring = quickFixRefactoring;
     _parseResult = parseResult;
 }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:8,代码来源:ParameterNotUsedInspectionResult.cs


示例13: NoViableAltException

 public NoViableAltException(IRecognizer recognizer, ITokenStream input, IToken startToken, IToken offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx)
     : base(recognizer, input, ctx)
 {
     // LL(1) error
     this.deadEndConfigs = deadEndConfigs;
     this.startToken = startToken;
     this.OffendingToken = offendingToken;
 }
开发者ID:EvgeniyKo,项目名称:antlr4cs,代码行数:8,代码来源:NoViableAltException.cs


示例14: CodeInspectionResultBase

 /// <summary>
 /// Creates an inspection result.
 /// </summary>
 protected CodeInspectionResultBase(string inspection, CodeInspectionSeverity type, QualifiedModuleName qualifiedName, ParserRuleContext context, CommentNode comment = null)
 {
     _name = inspection;
     _type = type;
     _qualifiedName = qualifiedName;
     _context = context;
     _comment = comment;
 }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:11,代码来源:CodeInspectionResultBase.cs


示例15: MoveFieldCloserToUsageQuickFix

 public MoveFieldCloserToUsageQuickFix(ParserRuleContext context, QualifiedSelection selection, Declaration target, RubberduckParserState parseResult, ICodePaneWrapperFactory wrapperFactory, IMessageBox messageBox)
     : base(context, selection, string.Format(InspectionsUI.MoveFieldCloserToUsageInspectionResultFormat, target.IdentifierName))
 {
     _target = target;
     _parseResult = parseResult;
     _wrapperFactory = wrapperFactory;
     _messageBox = messageBox;
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:8,代码来源:MoveFieldCloserToUsageInspectionResult.cs


示例16: ParameterCanBeByValInspectionResult

 public ParameterCanBeByValInspectionResult(IInspection inspection, Declaration target, ParserRuleContext context, QualifiedMemberName qualifiedName)
     : base(inspection, qualifiedName.QualifiedModuleName, context, target)
 {
     _quickFixes = new[]
     {
         new PassParameterByValueQuickFix(Context, QualifiedSelection), 
     };
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:8,代码来源:ParameterCanBeByValInspectionResult.cs


示例17: ExitEveryRule

 public void ExitEveryRule(ParserRuleContext ctx)
 {
     foreach (var listener in _listeners)
     {
         listener.ExitEveryRule(ctx);
         ctx.ExitRule(listener);
     }
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:8,代码来源:CombinedParseTreeListener.cs


示例18: FunctionReturnValueNotUsedInspectionResult

 public FunctionReturnValueNotUsedInspectionResult(
     IInspection inspection,
     ParserRuleContext context,
     QualifiedMemberName qualifiedName,
     IEnumerable<string> returnStatements,
     Declaration target)
     : this(inspection, context, qualifiedName, returnStatements, new List<Tuple<ParserRuleContext, QualifiedSelection, IEnumerable<string>>>(), target)
 {
 }
开发者ID:retailcoder,项目名称:Rubberduck,代码行数:9,代码来源:FunctionReturnValueNotUsedInspectionResult.cs


示例19: GetNode

        private ProcedureNode GetNode(ParserRuleContext context)
        {
            var result = GetNode(context as VBAParser.FunctionStmtContext);
            if (result != null) { return result; }
            
            result = GetNode(context as VBAParser.PropertyGetStmtContext);

            return result;
        }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:9,代码来源:ImplicitVariantReturnTypeInspectionResult.cs


示例20: AntlrParseResultEventArgs

        public AntlrParseResultEventArgs(ITextSnapshot snapshot, IList<ParseErrorEventArgs> errors, TimeSpan elapsedTime, IList<IToken> tokens, ParserRuleContext result)
            : base(snapshot, errors, elapsedTime)
        {
            Tokens = tokens as ReadOnlyCollection<IToken>;
            if (Tokens == null)
                Tokens = new ReadOnlyCollection<IToken>(tokens ?? new IToken[0]);

            Result = result;
        }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:9,代码来源:AntlrParseResultEventArgs.cs



注:本文中的ParserRuleContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ParserState类代码示例发布时间:2022-05-24
下一篇:
C# ParserResult类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap