Ejemplo n.º 1
0
def symbol_def_arguments(type_: ValueType, name: str,
                         value: WithToString) -> ArgumentElementsRenderer:
    return argument_renderer.SequenceOfElements((
        VALUE_TYPE_INFOS[type_].identifier,
        name,
        instruction_arguments.ASSIGNMENT_OPERATOR,
        value,
    ))
Ejemplo n.º 2
0
def symbol_def_instruction(type_: ValueType, name: str,
                           value: WithToString) -> ArgumentElementsRenderer:
    return argument_renderer.SequenceOfElements(
        [instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME] +
        symbol_def_arguments(type_, name, value).elements)
Ejemplo n.º 3
0
def constant(value: bool) -> ArgumentElementsRenderer:
    return arg_r.SequenceOfElements([logic.CONSTANT_MATCHER,
                                     logic.BOOLEANS[value]])
Ejemplo n.º 4
0
def rel_symbol_arg(symbol_name: str) -> ArgumentElementsRenderer:
    return argument_renderer.SequenceOfElements([
        argument_renderer.OptionArgument(path_texts.REL_SYMBOL_OPTION_NAME),
        symbol_name,
    ])
Ejemplo n.º 5
0
def sequence(arguments: Sequence[WithToString],
             separator: WithToString = None) -> ArgumentElementsRenderer:
    if separator is not None:
        return arg_r.SequenceOfElementsSeparatedByElement(separator, arguments)
    else:
        return arg_r.SequenceOfElements(arguments)