Please, help to understand aircraft behaviour

Example code from TBM930 Code

Panel_Light p0 0 > if{ (A:LIGHT PANEL, Bool) ! (A:LIGHT PEDESTRAL, Bool) !
or if{ 1 (>K:PANEL_LIGHTS_SET) 1 (>K:PEDESTRAL_LIGHTS_SET) } els{ (A:LIGHT
POTENTIOMETER:4, Percent) 5 > if{ 4 (>K:LIGHT_POTENTIOMETER_DEC) } } } els{
(A:LIGHT POTENTIOMETER:4, Percent) 100 == if{ 0 (>K:PANEL_LIGHTS_SET) 0
(>K:PEDESTRAL_LIGHTS_SET) } els{ 4 (>K:LIGHT_POTENTIOMETER_INC) } }
(A:LIGHT PANEL, Bool) if{ (A:LIGHT POTENTIOMETER:4, Percent) ‘%d%%’ @sprintf
} els{ (R:1:@TT_Package.GT_STATE_OFF) } True
@TT_Package.LIGHTING_KNOB_PANEL_ACTION

I dont understand: 1. p0 0 > if{} - what is p0? What is contained and
where does the meaning come from? 2. 4 ( >K:LIGHT_POTENTIOMETER_DEC) -
what is mean? I send K: events four times? 3. I also not understand this:
50 0 (A:LIGHT PANEL, Bool) ? 4 ( >K:2:LIGHT_POTENTIOMETER_SET) Thanks a
lot for help

1. p is stack operator - p0 will load top value. stack is a global container
and values can be added outside of the current XML node (not sure about
outside of the script) 2. some key events require value to be passed 3.
first half is similar to common codding structure: **(A:LIGHT PANEL, Bool)
== true ? 50 : 0 ** K:2 means 2 values will be passed - 50/0 and 4