Home | History | Annotate | Download | only in Antlr3.Runtime

Lines Matching refs:Input

73     /// Get int at current input pointer + I ahead (where I=1 is next int)
82 /// Executing Rewind(Mark()) on a stream should not affect the input position.
83 /// The Lexer tracks line/col info as well as input index so its markers are
84 /// not pure input indexes. Same for tree node streams. */
88 /// This could be the current input position, a value return from
93 /// Return the current input symbol index 0..N where N indicates the
115 /// Rewind to the input position of the last marker.
119 /// a sem/syn predicate to get the input position back to the start
123 /// It's like Seek(last marker's input position).
142 /// Set the input cursor to the position indicated by index. This is
143 /// normally used to seek ahead in the input stream.
150 /// and in that its argument is strictly an input cursor (index).
180 /// pass the buck all the way to the lexer who can ask its input stream
260 /// An index from 0..N-1 of the token object in the input stream
297 /// Returns a Token object from the input stream (usually a CharStream).
308 /// ask lexers input stream.
323 /// Get Token at current input pointer + I ahead (where I=1 is next
365 /// need to record the state of the input stream (char index, line,
479 /// The set of fields needed by an abstract recognizer to recognize input
541 /// The index into the input stream where the last error occurred.
625 /// the input char buffer. Use setText() or can set this instance var.
705 /// <summary>Reset the parser's state. Subclasses must rewind the input stream.</summary>
709 /// Match current input symbol against ttype. Attempt
721 function Match(const Input: IIntStream; const TokenType: Integer;
724 function MismatchIsUnwantedToken(const Input: IIntStream;
727 function MismatchIsMissingToken(const Input: IIntStream;
756 procedure MatchAny(const Input: IIntStream);
805 /// Recover from an error found on the input stream. This is
811 procedure Recover(const Input: IIntStream; const RE: ERecognitionException);
814 function RecoverFromMismatchedSet(const Input: IIntStream;
817 procedure ConsumeUntil(const Input: IIntStream; const TokenType: Integer); overload;
820 procedure ConsumeUntil(const Input: IIntStream; const BitSet: IBitSet); overload;
856 /// MEMO_RULE_UNKNOWN if the rule has not parsed input starting from
857 /// start index. If this rule has parsed input starting from the
864 /// tosses out data after we commit past input position i.
869 /// Has this rule already parsed input at the current index in the
870 /// input stream? Return the stop token index or MEMO_RULE_UNKNOWN.
874 /// This method has a side-effect: if we have seen this input for
878 function AlreadyParsedRule(const Input: IIntStream;
882 /// Record whether or not this rule parsed the input at this position
885 procedure Memoize(const Input: IIntStream; const RuleIndex,
889 /// Return how many rule/input-index pairs there are in total.
901 property Input: IIntStream read GetInput;
987 const Input: IIntStream): Integer of Object;
1016 /// From the input stream, predict what alternative will succeed using this
1019 /// <param name="Input">Input stream</param>
1021 function Predict(const Input: IIntStream): Integer;
1029 function SpecialStateTransition(const S: Integer; const Input: IIntStream): Integer;
1040 /// A lexer is recognizer that draws input symbols from a character stream.
1198 /// from start and stop using the input stream's ToString() method. I
1199 /// could add a ctor to this so that we can pass in and store the input
1202 /// input streams.
1211 /// <summary>Useful for dumping out the input stream after doing some
1223 /// machine instruction streams (programs) operating on a single input tape. :)
1236 /// Input: ICharStream;
1240 /// Input := TANTLRFileStream.Create('input');
1241 /// Lex := TLexer.Create(Input);
1250 /// Input.InsertAfter(t, 'text to put after t');
1251 /// Input.InsertAfter(u, 'text after u');
1254 /// Actually, you have to cast the 'input' to a TokenRewriteStream. :(
1257 /// rewrites from a single pass over the input. Just name the instruction
1371 /// problem occurred and/or what was the expected input. While the parser
1372 /// knows its state (such as current input symbol and line info) that
1375 /// perhaps print an entire line of input not just a single token, for example.
1383 /// <summary>What input stream did the error occur in? </summary>
1410 procedure ExtractInformationFromTreeNodeStream(const Input: IIntStream);
1449 /// <summary>Returns the input stream in which the error occurred</summary>
1450 property Input: IIntStream read FInput write FInput;
1453 /// Returns the token type or char of the unexpected input element
1614 /// <summary>Current line number within the input (1..n )</summary>
1634 /// move through the input stream. Indexed from 1..markDepth.
1851 /// <summary>The char position into the input buffer where this token starts </summary>
1854 /// <summary>The char position into the input buffer where this token stops </summary>
2006 /// Match needs to return the current input symbol, which gets put
2009 /// for input stream type or change the IntStream interface, I use
2011 /// input symbol is.
2014 function GetCurrentInputSymbol(const Input: IIntStream): IANTLRInterface; virtual;
2018 /// differently. Override and call MismatchRecover(input, ttype, follow)
2023 procedure Mismatch(const Input: IIntStream; const TokenType: Integer;
2035 /// input.
2041 /// exception For example, Input "i=(3;" is clearly missing the
2057 function RecoverFromMismatchedToken(const Input: IIntStream;
2081 function GetMissingSymbol(const Input: IIntStream;
2120 /// For input input "i=(3);", here is the derivation:
2135 /// input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}.
2140 /// a missing token in the input stream. "Insert" one by just not
2155 * When you find a "no viable alt exception", the input is not
2160 * input might just be missing a token--you might consume the
2161 * rest of the input looking for one of the missing tokens.
2181 * Upon erroneous input "[]", the call chain is
2203 * In this case, for input "[]", LA(1) is in this set so we would
2252 function Match(const Input: IIntStream; const TokenType: Integer;
2254 function MismatchIsUnwantedToken(const Input: IIntStream;
2256 function MismatchIsMissingToken(const Input: IIntStream;
2261 procedure MatchAny(const Input: IIntStream); virtual;
2269 procedure Recover(const Input: IIntStream; const RE: ERecognitionException); virtual;
2270 function RecoverFromMismatchedSet(const Input: IIntStream;
2272 procedure ConsumeUntil(const Input: IIntStream; const TokenType: Integer); overload; virtual;
2273 procedure ConsumeUntil(const Input: IIntStream; const BitSet: IBitSet); overload; virtual;
2279 function AlreadyParsedRule(const Input: IIntStream;
2281 procedure Memoize(const Input: IIntStream; const RuleIndex,
2290 property Input: IIntStream read GetInput;
2404 procedure NoViableAlt(const S: Integer; const Input: IIntStream);
2420 function Predict(const Input: IIntStream): Integer;
2423 const Input: IIntStream): Integer; virtual;
2472 property Input: ICharStream read FInput;
2486 property Input: ITokenStream read FInput;
2490 function GetCurrentInputSymbol(const Input: IIntStream): IANTLRInterface; override;
2491 function GetMissingSymbol(const Input: IIntStream;
2874 const Input: IIntStream);
2885 Nodes := Input as ITreeNodeStream;
3043 if Supports(Input, ICharStream) then
3980 * not valid. It means that the input was converted to a new
4180 function TBaseRecognizer.AlreadyParsedRule(const Input: IIntStream;
4185 StopIndex := GetRuleMemoization(RuleIndex, Input.Index);
4192 Input.Seek(StopIndex + 1); // jump to one past stop token
4206 procedure TBaseRecognizer.ConsumeUntil(const Input: IIntStream;
4211 TType := Input.LA(1);
4214 Input.Consume;
4215 TType := Input.LA(1);
4257 procedure TBaseRecognizer.ConsumeUntil(const Input: IIntStream;
4262 TType := Input.LA(1);
4265 Input.Consume;
4266 TType := Input.LA(1);
4313 const Input: IIntStream): IANTLRInterface;
4345 Result := 'extraneous input ' + GetTokenErrorDisplay(UTE.UnexpectedToken)
4364 Result := 'mismatched input ' + GetTokenErrorDisplay(E.Token)
4386 Result := 'no viable alternative at input ' + GetTokenErrorDisplay(E.Token);
4392 Result := 'required (...)+ loop did not match anyting at input '
4397 Result := 'mismatched input ' + GetTokenErrorDisplay(E.Token)
4403 Result := 'mismatched input ' + GetTokenErrorDisplay(E.Token)
4420 function TBaseRecognizer.GetMissingSymbol(const Input: IIntStream;
4457 Inc(Result,RuleMap.Count); // how many input indexes are recorded?
4488 function TBaseRecognizer.Match(const Input: IIntStream;
4491 Result := GetCurrentInputSymbol(Input);
4492 if (Input.LA(1) = TokenType) then
4494 Input.Consume;
4503 Mismatch(Input, TokenType, Follow);
4504 Result := RecoverFromMismatchedToken(Input, TokenType, Follow);
4509 procedure TBaseRecognizer.MatchAny(const Input: IIntStream);
4513 Input.Consume;
4516 procedure TBaseRecognizer.Memoize(const Input: IIntStream; const RuleIndex,
4528 StopTokenIndex := Input.Index - 1;
4533 procedure TBaseRecognizer.Mismatch(const Input: IIntStream;
4536 if MismatchIsUnwantedToken(Input, TokenType) then
4537 raise EUnwantedTokenException.Create(TokenType, Input)
4539 if MismatchIsMissingToken(Input, Follow) then
4540 raise EMissingTokenException.Create(TokenType, Input, nil)
4542 raise EMismatchedTokenException.Create(TokenType, Input);
4545 function TBaseRecognizer.MismatchIsMissingToken(const Input: IIntStream;
4574 if (Follow2.Member(Input.LA(1)) or Follow2.Member(TToken.EOR_TOKEN_TYPE)) then
4581 function TBaseRecognizer.MismatchIsUnwantedToken(const Input: IIntStream;
4584 Result := (Input.LA(2) = TokenType);
4604 procedure TBaseRecognizer.Recover(const Input: IIntStream;
4609 if (FState.LastErrorIndex = Input.Index) then
4614 Input.Consume;
4615 FState.LastErrorIndex := Input.Index;
4618 ConsumeUntil(Input,FollowSet);
4622 function TBaseRecognizer.RecoverFromMismatchedSet(const Input: IIntStream;
4625 if MismatchIsMissingToken(Input, Follow) then
4629 Result := GetMissingSymbol(Input, E, TToken.INVALID_TOKEN_TYPE, Follow);
4639 function TBaseRecognizer.RecoverFromMismatchedToken(const Input: IIntStream;
4645 if MismatchIsUnwantedToken(Input, TokenType) then
4647 E := EUnwantedTokenException.Create(TokenType, Input);
4649 Input.Consume; // simply delete extra token
4653 Result := GetCurrentInputSymbol(Input);
4654 Input.Consume; // move past ttype token as if all were ok
4659 if MismatchIsMissingToken(Input, Follow) then
4662 Result := GetMissingSymbol(Input, E, TokenType, Follow);
4663 E := EMissingTokenException.Create(TokenType, Input, Result);
4669 raise EMismatchedTokenException.Create(TokenType, Input);
5119 procedure TDFA.NoViableAlt(const S: Integer; const Input: IIntStream);
5127 NVAE := ENoViableAltException.Create(Description, FDecisionNumber, S, Input);
5133 function TDFA.Predict(const Input: IIntStream): Integer;
5139 Mark := Input.Mark; // remember where decision started in input
5147 S := FSpecialStateTransitionHandler(Self, SpecialState, Input);
5150 NoViableAlt(S, Input);
5153 Input.Consume;
5164 C := Char(Input.LA(1)); // -1 == \uFFFF, all tokens fit in 65000 space
5177 Input.Consume;
5186 NoViableAlt(S, Input);
5190 Input.Consume;
5198 Input.Consume;
5210 NoViableAlt(S, Input);
5214 Input.Rewind(Mark);
5230 const Input: IIntStream): Integer;
5576 FInput.Seek(0); // rewind the input
5639 const Input: IIntStream): IANTLRInterface;
5649 function TParser.GetMissingSymbol(const Input: IIntStream;
5685 FInput.Seek(0); // rewind the input