Topics

Macro Parser flowchart?

Doug K7KY
 

Hello FLDIGI Moderators...  I'm hoping to find a Macro Parser flowchart.  Dave explained the Parser to me years ago, but I've lost the post and didn't fully understand it all at the time. My macros are working OK, but when Dave revised one of my macros, I realized I didn't understand how the Parser prioritizes commands. If there's a Parser execution flowchart, I'd love to have a copy.  Thanks, Doug K7KY

Dave
 

Doug,

Macro Parse/Execute pseudo code

Clear transmit and receive first-in-first-out (FIFO).
Clear program state stack, last-in-first-out (LIFO).

While macro string contains tag substrings <...>
    parse tags

        remove comment tag substrings
            <COMMENT:...>
            <#...>

        execute immediate tag substrings
            <RIGCAT:...>, <FLRIG:...>,
            <LOG>, <LNW>, <CLRLOG>, <EQSL>,
            <DECR>, <INCR>, <LASTNO>, <SAVEXCHG>,
            <TIMER:...>, <IDLE:...>, <TUNE:...>, <WAIT:...>,
            <NRSID:...>,
            <MODEM>, <MODEM:...>,
            <EXEC>, </EXEC>,
            <CLRRX>, <CLRTX>, <FOCUS>,
            <QSY+:...>,
            <FILE:...>,
            <WPM:...>, <RISE:...>, <PRE:...>, <POST:...>"
            <AFC:...>, <LOCK:...>, <REV:...", <HS:...>,
            <RXRSID:...>, <TXRSID:...>,
            <DTMF:...>,
            <SRCHUP>, <SRCHDN>,
            <GOHOME>, <GOFREQ:...>, <QRG:...>,
            <QSY:...>, <QSYTO>, <QSYFM>,
            <RIGMODE:...>,
            <FILWID:...>, <RIGHI:...>, <RIGLO:...>,
            <MAPIT:...>, <MAPIT>,
            <ALERT:...>, <AUDIO:...>",
            <TXATTEN:...>,
            <DIGI>,
            <TALK:...>, (only on Win OS)
            <IMAGE:...>, <AVATAR>,

        perform string substitution for
            <CALL>, <FREQ>, <BAND>, <LOC>, <MODE>, <NAME>, <QTH>,
            <RST>, <ST>, <PR>,
            <MYCALL>, <MYLOC>, <MYNAME>, <MYQTH>,
            <MYRST>, <MYCLASS>, <MYSECTION>, <MYSTATE>,
            <MYST>, <MYCOUNTY>,
            <MYCNTY>, <ANTENNA>, <QSOTIME>, <QSONBR>, <NXTNBR>,
            <INFO1>, <INFO2>,
            <LDT>, <LDT:...>, <ILDT>, <ZDT>, <ZDT:...>,
            <IZDT>, <LT>, <ZT>,
            <LD>, <LD:...>, <ZD>, <ZD:...>,
            <ID>, <TEXT>, <VIDEO:...>,
            <CWID>, <VER>,
            <CNTR>,
            <X1>, <XIN>, <XOUT>,
            <FDCLASS>, <FDSECT>, <CLASS>, <SECTION>,
            <XBEG>, <XEND>, <SERNO>,
            <GET>,
            <CSV:...>, <WX>, <WX:...>,

        push Tx delayed actions to Tx FIFO, substitute FIFO tag in macro text
            <!WPM:...>, <!RISE:...>, <!PRE:...>, <!POST:...>,
            <!GOHOME>, <!GOFREQ:...>, <!QSY:...>,
            <!IDLE:...>, <!WAIT:...>, <!SKED:...>,
            <!MODEM:...>,
            <!RIGMODE:...>, <!FILWID:...>, <!RIGHI:...>, <!RIGLO:...>,
            <!TXATTEN:...>,
            <!RIGCAT:...>, <!FLRIG:...>,
            <!PUSH>, <!POP>, <!DIGI>,
            <!FREQ>, <!TUNE:...>,

        push Rx delayed actions to Rx FIFO, remove tag from macro text
            <@MODEM:...>,
            <@GOFREQ:...>, <@GOHOME>
            <@RIGCAT:...>, <@FLRIG:...>,
            <@RIGMODE:...>, <@FILWID:...>, <@RIGHI:...>, <@RIGLO:...>,
            <@TXRSID:...>,
            <@WAIT:...>,
            <@PUSH>, <@POP>,

        handle program state change tags
            <REPEAT>, <SKED:...>, <UNTIL:...>,
            <STOP>, <CONT>, <PAUSE>,
            <POP>, <PUSH>,

        special handling of rx/tx tags
            <RX>, <TX>, <TX/RX>

While macro text not empty
    Start Tx if <TX> parsed
    Send next character if printable text
    Execute next command in Tx FIFO if next character a FIFO tag
    End Tx if <RX> parsed

While Rx FIFO not empty
    Sequentially execute Rx FIFO actions

73, David, W1HKJ

Hello FLDIGI Moderators...  I'm hoping to find a Macro Parser flowchart.  Dave explained the Parser to me years ago, but I've lost the post and didn't fully understand it all at the time. My macros are working OK, but when Dave revised one of my macros, I realized I didn't understand how the Parser prioritizes commands. If there's a Parser execution flowchart, I'd love to have a copy. 

Thanks, Doug K7KY