buildingmotif.label_parsing.tokens#

Functions

ensure_token(token_or_constructor, value)

Ensure a value is a token or constructs one from a given value.

Classes

Constant(value)

A constant token.

Delimiter(value)

A delimiter token.

Identifier(value)

An identifier token.

Null([value])

A null token.

Token(value)

TokenResult(value, token, length[, error, id])

A token result.

class Token(value: Any)[source]#
value: Any#
ensure_token(token_or_constructor: Union[Token, Type[Token]], value)[source]#

Ensure a value is a token or constructs one from a given value.

class Identifier(value: str)[source]#

An identifier token. Contains a string.

value: str#
class Constant(value: URIRef)[source]#

A constant token. Contains a URI, probably some sort of Class

value: URIRef#
class Delimiter(value: str)[source]#

A delimiter token.

value: str#
class Null(value: None = None)[source]#

A null token.

value: None = None#
class TokenResult(value: Optional[str], token: Token, length: int, error: Optional[str] = None, id: Optional[str] = None)[source]#

A token result. Contains a token, the type of the token, the length of the token, and a possible error.

value: Optional[str]#
token: Token#
length: int#
error: Optional[str] = None#
id: Optional[str] = None#