本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例9: RemoveUnusedParameterQuickFix
public RemoveUnusedParameterQuickFix(ParserRuleContext context, QualifiedSelection selection,
RemoveParametersRefactoring quickFixRefactoring, RubberduckParserState parseResult)
: base(context, selection, InspectionsUI.RemoveUnusedParameterQuickFix)
{
_quickFixRefactoring = quickFixRefactoring;
_parseResult = parseResult;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}