raesl.compile.machine_files.sub_clause#

Line matcher for sub-clause lines.

Module Contents#

Functions#

guess_is_var(→ bool)

Guess whether the provided token is a variable or a value.

decode_disjunctive_comparisons(...)

Decode tags of a matched 'machine_parts.get_disjunctive_comparison_part' part

decode_subclause(→ raesl.compile.ast.components.SubClause)

Decode tags of a matched subclauses line to one or more disjunctive equations.

Attributes#

SUB_CLAUSE_SPEC

raesl.compile.machine_files.sub_clause.SUB_CLAUSE_SPEC#
raesl.compile.machine_files.sub_clause.guess_is_var(varvalue: raesl.compile.scanner.Token) bool#

Guess whether the provided token is a variable or a value. (Answer: If it is not “t.b.d.” and starts with a letter it’s a variable.)

raesl.compile.machine_files.sub_clause.decode_disjunctive_comparisons(tags: Dict[str, List[raesl.compile.scanner.Token]]) raesl.compile.ast.exprs.Expression#

Decode tags of a matched ‘machine_parts.get_disjunctive_comparison_part’ part to an disjunction with comparisons.

Parameters:

tags – Extracted data from a match of the machine defined in ‘machine_parts.get_disjunctive_comparison_part’.

Returns:

The expression equivalent to the matched text.

raesl.compile.machine_files.sub_clause.decode_subclause(tags: Dict[str, List[raesl.compile.scanner.Token]]) raesl.compile.ast.components.SubClause#

Decode tags of a matched subclauses line to one or more disjunctive equations.

Parameters:

tags – Extracted data from a match of the machine defined in SUB_CLAUSE_SPEC.

Returns:

The found subclause.