로딩중...
검색중...
일치하는것 없음
by::stelaSmartDedent 클래스 참조

Smart dedent handler for indentation-based parsing 더 자세히 ...

#include <stelaSmartDedent.hpp>

Public 멤버 함수

me & countDown ()
 Decrements the internal count, typically indicating a pending dedent.
 
me & countUp ()
 Increments the internal count, typically indicating a pending dedent.
 
me & useLater ()
 Enables dedent tracking for future parsing, deferring any pending dedents.
 
nint dedent ()
 Generates and returns a dedent token based on the internal count.
 
void rel ()
 
nbool canDedent () const
 
nbool isOn () const
 

상세한 설명

Smart dedent handler for indentation-based parsing

A class that counts and manages in an array how many leading spaces exist whenever stelaParser creates a scope based on indentation.

For example, when parsing this stela code:

def config
name := "my device"
# position 1
Rich logging support with polymorphic type conversion
Definition richLog.hpp:34

If the parser is parsing at position 1, smartDedent's internal array is [0, 4, 6]. This means the outermost scope's whitespace count is smartDedent[0] = 0, and the innermost device scope's whitespace count is smartDedent[smartDedent.len() - 1] = 6, meaning 6 leading spaces are required.

멤버 함수 문서화

◆ countDown()

me & by::stelaSmartDedent::countDown ( )

Decrements the internal count, typically indicating a pending dedent.

반환값
A reference to this stelaSmartDedent instance.

◆ countUp()

me & by::stelaSmartDedent::countUp ( )

Increments the internal count, typically indicating a pending dedent.

반환값
A reference to this stelaSmartDedent instance.

◆ dedent()

nint by::stelaSmartDedent::dedent ( )

Generates and returns a dedent token based on the internal count.

반환값
The token ID for DEDENT, or 0 if no dedent is pending.

◆ useLater()

me & by::stelaSmartDedent::useLater ( )

Enables dedent tracking for future parsing, deferring any pending dedents.

반환값
A reference to this stelaSmartDedent instance.

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: