C# 클래스 Antlr4.Runtime.UnbufferedTokenStream

상속: ITokenStream
파일 보기 프로젝트 열기: antlr/antlr4

보호된 프로퍼티들

프로퍼티 타입 설명
currentTokenIndex int
lastToken IToken
lastTokenBufferStart IToken
n int
numMarkers int
p int
tokens IToken[]

공개 메소드들

메소드 설명
Consume ( ) : void
Get ( int i ) : IToken
LA ( int i ) : int
LT ( int i ) : IToken
Mark ( ) : int

Return a marker that we can release later.

Return a marker that we can release later.

The specific marker value used for this class allows for some level of protection against misuse where seek() is called on a mark or release() is called in the wrong order.

Release ( int marker ) : void
Seek ( int index ) : void
UnbufferedTokenStream ( ITokenSource tokenSource ) : System
UnbufferedTokenStream ( ITokenSource tokenSource, int bufferSize ) : System

보호된 메소드들

메소드 설명
Add ( IToken t ) : void
Fill ( int n ) : int

Add n elements to the buffer. Returns the number of tokens actually added to the buffer. If the return value is less than n , then EOF was reached before n tokens could be added.

GetBufferStartIndex ( ) : int
Sync ( int want ) : void

Make sure we have 'need' elements from current position p . Last valid p index is tokens.length-1 . p+need-1 is the tokens index 'need' elements ahead. If we need 1 element, (p+1-1)==p must be less than tokens.length .

비공개 메소드들

메소드 설명
GetText ( ) : string
GetText ( IToken start, IToken stop ) : string
GetText ( Interval interval ) : string
GetText ( RuleContext ctx ) : string

메소드 상세

Add() 보호된 메소드

protected Add ( IToken t ) : void
t IToken
리턴 void

Consume() 공개 메소드

public Consume ( ) : void
리턴 void

Fill() 보호된 메소드

Add n elements to the buffer. Returns the number of tokens actually added to the buffer. If the return value is less than n , then EOF was reached before n tokens could be added.
protected Fill ( int n ) : int
n int
리턴 int

Get() 공개 메소드

public Get ( int i ) : IToken
i int
리턴 IToken

GetBufferStartIndex() 보호된 메소드

protected GetBufferStartIndex ( ) : int
리턴 int

LA() 공개 메소드

public LA ( int i ) : int
i int
리턴 int

LT() 공개 메소드

public LT ( int i ) : IToken
i int
리턴 IToken

Mark() 공개 메소드

Return a marker that we can release later.
Return a marker that we can release later.

The specific marker value used for this class allows for some level of protection against misuse where seek() is called on a mark or release() is called in the wrong order.

public Mark ( ) : int
리턴 int

Release() 공개 메소드

public Release ( int marker ) : void
marker int
리턴 void

Seek() 공개 메소드

public Seek ( int index ) : void
index int
리턴 void

Sync() 보호된 메소드

Make sure we have 'need' elements from current position p . Last valid p index is tokens.length-1 . p+need-1 is the tokens index 'need' elements ahead. If we need 1 element, (p+1-1)==p must be less than tokens.length .
protected Sync ( int want ) : void
want int
리턴 void

UnbufferedTokenStream() 공개 메소드

public UnbufferedTokenStream ( ITokenSource tokenSource ) : System
tokenSource ITokenSource
리턴 System

UnbufferedTokenStream() 공개 메소드

public UnbufferedTokenStream ( ITokenSource tokenSource, int bufferSize ) : System
tokenSource ITokenSource
bufferSize int
리턴 System

프로퍼티 상세

currentTokenIndex 보호되어 있는 프로퍼티

Absolute token index.
Absolute token index. It's the index of the token about to be read via LT(1) . Goes from 0 to the number of tokens in the entire stream, although the stream size is unknown before the end is reached.

This value is used to set the token indexes if the stream provides tokens that implement IWritableToken .

protected int currentTokenIndex
리턴 int

lastToken 보호되어 있는 프로퍼티

This is the LT(-1) token for the current position.
protected IToken lastToken
리턴 IToken

lastTokenBufferStart 보호되어 있는 프로퍼티

When numMarkers > 0 , this is the LT(-1) token for the first token in tokens . Otherwise, this is .
protected IToken lastTokenBufferStart
리턴 IToken

n 보호되어 있는 프로퍼티

The number of tokens currently in tokens .

This is not the buffer capacity, that's tokens.length .

protected int n
리턴 int

numMarkers 보호되어 있는 프로퍼티

Count up with mark() and down with release() . When we release() the last mark, numMarkers reaches 0 and we reset the buffer. Copy tokens[p]..tokens[n-1] to tokens[0]..tokens[(n-1)-p] .
protected int numMarkers
리턴 int

p 보호되어 있는 프로퍼티

0..n-1 index into tokens of next token.

The LT(1) token is tokens[p] . If p == n , we are out of buffered tokens.

protected int p
리턴 int

tokens 보호되어 있는 프로퍼티

A moving window buffer of the data being scanned.
A moving window buffer of the data being scanned. While there's a marker, we keep adding to buffer. Otherwise, consume() resets so we start filling at index 0 again.
protected IToken[] tokens
리턴 IToken[]