Class MacroFrame
Top-level integer marker stamped onto a SyntaxPiece's JSON
to identify which call frame the block belongs to. Brand-agnostic by
design — written by FanucMacroCallSyntax
today, reusable by any future call-inlining syntax (Fanuc G66
modal expansion, Heidenhain LBL CALL, …) that needs
local-variable isolation across call boundaries.
Semantics: the value is an opaque id; only equality matters. Two
blocks with the same MacroFrame id share a call frame
(locals visible across them via single-step carry); two blocks with
different ids do not. The id 0 is reserved for the main
program frame and is returned by Get(JsonObject) when the field is
absent — so a plain caller block needs no stamp and yet compares
distinct from any inlined frame.
Stored as a top-level JSON int (not an object section) so it stays
lightweight on every inlined block. Decoupled from
FanucMacroCall: that section is a diagnostic record of
the call (what file, what args), while MacroFrame is the
purely functional marker the local-variable I/O syntaxes consult.
public static class MacroFrame
- Inheritance
-
MacroFrame
- Inherited Members
Methods
Get(JsonObject)
Reads the frame id off a block, returning 0 (main frame)
when the field is absent or non-integer.
public static int Get(JsonObject json)
Parameters
jsonJsonObject
Returns
Set(JsonObject, int)
Stamps the frame id onto a block. Overwrites any previous value.
Callers writing the main-frame default (0) should simply
leave the field absent rather than calling this with 0.
public static void Set(JsonObject json, int frameId)
Parameters
jsonJsonObjectframeIdint