janus.language.alc.alc#

Attributes#

log

Classes#

AlcCombiner

A class that combines code blocks into ALC files.

AlcSplitter

A class for splitting ALC code into functional blocks to prompt

AlcListingSplitter

A class for splitting ALC listing code into functional blocks to

Module Contents#

janus.language.alc.alc.log#
class janus.language.alc.alc.AlcCombiner#

Bases: janus.language.combine.Combiner

A class that combines code blocks into ALC files.

Initialize a AlcCombiner instance.

class janus.language.alc.alc.AlcSplitter(model=None, max_tokens=4096, protected_node_types=(), prune_node_types=(), prune_unprotected=False)#

Bases: janus.language.treesitter.TreeSitterSplitter

A class for splitting ALC code into functional blocks to prompt with for transcoding.

Initialize a AlcSplitter instance.

Parameters:
class janus.language.alc.alc.AlcListingSplitter(model=None, max_tokens=4096, protected_node_types=(), prune_node_types=(), prune_unprotected=False)#

Bases: AlcSplitter

A class for splitting ALC listing code into functional blocks to prompt with for transcoding.

Initialize a AlcSplitter instance.

Parameters:
split_string(code, name)#

Split the given code into functional code blocks.

Parameters:
  • code (str) – The code as a string to split into functional blocks.

  • name (str) – The filename of the code block.

Returns:

A CodeBlock made up of nested `CodeBlock`s.

Return type:

janus.language.block.CodeBlock

preproccess_assembly(code)#

Remove non-essential lines from an assembly snippet

Parameters:

code (str) –

Return type:

str

get_active_usings(code)#

Look for ‘active usings’ in the ALC listing header

Parameters:

code (str) –

Return type:

Optional[str]

strip_header_and_left(lines)#

Remove the header and the left panel from the assembly sample

Parameters:

lines (list[str]) –

Return type:

list[str]

strip_addresses(lines)#

Strip the addresses which run down the right side of the assembly snippet

Parameters:

lines (list[str]) –

Return type:

list[str]

Strip the footer from the assembly snippet

Parameters:

lines (list[str]) –