concepts.dm.crow.parsers.cdl_parser.CDLDomainTransformer#

class CDLDomainTransformer[source]#

Bases: CDLLiteralTransformer

Methods

BASIC_TYPENAME(token)

Captures basic type names (non-vector types), such as int, float, bool, object, etc.

BIN_NUMBER(value)

Captures binary number literals.

CONSTNAME(token)

Captures constant names, such as CONST_NAME.

DEC_NUMBER(value)

Captures decimal number literals.

ELLIPSIS(_)

Captures the ... literal.

FALSE(_)

Captures the False literal.

FLOAT_NUMBER(value)

Captures floating point number literals.

HEX_NUMBER(value)

Captures hexadecimal number literals.

IMAG_NUMBER(value)

Captures complex number literals.

OCT_NUMBER(value)

Captures octal number literals.

TRUE(_)

Captures the True literal.

VARNAME(token)

Captures variable names, such as var_name.

arguments_def(args)

Captures the arguments definition.

batched_typename(element_dtype, indices)

Captures batched typenames defined as typename[indices].

behavior_body_definition(suite)

behavior_definition(annotations, name, args, ...)

behavior_effect_definition(suite)

behavior_goal_definition(suite)

behavior_heuristic_definition(suite)

behavior_minimize_definition(suite)

boolean(value)

Captures boolean literals.

controller_definition(annotations, name, ...)

decorator_kwarg(k[, v])

Captures the key-value pair of a decorator.

decorator_kwargs(args)

Captures the key-value pairs of a decorator.

feature_definition(annotations, name, args, ...)

function_definition(annotations, name, args, ...)

generator_definition(annotations, name, ...)

generator_goal_definition(suite)

generator_in_definition(values)

generator_out_definition(values)

in_typed_argument(name, value)

Captures typed arguments defined as name in value.

include_definition(path)

is_typed_argument(name, typename)

Captures typed arguments defined as name is typename.

list_typename(element_dtype)

Captures list typenames defined as list[typename].

literal(value)

Captures literal values.

literal_list(*items)

Captures literal lists, such as [1, 2, 3, 4].

literal_set(*items)

Captures literal sets, such as {1, 2, 3, 4}.

multi_typed_arguments(name, typename)

Captures multiple typed arguments defined as name1, name2: typename.

number(value)

Captures number literals, including integers, floats, and complex numbers.

object_constant_definition(name, typename)

pragma_definition(pragma)

pragma_definition_with_args(function, arguments)

sized_vector_typename(name, size)

Captures sized vector typenames defined as vector[typename, size].

string(value)

Captures string literals.

transform(tree)

Transform the given tree, and return the final result

type_definition(typename, basetype)

typed_argument(name, typename)

Captures typed arguments defined as name: typename.

typename(name)

Captures typenames including basic types and vector types.

unsized_vector_typename(name)

Captures unsized vector typenames defined as vector[typename].

Attributes

BASIC_TYPENAME(token)#

Captures basic type names (non-vector types), such as int, float, bool, object, etc.

BIN_NUMBER(value)#

Captures binary number literals.

Parameters:

value (str)

Return type:

int

CONSTNAME(token)#

Captures constant names, such as CONST_NAME.

DEC_NUMBER(value)#

Captures decimal number literals.

Parameters:

value (str)

Return type:

int

ELLIPSIS(_)#

Captures the literal.

Return type:

str

FALSE(_)#

Captures the False literal.

Return type:

bool

FLOAT_NUMBER(value)#

Captures floating point number literals.

Parameters:

value (str)

Return type:

float

HEX_NUMBER(value)#

Captures hexadecimal number literals.

Parameters:

value (str)

Return type:

int

IMAG_NUMBER(value)#

Captures complex number literals.

Parameters:

value (str)

Return type:

complex

OCT_NUMBER(value)#

Captures octal number literals.

Parameters:

value (str)

Return type:

int

TRUE(_)#

Captures the True literal.

Return type:

bool

VARNAME(token)#

Captures variable names, such as var_name.

__init__(domain=None, auto_init_domain=True)[source]#
Parameters:
__mul__(other)#

Chain two transformers together, returning a new transformer.

Parameters:
  • self (Transformer)

  • other (Transformer | TransformerChain[_Leaf_U, _Return_V])

Return type:

