knitout_interpreter.knitout_language.knitout_actions module
Actions for reducing in Knitout Parser
- knitout_interpreter.knitout_language.knitout_actions.comment(_, __, content)[source]
Extracts the content of a comment.
- knitout_interpreter.knitout_language.knitout_actions.code_line(_, __, c, com)[source]
Creates a knitout line with optional comment.
- Parameters:
_ (Any) – The parser element that created this value.
__ (Any) – Unused parameter.
c (Knitout_Line | None) – The knitout line to execute, if any.
com (str | None) – The comment to append to the knitout line.
- Returns:
The knitout line created or None if no values are given.
- Return type:
Knitout_Line | None
- knitout_interpreter.knitout_language.knitout_actions.magic_string(_, __, v)[source]
Creates a knitout version line.
- Parameters:
- Returns:
The version line knitout line.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.header_line(_, __, h_op)[source]
Returns a header line operation.
- Parameters:
_ (Any) – The parser element that created this value.
__ (Any) – Unused parameter.
h_op (Knitout_Header_Line) – Operation on the line.
- Returns:
The header operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.machine_op(_, __, m)[source]
Creates a machine header line.
- Parameters:
- Returns:
The machine declaration operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.gauge_op(_, __, g)[source]
Creates a gauge header line.
- Parameters:
- Returns:
Gauge_Declaration.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.yarn_op(_, __, cid, plies, weight, color)[source]
Creates a yarn header line.
- knitout_interpreter.knitout_language.knitout_actions.carriers_op(_, __, CS)[source]
Creates a carriers header line.
- Parameters:
- Returns:
Carrier declaration.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.position_op(_, __, p)[source]
Creates a position header line.
- Parameters:
- Returns:
The position declaration.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.in_op(_, __, c)[source]
Creates an in instruction.
- Parameters:
- Returns:
In operation on a carrier set.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.inhook_op(_, __, c)[source]
Creates an inhook instruction.
- Parameters:
- Returns:
Inhook operation on carrier set.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.releasehook_op(_, __, c)[source]
Creates a releasehook instruction.
- Parameters:
- Returns:
Releasehook operation on carrier set.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.out_op(_, __, c)[source]
Creates an out instruction.
- Parameters:
- Returns:
Out operation on the carrier set.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.outhook_op(_, __, c)[source]
Creates an outhook instruction.
- Parameters:
- Returns:
Outhook operation on the carrier set.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.rack_op(_, __, R)[source]
Creates a rack instruction.
- Parameters:
- Returns:
Rack operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.knit_op(_, __, D, N, CS)[source]
Creates a knit instruction.
- Parameters:
- Returns:
Knit operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.tuck_op(_, __, D, N, CS)[source]
Creates a tuck instruction.
- Parameters:
- Returns:
Tuck operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.miss_op(_, __, D, N, CS)[source]
Creates a miss instruction.
- Parameters:
- Returns:
Miss operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.kick_op(_, __, D, N, CS)[source]
Creates a kick instruction.
- Parameters:
- Returns:
The specified Kick Operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.split_op(_, __, D, N, N2, CS)[source]
Creates a split instruction.
- Parameters:
- Returns:
Split operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.drop_op(_, __, N)[source]
Creates a drop instruction.
- Parameters:
- Returns:
Drop operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.xfer_op(_, __, N, N2)[source]
Creates a transfer instruction.
- Parameters:
- Returns:
Xfer operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.pause_op(_, __)[source]
Creates a pause instruction.
- Parameters:
- Returns:
Pause operation.
- Return type:
- knitout_interpreter.knitout_language.knitout_actions.identifier(_, node)[source]
Returns an identifier string.
- knitout_interpreter.knitout_language.knitout_actions.float_exp(_, node)[source]
Converts a string to a float.
- knitout_interpreter.knitout_language.knitout_actions.int_exp(_, node)[source]
Converts a string to an integer.
- knitout_interpreter.knitout_language.knitout_actions.needle_id(_, node)[source]
Creates a needle from a string representation.