当前位置: 首页>>代码示例>>C#>>正文


C# ParserRuleContext类代码示例

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


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


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