TransformerChain[_Leaf_T, _Return_V]

__new__(**kwargs)#
arguments_def(args)#

Captures the arguments definition. This is used in function definitions.

batched_typename(element_dtype, indices)#

Captures batched typenames defined as typename[indices].

Parameters:
Return type:

BatchedListType

behavior_body_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

BodyPart

behavior_definition(annotations, name, args, *parts)[source]#
Parameters:
behavior_effect_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

EffectPart

behavior_goal_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

GoalPart

behavior_heuristic_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

HeuristicPart

behavior_minimize_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

MinimizePart

boolean(value)#

Captures boolean literals.

Parameters:

value (bool)

Return type:

bool

controller_definition(annotations, name, args, effect)[source]#
Parameters:
decorator_kwarg(k, v=True)#

Captures the key-value pair of a decorator. This is used in the decorator syntax, such as [[k=True]].

Parameters:

v (LiteralValue | LiteralList | LiteralSet)

Return type:

Tuple[str, bool | int | float | complex | str | LiteralList | LiteralSet]

decorator_kwargs(args)#

Captures the key-value pairs of a decorator. This is used in the decorator syntax, such as [[k=True, k2=123, k3=[1, 2, 3]]].

Return type:

Dict[str, bool | int | float | complex | str | LiteralList | LiteralSet]

feature_definition(annotations, name, args, ret, suite)[source]#
Parameters:
function_definition(annotations, name, args, ret, suite)[source]#
Parameters:
generator_definition(annotations, name, args, *parts)[source]#
Parameters:
generator_goal_definition(suite)[source]#
Parameters:

suite (Tree)

Return type:

GoalPart

generator_in_definition(values)[source]#
Parameters:

values (Tree)

Return type:

InPart

generator_out_definition(values)[source]#
Parameters:

values (Tree)

Return type:

OutPart

in_typed_argument(name, value)#

Captures typed arguments defined as name in value. This is used in forall/exists statements.

Parameters:
Return type:

InTypedArgument

include_definition(path)[source]#
Parameters:

path (str)

is_typed_argument(name, typename)#

Captures typed arguments defined as name is typename. This is used in forall/exists statements.

Parameters:
Return type:

Variable

list_typename(element_dtype)#

Captures list typenames defined as list[typename].

Parameters:

element_dtype (str | TypeBase)

Return type:

ListType

literal(value)#

Captures literal values.

Parameters:

value (bool | int | float | complex | str | LiteralList | LiteralSet)

Return type:

LiteralValue | LiteralList | LiteralSet

literal_list(*items)#

Captures literal lists, such as [1, 2, 3, 4].

Parameters:

items (Any)

Return type:

LiteralList

literal_set(*items)#

Captures literal sets, such as {1, 2, 3, 4}.

Parameters:

items (Any)

Return type:

LiteralSet

multi_typed_arguments(name, typename)#

Captures multiple typed arguments defined as name1, name2: typename.

Parameters:
Return type:

CSList

number(value)#

Captures number literals, including integers, floats, and complex numbers.

Parameters:

value (int | float | complex)

Return type:

int | float | complex

object_constant_definition(name, typename)[source]#
Parameters:
pragma_definition(pragma)[source]#
Parameters:

pragma (Dict[str, Any])

pragma_definition_with_args(function, arguments)[source]#
sized_vector_typename(name, size)#

Captures sized vector typenames defined as vector[typename, size].

Parameters:
Return type:

VectorValueType

string(value)#

Captures string literals.

Parameters:

value (str)

Return type:

str

transform(tree)#

Transform the given tree, and return the final result

Parameters:

tree (Tree[_Leaf_T])

Return type:

_Return_T

type_definition(typename, basetype)[source]#
Parameters:

basetype (str | TypeBase | None)

typed_argument(name, typename)#

Captures typed arguments defined as name: typename.

Parameters:
Return type:

Variable

typename(name)#

Captures typenames including basic types and vector types.

Parameters:

name (str | TypeBase)

Return type:

TypeBase

unsized_vector_typename(name)#

Captures unsized vector typenames defined as vector[typename].

Parameters:

name (str | TypeBase)

Return type:

VectorValueType

property domain: CrowDomain#
property expression_def_ctx: ExpressionDefinitionContext#
property expression_interpreter: CDLExpressionInterpreter#