Program Reference: Control Flow and Runtime
AilExecutor Control-Flow Examples
These examples describe the current AilExecutor runtime contract, not the
current public ExecutionSession buffered-session behavior.
GOTO
Input:
N10 GOTO END
N20 G1 X10
END:
N30 G1 X20
Runtime effect in AilExecutor:
- parser lowers
GOTO ENDandEND:into control-flow instructions - execution jumps to
END N20 G1 X10is skipped- only
N30 G1 X20reaches the runtime as a move command
IF / ELSE / ENDIF
Input:
IF $P_ACT_X > 100
G1 X0
ELSE
G1 X10
ENDIF
Runtime effect in AilExecutor:
- the condition is evaluated at execution time, not parse time
- if
$P_ACT_X > 100, onlyG1 X0reaches the runtime - otherwise only
G1 X10reaches the runtime
See Execution Workflow for the current
ExecutionSession boundary and when to drop down to AilExecutor.
M Functions
Status:
Partial(parse + validation + AIL emission + executor boundary policy)
Supported syntax:
M<value>M<address_extension>=<value>
Validation:
- M value must be integer
0..2147483647 - extended form must use equals syntax
- extended form is rejected for predefined stop/end families:
M0M1M2M17M30
AIL output:
- emits
m_functioninstructions with:- source
- value
- optional address extension
Executor boundary behavior:
- known predefined Siemens M values are accepted and advanced without machine actuation in v0
- unknown M values follow executor policy:
errorwarningignore
Current limitation:
- runtime machine-function execution mapping is not implemented in this slice
Control Flow and Runtime
Implemented behavior:
GOTOtarget search:GOTOF: forward onlyGOTOB: backward onlyGOTO: forward then backwardGOTOC: same search asGOTO, unresolved target does not fault
- target kinds:
- label
Nline number- numeric line number
- system-variable token target
AilExecutorbranch resolver contract:- injected resolver interface returns
true,false,pending, orerror pendingsupportswait_tokenand retry timestamp- function/lambda overload remains as a compatibility adapter
- injected resolver interface returns
- structured
IF/ELSE/ENDIFlowering usesbranch_ifplus internal labels and gotos
Current limitations:
- loop-family statements remain parse-only
- live system-variable evaluation remains a runtime-resolver responsibility, not parser/lowering behavior