Parle Parle\RLexer 클래스

(PECL parle >= 0.5.1)


소개

다중 상태 렉서 클래스. 어휘는 즉석에서 정의할 수 있습니다. 특정 렉서 인스턴스가 Parle\RParser와 함께 사용되어야 하는 경우 토큰 ID를 가져와야 합니다. 그렇지 않으면 임의의 토큰 ID를 제공할 수 있습니다. Parle\Parser는 이 렉서와 호환되지 않습니다.


클래스 개요

                  
class Parle\RLexer {

  /* Constants */
  const int ICASE = 1;
  const int DOT_NOT_LF = 2;
  const int DOT_NOT_CRLF = 4;
  const int SKIP_WS = 8;
  const int MATCH_ZERO_LEN = 16;

  /* Properties */
  public bool $bol = false;
  public int $flags = 0;
  public int $state = 0;
  public int $marker = 0;
  public int $cursor = 0;

  /* Methods */
  public advance(): void
  public build(): void
  public callout(int $id, callable $callback): void
  public consume(string $data): void
  public dump(): void
  public getToken(): Parle\Token
  public insertMacro(string $name, string $regex): void
  public push(string $regex, int $id): void
  public push(
      string $state,
      string $regex,
      int $id,
      string $newState
  ): void
  public push(string $state, string $regex, string $newState): void
  public pushState(string $state): int
  public reset(int $pos): void
}
                  
                

미리 정의된 상수

Parle\RLexer::ICASE
Parle\RLexer::DOT_NOT_LF
Parle\RLexer::DOT_NOT_CRLF
Parle\RLexer::SKIP_WS
Parle\RLexer::MATCH_ZERO_LEN

Properties

bol
입력 플래그의 시작입니다.
flags
렉서 플래그.
state
현재 렉서 상태, 읽기 전용입니다.
marker
최신 토큰 일치의 위치, 읽기 전용입니다.
cursor
현재 입력 오프셋, 읽기 전용.

목차