API
blark.apischema_compat
Alternative constructor for a given type. |
|
Tagged union decorator, to be used on base class. |
|
Recursive implementation of type.__subclasses__ |
|
blark.config
blark.dependency_store
A storage container for dependency configuration and loading. |
|
Dependency store configuration, from |
|
This is a per-PLC project metadata container. |
|
Get the global DependencyStore instance. |
|
|
Load the given projects by filename. |
blark.format
|
|
Get an output filename based on the input filename and destination path. |
|
Output the given source to the console. |
|
For each parsed code block, generate an OutputBlock for writing to disk. |
|
|
|
Reformat the code with the provided settings. |
|
|
Write source code to the given file. |
blark.html
|
A single HTML tag annotation which applies to a position range of source code. |
|
|
|
|
Get annotations for syntax elements in the given parse tree. |
blark.input
|
|
|
|
|
|
|
Load a file using blark's file input handlers. |
blark.main
blark.output
|
|
|
blark.parse
An enumeration. |
|
|
|
|
|
|
Dump object |
Get a cached lark.Lark parser for TwinCAT flavor IEC61131-3 code. |
|
|
Parse the given source code/project. |
|
Get a new parser for TwinCAT flavor IEC61131-3 code. |
|
Parse the given source code file (or all files from the given project). |
|
|
|
Parse an entire tsproj project file. |
|
Parse a single source code file. |
|
Parse source code into a |
|
Get a code summary instance from one or more ParseResult instances. |
blark.plain
|
blark.solution
|
|
|
|
|
|
|
A stub container for a TwinCAT project (.tsproj) file. |
|
A container for a TwinCAT/Visual Studio solution (.sln). |
Solution loader-related exception base class. |
|
|
|
|
|
|
|
|
Extra information in the project XML such as Line IDs. |
|
|
|
TcIO file - for INTERFACE definitions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
A currently unsupported block of XML in the project. |
|
A TwinCAT PLC project. |
|
A wrapper for all TwinCAT project source code files. |
|
Container for a loaded TwinCAT tsproj project. |
Unsupported project file. |
|
Get all blark input from the given solution. |
|
|
|
|
|
|
Get a project target GUID from its xml. |
Get a project target AMS Net ID from its xml. |
|
|
From a TwinCAT solution (.sln) or .tsproj, get a Solution instance. |
|
Parse the given XML contents with lxml.etree. |
Parse a given XML file with lxml.etree.parse. |
|
|
Load a TwinCAT project (.tsproj) file. |
Find project filenames from the contents of a solution. |
|
|
Load a TwinCAT solution (.sln) file. |
|
Strip off (e.g.) END_FUNCTION_BLOCK the provided code. |
Strip off {{namespace}} from: {{namespace}}tag. |
|
|
Load a single TwinCAT file based on its extension. |
|
Write source code |
blark.sphinxdomain
|
|
Blark IEC61131-3 language domain. |
|
|
|
|
|
|
|
|
|
blark.summary
|
Summary representation of a single action. |
|
Summary representation of a set of code - functions, function blocks, etc. |
|
Summary representation of a single data type. |
|
Summary representation of a single declaration. |
|
Summary representation of a single function block. |
|
Summary representation of a single function. |
Summary representation of a VAR_GLOBAL block. |
|
|
Summary representation of an Interfae. |
|
A summary of linkable (located) declarations. |
|
Summary representation of a single method. |
|
Summary representation of a single program. |
|
Summary representation of a single property. |
|
Base class for summary objects. |
Get all located/linkable declarations. |
|
Get the file/line number context for the summary items. |
|
Get a generic multiline string representation of the given object. |
blark.transform
|
A single, named program access declaration. |
|
A block of named, program access variable declarations ( |
An enumeration. |
|
|
A full, named action declaration. |
|
Initial value for an array element (potentialy repeated). |
|
Array initialization (bare or bracketed). |
|
An array specification. |
|
Full declaration of an array type. |
Array specification and optional default (initialization) value. |
|
A declaration of one or more variables with array type initialization and optional default (initialization) value. |
|
|
An assignment statement. |
|
Binary bit string literal value. |
|
|
|
A binary (i.e., two operand) operation. |
|
Bit string literal value. |
|
Boolean literal value. |
|
An expression with square brackets around it. |
|
A single element of a |
|
A switch-like |
|
A set of chained function (function block, method, action, etc.) calls. |
A chained set of function calls as a statement, in a "fluent" style. |
|
A statement used to jump to the top of a loop, |
|
|
A non-generic type name, or a data type name. |
|
A data type declaration, wrapping the other declaration types with |
|
Date literal value. |
|
Date and time literal value. |
|
A single declared variable name and optional [direct or incomplete] location. |
|
Direct variables with I/O linkage. |
|
Duration literal value. |
|
An edge declaration of one or more variables. |
|
The |
|
The else-if |
An enumerated specification. |
|
An enumerated type declaration. |
|
Enumerated specification with initialization enumerated value. |
|
|
An enumerated value. |
|
A statement used to exit a loop, |
Base class for all types of expressions. |
|
|
Top-level source code item - extended to include the possibility of standalone implementation details (i.e., statement lists). |
|
The "EXTENDS" portion of a function block, interface, structure, etc. |
A named, external variable declaration inside a variable block. |
|
A block of named, external variable declarations ( |
|
|
Field - or attribute - selector as part of a multi-element variable. |
|
A loop with a control variable and a start, stop, and (optional) step value. |
|
|
|
A full subrange (i.e., asterisk |
|
A full function block type declaration, with nested variable declaration blocks. |
|
A full function block type declaration. |
Base class for declarations of variables using function blocks. |
|
Base class for declarations of variables using function blocks by invocation. |
|
Base class for declarations of variables using function blocks by name. |
|
|
A function (function block, method, action, etc.) call. |
|
A function (function block, method, action, etc.) call as a statement. |
An enumeration. |
|
A declaration of one or more global variables: name and location specification and initialization type. |
|
Global variable declarations block ( |
|
|
Global variable specification; the part that comes before the initialization. |
Grammar transformer which takes lark objects and makes a |
|
|
Hex bit string literal value. |
|
|
|
The |
|
The "IMPLEMENTS" portion of a function block, indicating it implements one or more interfaces. |
A named, incomplete located variable declaration inside a variable block. |
|
Incomplete located variable declarations block ( |
|
Incomplete location information. |
|
A simple specification with the possibility of indirection. |
|
|
Indirect access through a pointer or reference. |
Base class for a declaration of one or more variables with a type initialization. |
|
|
A named initialized structure. |
|
A block of named, input variable declarations ( |
A block of named, input/output variable declarations ( |
|
An input parameter in a function call. |
|
|
Integer literal value. |
|
A full interface declaration, with nested variable declaration blocks. |
|
This is the "goto"-style |
|
A statement marked with a user-defined label. |
|
Long date literal value. |
|
Long date and time literal value. |
|
Long duration literal value. |
Base class for all literal values. |
|
Declaration of a variable in a VAR block that is located. |
|
Located variable declarations block ( |
|
|
A located direct variable. |
|
Long time of day literal value. |
|
Lark-derived meta information in the form of a dataclass. |
|
A full, named method declaration. |
Declarations block for instance variables in methods ( |
|
|
A multi-element variable - with one or more subscripts and fields. |
|
A no-operation statement referring to a variable and nothing else. |
|
Object initialization in array form. |
|
Octal bit string literal value. |
|
|
|
A block of named, output variable declarations ( |
A named output parameter, which may be inverted. |
|
Base class for assigned parameters in function calls. |
|
An expression with parentheses around it. |
|
|
A partial subrange, including a start/stop element index. |
|
A full program declaration, with nested variable declaration blocks. |
|
A named property declaration, which may pertain to a |
|
Floating point (real) literal value. |
A reference assignment statement. |
|
|
An ending conditional loop statement, |
|
A "reset" statement which conditionally clears a variable to |
|
A statement used to return from a function [block], |
|
A "set" statement which conditionally sets a variable to |
|
A simple specification with just a type name (or a string type name). |
|
A declaration of a simple type. |
|
A simple, single-element variable. |
|
Top-level source code item. |
Base class for all statements in a structured text implementation section. |
|
|
A list of statements, making up a structured text implementation. |
|
Static variable declarations block ( |
|
String literal value. |
|
The length of a defined string. |
|
A string type declaration. |
Single or double-byte string specification. |
|
Specification of a string type. |
|
A declaration of one or more variables using single/double byte strings, with an optinoal initialization value. |
|
Declaration of a single element of a structure. |
|
An initialization (default) value for a structure element. |
|
|
A structure initialization (i.e., default values) of one or more elements. |
Full structure type declaration, as part of a TYPE. |
|
A declaration of one or more variables using a named initialized structure. |
|
Subrange base class. |
|
|
A subrange specification. |
A subrange type declaration. |
|
A subrange type initialization. |
|
|
A list of subscripts. |
Temporary variable declarations block ( |
|
|
Time of day literal value. |
Type information derived from a specification or initialization. |
|
|
A simple initialization specification of a type name. |
Base class for type initializations. |
|
Base class for a specification of a type. |
|
|
A unary - single operand - operation: |
Declaration of a single element of a union. |
|
|
A full declaration of a UNION type, as part of a TYPE/END_TYPE block. |
Variable base class. |
|
An enumeration. |
|
Base class for variable declaration blocks. |
|
|
Variable declarations block ( |
An enumeration. |
|
A declaration of one or more variables with a type, subrange, or enumerated type initialization. |
|
Size prefix, used in locations (e.g., |
|
|
A beginning conditional loop statement, |
An internal handler for array initial elements with repeat count values. |
|
Internal handler for array initialization, without brackets |
|
Internal handler for array initialization with brackets. |
|
A helper base class which translates tokens to |
|
|
API compat to give a valid init attribute. |
|
Override the default code formatting settings. |
Given a class, get blark's |
|
|
Stringified and indented {value}. |
|
Stringified and indented {value} if not None. |
|
'{value1}{delimiter}{value2} if value1 and value2, otherwise just {value1} or {value2}. |
|
Take the transformed tree and annotate comments back into meta information. |
Create the Meta field for the dataclass magic. |
|
Multiline code block with lax beginning/end newlines. |
|
|
Transform a |
blark.typing
|
Indicates that the given class can emit blark-compatible source items. |
|
|
|
|
|
blark.util
|
A blark convention for giving portions of code unique names. |
|
An enumeration. |
|
Clean nested multiline comments from |
Match a path in a case-insensitive manner. |
|
|
Hash a file's contents with the SHA-256 algorithm. |
Get the lark grammar source for the provided rule. |
|
|
Get source code from the given file. |
|
Indent the inner lines of |
|
Add brackets to |
|
Enter an interactive debug session with pdb or IPython, if available. |
Rebuild a given lark tree, adjusting line numbers to match up with the source. |
|
|
Remove the provided keys from the JSON object. |
|
Remove all comments and replace them with the provided character. |
Take only the inner contents of a given comment. |
|
|
Simplify repeated brackets/parentheses in |
|
Return the contents to write for the given XML tree. |
|