Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
ironplcc¶
Name¶
ironplcc — IronPLC compiler
Synopsis¶
Description¶
ironplcc is the IronPLC compiler command line interface. It checks
IEC 61131-3 source files for correctness and compiles them into bytecode
container (.iplc) files for execution by the ironplcvm runtime.
Most developers will use ironplcc through the Visual Studio Code extension, but you can also use it directly, for example, to implement a continuous integration pipeline.
When a command accepts multiple files, the files are treated as a single compilation unit (essentially combined for analysis). Directory names can be given to add all files in the given directory.
See also
See Source Formats for all supported source file formats.
Commands¶
Build Commands¶
- ironplcc check [FILES…]
Check source files for syntax and semantic correctness without producing output. On success, the command produces no output.
- ironplcc compile [FILES…]
-oOUTPUT Compile source files into a bytecode container (
.iplc) file. Requires the--output(-o) flag to specify the output file path.Warning
The compile command currently supports only trivial programs. Supported features include:
PROGRAMdeclarations,INTvariable declarations, assignment statements, integer literal constants, and the+(add) operator. Programs using other features will produce a code generation error.
Diagnostic Commands¶
- ironplcc echo [FILES…]
Parse source files and write the parsed representation to standard output. This is primarily useful for diagnostics and understanding the internal structure of the parsed files.
- ironplcc tokenize [FILES…]
Tokenize source files and verify that all content matches a token. This is primarily useful for diagnostics and understanding the lexer behavior.
Other Commands¶
- ironplcc lsp
--stdio Run in Language Server Protocol mode to integrate with development tools such as Visual Studio Code. Communication uses standard input/output.
- ironplcc version
Print the version number of the compiler.
Options¶
-v,--verboseTurn on verbose logging. Repeat the flag to increase verbosity (e.g.,
-vvv).-lFILE,--log-fileFILEWrite log output to the specified file instead of the terminal.
Examples¶
Check a source file for correctness:
ironplcc check main.st
Check all files in a directory:
ironplcc check src/
Compile a source file to a bytecode container:
ironplcc compile main.st -o main.iplc
Compile with verbose logging to a file:
ironplcc -vv --log-file build.log compile main.st -o main.iplc
Inspect the parsed representation of a file:
ironplcc echo main.st
See Also¶
ironplcvm — IronPLC virtual machine runtime
Overview — Getting started tutorial
Source Formats — Supported source file formats
Problem Codes — Compiler problem code index