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; }
/// <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; }
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; }
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; }
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; }
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; }
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; }
public RemoveUnusedParameterQuickFix(ParserRuleContext context, QualifiedSelection selection, RemoveParametersRefactoring quickFixRefactoring, RubberduckParserState parseResult) : base(context, selection, InspectionsUI.RemoveUnusedParameterQuickFix) { _quickFixRefactoring = quickFixRefactoring; _parseResult = parseResult; }
public PositionInText(ParserRuleContext context) { this.StartLine = context.Start.Line; this.EndLine = context.Stop.Line; this.StartColumn = context.Start.Column; this.EndColumn = context.Stop.Column; }
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; }
public ParameterCanBeByValInspectionResult(IInspection inspection, Declaration target, ParserRuleContext context, QualifiedMemberName qualifiedName) : base(inspection, qualifiedName.QualifiedModuleName, context, target) { _quickFixes = new[] { new PassParameterByValueQuickFix(Context, QualifiedSelection), }; }
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; }
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; }
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; }
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; }
/// <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; }
public void ExitEveryRule(ParserRuleContext ctx) { foreach (var listener in _listeners) { listener.ExitEveryRule(ctx); ctx.ExitRule(listener); } }
public ImplicitActiveSheetReferenceInspectionResult(IInspection inspection, string result, ParserRuleContext context, QualifiedModuleName qualifiedName) : base(inspection, qualifiedName, context) { _result = result; _quickFixes = new CodeInspectionQuickFix[] { new IgnoreOnceQuickFix(context, QualifiedSelection, Inspection.AnnotationName), }; }
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) { }
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; }
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; }
public RecognitionException(IRecognizer recognizer, IIntStream input, ParserRuleContext ctx) { this.recognizer = recognizer; this.input = input; this.ctx = ctx; if (recognizer != null) { this.offendingState = recognizer.State; } }
private void UpdateLocation(ParserRuleContext context) { if (context == null) ThrowHelper.ThrowArgumentNullException(() => context); var start = new TextLocation(context.Start.Line, context.Start.StartIndex); var end = new TextLocation(context.Stop.Line, context.Stop.StopIndex); CompilerService.CurrentSpan = new TextSpan(start, end); }
// --- ACCEPT --- public override void EnterAcceptStatement(CodeElementsParser.AcceptStatementContext context) { Context = context; if (context.acceptDataTransfer() != null) { CodeElement = CobolStatementsBuilder.CreateAcceptDataTransferStatement(context.acceptDataTransfer()); } else if(context.acceptSystemDateTime() != null) { CodeElement = CobolStatementsBuilder.CreateAcceptSystemDateTime(context.acceptSystemDateTime()); } }
public IdentifierReference(QualifiedModuleName qualifiedName, string identifierName, Selection selection, ParserRuleContext context, Declaration declaration, bool isAssignmentTarget = false, bool hasExplicitLetStatement = false) { _qualifiedName = qualifiedName; _identifierName = identifierName; _selection = selection; _context = context; _declaration = declaration; _hasExplicitLetStatement = hasExplicitLetStatement; _isAssignmentTarget = isAssignmentTarget; }
public UntypedFunctionUsageInspectionResult(IInspection inspection, string result, QualifiedModuleName qualifiedName, ParserRuleContext context) : base(inspection, qualifiedName, context) { _result = result; _quickFixes = new CodeInspectionQuickFix[] { new UntypedFunctionUsageQuickFix(Context, QualifiedSelection), new IgnoreOnceQuickFix(Context, QualifiedSelection, Inspection.AnnotationName), }; }
public TreeViewControl(ParserRuleContext root, LittleBigCParser parser) { InitializeComponent(); var rootViewModel = new NodeViewModel(root, null, parser); _treeViewModel = new TreeViewModel(rootViewModel); base.DataContext = _treeViewModel; }
public ParameterNotUsedInspectionResult(IInspection inspection, Declaration target, ParserRuleContext context, QualifiedMemberName qualifiedName, bool isInterfaceImplementation, RemoveParametersRefactoring refactoring, RubberduckParserState parseResult) : base(inspection, qualifiedName.QualifiedModuleName, context, target) { _quickFixes = isInterfaceImplementation ? new CodeInspectionQuickFix[] {} : new CodeInspectionQuickFix[] { new RemoveUnusedParameterQuickFix(Context, QualifiedSelection, refactoring, parseResult), new IgnoreOnceQuickFix(Context, QualifiedSelection, Inspection.AnnotationName), }; }
public IdentifierNotAssignedInspectionResult(IInspection inspection, Declaration target, ParserRuleContext context, QualifiedModuleName qualifiedName) : base(inspection, target, context, qualifiedName) { _target = target; _quickFixes = new CodeInspectionQuickFix[] { new RemoveUnassignedIdentifierQuickFix(Context, QualifiedSelection), new IgnoreOnceQuickFix(context, QualifiedSelection, Inspection.AnnotationName), }; }
protected override SimulatorState ComputeStartState(DFA dfa, ParserRuleContext globalContext, bool useContext) { _computingStartState = true; try { return base.ComputeStartState(dfa, globalContext, useContext); } finally { _computingStartState = false; } }
public Predicate_atomContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public RetryExpression(ParserRuleContext context) : base(DataType.Void, context) { }
public ReturnStmt(ParserRuleContext sourceLocation, IPExpr returnValue) { SourceLocation = sourceLocation; ReturnValue = returnValue; }
public void ExitEveryRule([NotNull] ParserRuleContext ctx) { UnindentOuput($"}} {ctx.GetType().Name} @{ctx.Stop?.Line}:{ctx.Stop?.Column} [{ctx.GetText()}]"); }
internal AstGenericParameterDefinition(ParserRuleContext context) : base(context) { }
public BbsCodeElementContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
private void LogWarning(ParserRuleContext context, string str) { mLogger.ConsoleWarning($"({context.Start.Line:D4}:{context.Start.Column:D4}) {str}"); }
/// <summary> /// Initializes a new instance of the <see cref="BinaryAndExpression"/> class. /// </summary> /// <param name="left">Left hand expression</param> /// <param name="right">Right hand expression</param> /// <param name="context">Parser context this expression was made from</param> public BinaryAndExpression(Expression left, Expression right, ParserRuleContext context) : base(left, right, BinaryOperator.And, context) { }
public string GetValueType(ParserRuleContext context) { return(GetValue(context).ValueType); }
public EventDoAction(ParserRuleContext sourceLocation, PEvent trigger, Function target) { SourceLocation = sourceLocation; Trigger = trigger; Target = target; }
protected virtual void addVariables([NotNull] ParserRuleContext context) { }
public string GetToken(ParserRuleContext context) { return(GetValue(context).Token); }
public BbsCodeAttributeValueContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
// Logging private void LogContextInfo(ParserRuleContext context) { mLogger.ConsoleTrace($"({context.Start.Line:D4}:{context.Start.Column:D4}) Compiling {MessageScriptParser.ruleNames[context.RuleIndex]}"); }
public ExpressionContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public TypeNode(ParserRuleContext context) : base(context) { }
public void ExitEveryRule(ParserRuleContext ctx) { }
/// <summary> /// Creates a clause with the span defined by the passed context /// </summary> /// <param name="context">Parser rule context</param> protected AssignmentNode(ParserRuleContext context) : base(context) { }
public BoolLiteralExpr(ParserRuleContext sourceLocation, bool value) { SourceLocation = sourceLocation; Value = value; }
public OperandContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public void EnterEveryRule([NotNull] ParserRuleContext ctx) { IndentOuput($"{{ {ctx.GetType().Name}: @{ctx.Start?.Line}:{ctx.Start?.Column} "); }
public bool TryGetValue(ParserRuleContext context, out IParseTreeValue value) { return(_parseTreeValues.TryGetValue(context, out value)); }
public void GetReplacements([NotNull] ParserRuleContext context) { Replacements = new Stack <Replacement>(); ParseTreeWalker.Default.Walk((IParseTreeListener)Listener, context); }
public BbsCodeChardataContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
private Diagnostic BuildTemplatesDiagnostic(string errorMessage, ParserRuleContext context, DiagnosticSeverity severity = DiagnosticSeverity.Error) { return(new Diagnostic(context.ConvertToRange(), errorMessage, severity, this.templates.Id)); }
public BbsCodeTagNameContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public SubeventsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public Answer_setContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public TermContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { }
public bool Contains(ParserRuleContext context) { return(_parseTreeValues.ContainsKey(context)); }