Created
April 17, 2009 09:09
-
-
Save MikeRalphson/96935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0'?> | |
<pfxplus> | |
<directive type="ifdef"><token value="show_includes"/></directive> | |
<stmt type="symbol" value="#rem"><token value="pfxstate.inc"/></stmt> | |
<directive type="endif"></directive> | |
<directive type="use"><token value="stringf.pfi"/></directive> | |
<directive type="use"><token value="lparse.inc"/></directive> | |
<declare type="string"><token value="s_pfx_state"/><number value="1"/><!-- C=CODE, I=IMAGE --></declare> | |
<declare type="string"><token value="s_pfx_code"/><number value="4096"/><token value="s_pfx_comment"/><number value="256"/><token value="s_pfx_image"/><number value="256"/></declare> | |
<declare type="string"><token value="s_inc_stack"/><number value="4096"/></declare> | |
<declare type="string"><token value="s_inc_done"/><number value="4096"/></declare> | |
<declare type="string"><token value="s_st_type"/><number value="32"/></declare> | |
<declare type="indicator"><token value="x_pfx_label"/></declare> | |
<declare type="indicator"><token value="x_in_index"/><token value="x_in_token"/><token value="x_in_number"/><token value="x_in_init"/></declare> | |
<declare type="indicator"><token value="x_in_punct"/></declare> | |
<declare type="indicator"><token value="x_in_method_call"/></declare> | |
<declare type="indicator"><token value="x_in_error"/></declare> | |
<declare type="indicator"><token value="x_in_label"/></declare> | |
<declare type="indicator"><token value="x_in_precondition"/></declare> | |
<declare type="indicator"><token value="x_follow_includes"/><!-- TODO --></declare> | |
<declare type="indicator"><token value="x_rename_symbols"/><!-- TODO --></declare> | |
<declare type="indicator"><token value="x_first"/></declare> | |
<declare type="integer"><token value="i_in_expr"/></declare> | |
<declare type="integer"><token value="i_in_func_call"/></declare> | |
<declare type="string"><token value="s_new"/><number value="4096"/></declare> | |
<declare type="string"><token value="s_token"/><number value="128"/><token value="s_number"/><number value="28"/></declare> | |
<declare type="string"><token value="s_punct"/><number value="5"/></declare> | |
<declare type="string"><token value="s_block"/><number value="32"/></declare> | |
<declare type="string"><token value="s_hold"/><number value="2"/></declare> | |
<declare type="string"><token value="s_bracket"/><number value="128"/></declare> | |
<declare type="integer"><token value="i_pfx_line"/></declare> | |
<block type="procedure"><token value="set_follow_includes"/><declare type="indicator"/><token value="x_new"/> | |
<stmt type="symbol" value="x_follow_includes"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_rename_symbols"/><declare type="indicator"/><token value="x_new"/> | |
<stmt type="symbol" value="x_rename_symbols"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_in_error"/><declare type="indicator"/><token value="x_new"/> | |
<stmt type="symbol" value="x_in_error"><operator type="assign"/><token value="x_new"/></stmt> | |
<flow type="if"><token value="x_new"/><token value="x_in_token"/><operator type="assign"/><token value="true"/><!-- or fref it --></flow> | |
</block> | |
<block type="procedure"><token value="set_in_precondition"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><expr><token value="x_new"/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="x_first"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</stmt>"/></stmt> | |
</block> | |
<stmt type="symbol" value="x_in_precondition"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_in_label"/><declare type="indicator"/><token value="x_new"/> | |
<stmt type="symbol" value="x_in_label"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_in_token"/><declare type="indicator"/><token value="x_new"/> | |
<declare type="string"><token value="s_method"/><number value="128"/></declare> | |
<flow type="if"><token value="x_in_token"/><token value="and"/><expr><token value="not"/><token value="x_new"/></expr></flow><block type="begin"> | |
<flow type="if"><func_call function="pos"><param><stringlit value="\"/></param><param><token value="s_token"/></param></func_call><operator type="gt"/><number value="0"/></flow><block type="begin"> | |
<stmt type="symbol" value="parse"><token value="s_token"/><token value="at"/><stringlit value="\"/><noise type="to"/><token value="s_token"/><token value="s_method"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<method_call object=""/><token value="s_token"/><stringlit value="" method=""/><token value="s_method"/><stringlit value=""/>"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<!-- s_token = uppercase(s_token) --> | |
<block type="switch"><func_call function="uppercase"><param><token value="s_token"/></param></func_call> | |
<stmt type="pfxplus" value="when"><stringlit value="BEGIN"/><stringlit value="REPEAT"/><stringlit value="WHILE"/><stringlit value="SWITCH"/><stringlit value="PROCEDURE"/><stringlit value="FUNCTION"/><stringlit value="CONSTRAINT"/><stringlit value="FOR"/></stmt> | |
<flow type="if"><expr><token value="not"/><token value="x_first"/></expr><token value="and"/><expr><token value="s_st_type"/><operator type="ne"/><stringlit value=""/></expr></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><token value="s_st_type"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value=""/></stmt> | |
</block> | |
<stmt type="append"><token value="s_new"/><stringlit value="<block type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value="">"/></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value=""/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="END"/><stringlit value="LOOP"/><stringlit value="ENDSWITCH"/><stringlit value="END_PROCEDURE"/><stringlit value="END_FUNCTION"/><stringlit value="END_CONSTRAINT"/></stmt> | |
<stmt type="append"><token value="s_new"/><token value="s_st_type"/><stringlit value="</block>"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="UNTIL"/></stmt> | |
<stmt type="append"><token value="s_new"/><token value="s_st_type"/><stringlit value="</block><expr type="until">"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</expr>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="CALC"/><stringlit value="CALCULATE"/><stringlit value="INCREMENT"/><stringlit value="MOVE"/><stringlit value="MOVEINT"/><stringlit value="MOVENUM"/><stringlit value="MOVESTR"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="CLEARSCREEN"/><stringlit value="CLEARXY"/><stringlit value="GOTOXY"/><stringlit value="INKEY"/><stringlit value="INKEY$"/><stringlit value="INPUT"/><stringlit value="KEYCHECK"/><stringlit value="SCREENMODE"/><stringlit value="SHOW"/><stringlit value="SHOWLN"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="ABORT"/><stringlit value="CHAIN"/><stringlit value="CLEARWARNING"/><stringlit value="DEBUG"/><stringlit value="ERROR"/><stringlit value="GOSUB"/><stringlit value="GOTO"/><stringlit value="ON"/><stringlit value="RETURN"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="ATTACH"/><stringlit value="CLEAR"/><stringlit value="CLOSE"/><stringlit value="DELETE"/><stringlit value="FIND"/><stringlit value="OPEN"/><stringlit value="RELATE"/><stringlit value="SAVE"/><stringlit value="SAVERECORD"/><stringlit value="ZEROFILE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="DATE"/><stringlit value="INDICATOR"/><stringlit value="INTEGER"/><stringlit value="NUMBER"/><stringlit value="STRING"/><stringlit value="WINDOW"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<declare type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</declare>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="ENDGROUP"/><stringlit value="ENTDISPLAY"/><stringlit value="ENTER"/><stringlit value="ENTEREND"/><stringlit value="ENTERGROUP"/><stringlit value="ENTERMODE"/><stringlit value="ENTRY"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<enter stage=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</enter>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="ACCEPT"/><stringlit value="AUTOPAGE"/><stringlit value="BLANKFORM"/><stringlit value="CLEARFORM"/><stringlit value="DISPLAY"/><stringlit value="FORMAT"/><stringlit value="IFCHANGE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="NAME"/><stringlit value="OUTCLOSE"/><stringlit value="OUTFILE"/><stringlit value="OUTPUT"/><stringlit value="PAGE"/><stringlit value="PRINT"/><stringlit value="SETCHANGE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="IF"/><stringlit value="ELSE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<flow type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</flow>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="BACKFIELD"/><stringlit value="ENTAGAIN"/><stringlit value="HELP"/><stringlit value="KEYPROC"/><stringlit value="INDICATE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="ABS"/><stringlit value="ACOS"/><stringlit value="ASIN"/><stringlit value="ATAN"/><stringlit value="COS"/><stringlit value="EXP"/><stringlit value="LOG"/><stringlit value="REAL"/><stringlit value="ROUND"/><stringlit value="SIN"/><stringlit value="SQRT"/><stringlit value="TAN"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="DESPOOL"/><stringlit value="LOCK"/><stringlit value="REREAD"/><stringlit value="UNLOCK"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="FORMFEED"/><stringlit value="PAGECHECK"/><stringlit value="REPORT"/><stringlit value="REPORTEND"/><stringlit value="SECTION"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="CLOSE_INPUT"/><stringlit value="CLOSE_OUTPUT"/><stringlit value="DIRECT_INPUT"/><stringlit value="OUTFILE"/><stringlit value="READ"/><stringlit value="READ_BLOCK"/><stringlit value="READLN"/><stringlit value="WRITE"/><stringlit value="WRITELN"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="DIRECT_OUTPUT"/><stringlit value="BEEP"/><stringlit value="DECREMENT"/><stringlit value="DELAY"/><stringlit value="FILE_DEF"/><stringlit value="FILE_SET"/><stringlit value="FIELD_SET"/><stringlit value="GET_ENV"/> | |
<stringlit value="INDEX_SET"/><stringlit value="REINDEX"/><stringlit value="SYSTIME"/><stringlit value="GET_SCREEN"/><stringlit value="SET_SCREEN"/><stringlit value="CLASS"/><stringlit value="OBJECT"/><stringlit value="APPEND_OUTPUT"/> | |
<stringlit value="SWITCH"/><stringlit value="WHEN"/><stringlit value="BREAK"/><stringlit value="LOAD_MODULE"/><stringlit value="UNLOAD_MODULE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type="pfxplus" value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="TO"/><stringlit value="AS"/><stringlit value="IN"/><stringlit value="FROM"/><stringlit value="BY"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<noise type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="<parse_error6/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="EQ"/><stringlit value="GE"/><stringlit value="GT"/><stringlit value="LE"/><stringlit value="LT"/><stringlit value="NE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<operator type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="<parse_error7/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="STRMARK"/><stringlit value="STRLEN"/><stringlit value="LASTIF"/><stringlit value="#$"/><stringlit value="FOUND"/><stringlit value="FINDERR"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<symbol type="builtin" value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="<parse_error7/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="$POWERFLEX"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<symbol type="pfxplus" value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="<parse_error8/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="APPEND"/><stringlit value="ASCII"/><stringlit value="CHARACTER"/><stringlit value="CMDLINE"/><stringlit value="INSERT"/><stringlit value="LEFT"/><stringlit value="LENGTH"/><stringlit value="MID"/><stringlit value="PAD"/><stringlit value="POS"/><stringlit value="REPLACE"/><stringlit value="RIGHT"/><stringlit value="TRIM"/><stringlit value="UPPERCASE"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="COPYFILE"/><stringlit value="DIRECTORY"/><stringlit value="ERASEFILE"/><stringlit value="FIELD_DEF"/><stringlit value="FILE_MODE"/><stringlit value="FILE_SIZE"/><stringlit value="FILELIST"/><stringlit value="NEXT"/><stringlit value="PATHNAME"/><stringlit value="INDEX_DEF"/> | |
<stringlit value="MAKE_FILE"/><stringlit value="MEMORY"/><stringlit value="REGISTRATION"/><stringlit value="RENAMEFILE"/><stringlit value="RUNPROGRAM"/><stringlit value="SYSDATE"/><stringlit value="SYSTEM"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<flow type="if"><token value="x_first"/><token value="s_st_type"/><operator type="assign"/><stringlit value="</stmt>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="#ERROR"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<directive type="error" value=""/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value=""/>"/></stmt> | |
<stmt type="symbol" value="set_in_error"><token value="true"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="#USE"/><stringlit value="#RENAME"/><stringlit value="#IFDEF"/><stringlit value="#IFNDEF"/><stringlit value="#ENDIF"/><stringlit value="#REPLACE"/><!-- dataflex 2.3b --></stmt> | |
<stmt type="replace"><stringlit value="#"/><noise type="in"/><token value="s_token"/><token value="with"/><stringlit value=""/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<directive type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</directive>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="#COMMAND"/><stringlit value="#SET"/><stringlit value="#IFSAME"/><stringlit value="#IFCLASS"/><stringlit value="#IFTYPE"/><stringlit value="#ELSE"/><stringlit value="#ENDCOMMAND"/><!-- supported --></stmt> | |
<stmt type="replace"><stringlit value="#"/><noise type="in"/><token value="s_token"/><token value="with"/><stringlit value=""/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<directive type=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</directive>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="#CHECK"/><stringlit value="#FORMAT"/><stringlit value="#FREF"/><stringlit value="#IFIND"/><stringlit value="XPOP"/><stringlit value="#XPUSH"/></stmt> | |
<stmt type="replace"><stringlit value="#"/><noise type="in"/><token value="s_token"/><token value="with"/><stringlit value=""/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<directive type="ignored" value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><func_call function="if"><param><token value="x_first"/></param><param><stringlit value="">"/></param><param><stringlit value=""/>"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</directive>"/></stmt> | |
<stmt type="symbol" value="otherwise"></stmt> | |
<flow type="if"><token value="x_first"/></flow><block type="begin"> | |
<!-- TODO could handle I-Code functions here --> | |
<flow type="if"><token value="x_in_label"/></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<label value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="set_in_label"><token value="false"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt type="symbol" value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value="">"/></stmt> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value="</stmt>"/></stmt> | |
</block> | |
</block> | |
<flow type="else"> | |
<stmt type="append"/><token value="s_new"/><stringlit value="<token value=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value=""/>"/></flow> | |
</block> | |
</block> | |
</block> | |
<flow type="if"><expr><token value="x_in_token"/></expr><token value="and"/><expr><token value="not"/><token value="x_new"/></expr> | |
<token value="x_first"/><operator type="assign"/><token value="false"/></flow> | |
<stmt type="symbol" value="x_in_token"><operator type="assign"/><token value="x_new"/></stmt> | |
<flow type="if"><expr><token value="not"/><token value="x_in_token"/></expr><token value="s_token"/><operator type="assign"/><stringlit value=""/></flow> | |
</block> | |
<block type="procedure"><token value="set_in_number"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><token value="x_in_number"/><token value="and"/><expr><token value="not"/><token value="x_new"/></expr> | |
<stmt type="append"/><token value="s_new"/><stringlit value="<number value=""/><func_call function="uppercase"><param><token value="s_number"/></param></func_call><stringlit value=""/>"/></flow> | |
<stmt type="symbol" value="x_in_number"><operator type="assign"/><token value="x_new"/></stmt> | |
<flow type="if"><expr><token value="not"/><token value="x_in_number"/></expr><token value="s_number"/><operator type="assign"/><stringlit value=""/></flow> | |
<flow type="else"><flow type="if"/><expr><token value="s_hold"/><operator type="ne"/><stringlit value=""/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="s_number"><operator type="assign"/><token value="s_hold"/><token value="s_number"/></stmt> | |
<stmt type="symbol" value="s_hold"><operator type="assign"/><stringlit value=""/></stmt> | |
</block> | |
</block> | |
<block type="procedure"><token value="set_in_expr"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><expr><token value="i_in_expr"/><operator type="le"/><number value="0"/></expr><token value="and"/><expr><token value="not"/><token value="x_new"/></expr></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<parse_error1/>"/></stmt> | |
</block> | |
<flow type="else"><flow type="if"/><token value="x_new"/></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<expr>"/></stmt> | |
<stmt type="increment"><token value="i_in_expr"/></stmt> | |
<stmt type="append"><token value="s_bracket"/><stringlit value="E"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="</expr>"/></stmt> | |
<stmt type="pfxplus" value="decrement"><token value="i_in_expr"/></stmt> | |
<stmt type="symbol" value="s_bracket"><operator type="assign"/><func_call function="remove"><param><token value="s_bracket"/></param><param><func_call function="length"><param><token value="s_bracket"/></param></func_call></param><param><number value="1"/></param></func_call></stmt> | |
</block> | |
</block> | |
<block type="procedure"><token value="set_in_func_call"/><declare type="indicator"/><token value="x_new"/><declare type="indicator"/><token value="x_empty"/> | |
<declare type="string"><token value="s_method"/><number value="128"/></declare> | |
<flow type="if"><expr><token value="i_in_func_call"/><operator type="le"/><number value="0"/></expr><token value="and"/><expr><token value="not"/><token value="x_new"/></expr></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<parse_error2/>"/></stmt> | |
</block> | |
<flow type="else"><flow type="if"/><token value="x_new"/></flow><block type="begin"> | |
<flow type="if"><func_call function="pos"><param><stringlit value="\"/></param><param><token value="s_token"/></param></func_call><operator type="gt"/><number value="0"/></flow><block type="begin"> | |
<stmt type="symbol" value="parse"><token value="s_token"/><token value="at"/><stringlit value="\"/><noise type="to"/><token value="s_token"/><token value="s_method"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<method_call object=""/><token value="s_token"/><stringlit value="" method=""/><token value="s_method"/><stringlit value="">"/></stmt> | |
<stmt type="symbol" value="x_in_method_call"><operator type="assign"/><token value="true"/></stmt> | |
</block> | |
<flow type="else"> | |
<stmt type="append"/><token value="s_new"/><stringlit value="<func_call function=""/><func_call function="lowercase"><param><token value="s_token"/></param></func_call><stringlit value="">"/></flow> | |
<flow type="if"><token value="not"/><token value="x_empty"/><stmt type="append"/><token value="s_new"/><stringlit value="<param>"/></flow> | |
<stmt type="symbol" value="x_in_token"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="increment"><token value="i_in_func_call"/></stmt> | |
<stmt type="append"><token value="s_bracket"/><stringlit value="F"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<flow type="if"><expr><token value="not"/><token value="x_empty"/></expr><stmt type="append"/><token value="s_new"/><stringlit value="</param>"/></flow> | |
<flow type="if"><token value="x_in_method_call"/> | |
<stmt type="append"/><token value="s_new"/><stringlit value="</method_call>"/></flow> | |
<flow type="else"> | |
<stmt type="append"/><token value="s_new"/><stringlit value="</func_call>"/></flow> | |
<stmt type="pfxplus" value="decrement"><token value="i_in_func_call"/></stmt> | |
<stmt type="symbol" value="x_in_method_call"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="s_bracket"><operator type="assign"/><func_call function="remove"><param><token value="s_bracket"/></param><param><func_call function="length"><param><token value="s_bracket"/></param></func_call></param><param><number value="1"/></param></func_call></stmt> | |
</block> | |
</block> | |
<block type="procedure"><token value="set_in_index"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><token value="x_new"/><token value="and"/><expr><token value="not"/><token value="x_in_index"/></expr></flow><block type="begin"> | |
<flow type="if"><token value="x_first"/></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stmt><precondition>"/></stmt> | |
<stmt type="symbol" value="set_in_precondition"><token value="true"/></stmt> | |
</block> | |
<flow type="else"><stmt type="append"/><token value="s_new"/><stringlit value="<index>"/></flow> | |
</block> | |
<flow type="if"><expr><token value="not"/><token value="x_new"/></expr><token value="and"/><expr><token value="x_in_index"/></expr></flow><block type="begin"> | |
<flow type="if"><token value="x_in_precondition"/> | |
<stmt type="append"/><token value="s_new"/><stringlit value="</precondition>"/></flow> | |
<flow type="else"> | |
<stmt type="append"/><token value="s_new"/><stringlit value="</index>"/></flow> | |
</block> | |
<stmt type="symbol" value="x_in_index"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_in_init"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><token value="x_new"/><token value="and"/><expr><token value="not"/><token value="x_in_index"/></expr><stmt type="append"/><token value="s_new"/><stringlit value="<init>"/></flow> | |
<flow type="if"><expr><token value="not"/><token value="x_new"/></expr><token value="and"/><expr><token value="x_in_index"/></expr><stmt type="append"/><token value="s_new"/><stringlit value="</init>"/></flow> | |
<stmt type="symbol" value="x_in_init"><operator type="assign"/><token value="x_new"/></stmt> | |
</block> | |
<block type="procedure"><token value="set_in_punct"/><declare type="indicator"/><token value="x_new"/> | |
<flow type="if"><token value="x_in_punct"/><token value="and"/><expr><token value="not"/><token value="x_new"/></expr></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><stringlit value="<operator type=""/></stmt> | |
<block type="switch"><token value="s_punct"/> | |
<stmt type="pfxplus" value="when"><stringlit value="LE"/><stringlit value="<="/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="le"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="LT"/><stringlit value="<"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="lt"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="GE"/><stringlit value=">="/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="ge"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="GT"/><stringlit value=">"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="gt"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="EQ"/><stringlit value="=="/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="eq"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="NE"/><stringlit value="<>"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="ne"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="+"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="plus"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="-"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="minus"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="*"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="mult"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="/"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="div"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="^"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="pow"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="="/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="assign"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="~"/><stringlit value="NOT"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="not"/>"/></stmt> | |
</block> | |
</block> | |
<stmt type="symbol" value="x_in_punct"><operator type="assign"/><token value="x_new"/></stmt> | |
<flow type="if"><expr><token value="not"/><token value="x_in_punct"/></expr><token value="s_punct"/><operator type="assign"/><stringlit value=""/></flow> | |
</block> | |
<!-- ___________________________________________________________________________[] --> | |
<block type="procedure"><token value="pfxs_parse"/><declare type="string"/><token value="s_input"/><noise type="to"/><declare type="string"/><token value="s_remainder"/><token value="byref"/><declare type="indicator"/><token value="x_cont"/><token value="byref"/> | |
<declare type="indicator"><token value="x_stringlit"/></declare> | |
<declare type="indicator"><token value="x_empty"/></declare> | |
<declare type="indicator"><token value="x_end_stmt"/></declare> | |
<declare type="integer"><token value="i_loop"/></declare> | |
<declare type="string"><token value="s_char"/><number value="1"/><token value="s_next"/><number value="1"/><token value="s_opener"/><number value="1"/><token value="s_t2"/><number value="2"/></declare> | |
<declare type="string"><token value="s_lit"/><number value="256"/></declare> | |
<stmt type="increment"><token value="i_pfx_line"/></stmt> | |
<stmt type="move"><stringlit value=""/><noise type="to"/><token value="s_pfx_code"/></stmt> | |
<stmt type="move"><stringlit value=""/><noise type="to"/><token value="s_pfx_comment"/></stmt> | |
<stmt type="move"><stringlit value=""/><noise type="to"/><token value="s_pfx_image"/></stmt> | |
<stmt type="symbol" value="x_pfx_label"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="s_remainder"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="x_end_stmt"><operator type="assign"/><token value="true"/></stmt> | |
<stmt type="symbol" value="x_first"><operator type="assign"/><expr><token value="not"/><token value="x_cont"/></expr></stmt> | |
<flow type="if"><token value="x_first"/></flow><block type="begin"> | |
<stmt type="symbol" value="s_st_type"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="set_in_error"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_precondition"><token value="false"/></stmt> | |
</block> | |
<stmt type="symbol" value="x_cont"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="move"><func_call function="left"><param><token value="s_input"/></param><param><number value="2"/></param></func_call><noise type="to"/><token value="s_t2"/></stmt> | |
<flow type="if"><expr><token value="s_t2"/><operator type="ne"/><stringlit value="//"/></expr><token value="and"/><expr><func_call function="left"><param><token value="s_t2"/></param><param><number value="1"/></param></func_call><operator type="eq"/><stringlit value="/"/></expr><token value="and"/><expr><token value="s_pfx_state"/><operator type="eq"/><stringlit value="C"/></expr> | |
<stmt type="move"/><stringlit value="I"/><noise type="to"/><token value="s_pfx_state"/></flow> | |
<flow type="if"><expr><token value="s_t2"/><operator type="eq"/><stringlit value="/*"/></expr><token value="and"/><expr><token value="s_pfx_state"/><operator type="eq"/><stringlit value="I"/></expr><stmt type="move"/><stringlit value="C"/><noise type="to"/><token value="s_pfx_state"/></flow> | |
<flow type="if"><token value="s_pfx_state"/><operator type="eq"/><stringlit value="C"/></flow><block type="begin"> | |
<stmt type="symbol" value="replaces"><func_call function="character"><param><number value="9"/></param></func_call><noise type="in"/><token value="s_input"/><token value="with"/><stringlit value=" "/></stmt> | |
<!-- REPLACES " (" IN S_INPUT WITH "(" // in test, spaces before brackets of a function-call, insanity! --> | |
<!-- the above screws up things like SWITCH(expression) //TODO resolve this --> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="s_new"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="x_stringlit"><operator type="assign"/><token value="false"/></stmt> | |
<block type="for"><token value="i_loop"/><noise type="from"/><number value="1"/><noise type="to"/><func_call function="length"><param><token value="s_input"/></param></func_call> | |
<stmt type="move"><func_call function="mid"><param><token value="s_input"/></param><param><number value="1"/></param><param><token value="i_loop"/></param></func_call><noise type="to"/><token value="s_char"/></stmt> | |
<stmt type="move"><func_call function="uppercase"><param><func_call function="mid"><param><token value="s_input"/></param><param><number value="1"/></param><param><token value="i_loop1"/></param></func_call></param></func_call><noise type="to"/><token value="s_next"/></stmt> | |
<flow type="if"><token value="x_in_error"/></flow><block type="begin"> | |
<stmt type="append"><token value="s_new"/><token value="s_char"/></stmt> | |
</block> | |
<flow type="else"><flow type="if"/><token value="x_stringlit"/></flow><block type="begin"> | |
<flow type="if"><expr><token value="s_char"/><operator type="eq"/><token value="s_opener"/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="x_stringlit"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><func_call function="replaces"><param><stringlit value="&"/></param><param><token value="s_lit"/></param><param><stringlit value="&amp;"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><func_call function="replaces"><param><stringlit value="<"/></param><param><token value="s_lit"/></param><param><stringlit value="&lt;"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><func_call function="replaces"><param><stringlit value=">"/></param><param><token value="s_lit"/></param><param><stringlit value="&gt;"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><func_call function="replaces"><param><stringlit value="""/></param><param><token value="s_lit"/></param><param><stringlit value="&quot;"/></param></func_call></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><func_call function="replaces"><param><stringlit value="'"/></param><param><token value="s_lit"/></param><param><stringlit value="&apos;"/></param></func_call></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<stringlit value=""/><token value="s_lit"/><stringlit value=""/>"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="overstrike"><stringlit value="£"/><noise type="to"/><token value="s_input"/><token value="at"/><token value="i_loop"/></stmt> | |
<stmt type="append"><token value="s_lit"/><token value="s_char"/></stmt> | |
</block> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<flow type="if"><expr><token value="s_char"/><operator type="eq"/><stringlit value="'"/></expr><token value="or"/><expr><token value="s_char"/><operator type="eq"/><stringlit value="""/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="x_stringlit"><operator type="assign"/><token value="true"/></stmt> | |
<stmt type="symbol" value="s_lit"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="move"><token value="s_char"/><noise type="to"/><token value="s_opener"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<block type="switch"><func_call function="uppercase"><param><token value="s_char"/></param></func_call> | |
<stmt type="pfxplus" value="when"><stringlit value=" "/><func_call function="character"><param><number value="10"/></param></func_call><func_call function="character"><param><number value="13"/></param></func_call></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="false"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value=","/></stmt> | |
<flow type="if"><token value="i_in_func_call"/><operator type="gt"/><number value="0"/></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="</param><param>"/></stmt> | |
</block> | |
<flow type="else"><flow type="if"/><token value="x_in_token"/><stmt type="append"/><token value="s_token"/><stringlit value=","/><!-- things like |FN1234,5 --></flow> | |
<stmt type="pfxplus" value="when"><stringlit value=";"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="x_cont"><operator type="assign"/><token value="true"/></stmt> | |
<stmt type="symbol" value="x_end_stmt"><operator type="assign"/><token value="false"/></stmt> | |
<stmt type="symbol" value="s_input"><operator type="assign"/><func_call function="trim"><param><func_call function="right"><param><token value="s_input"/></param><param><func_call function="length"><param><token value="s_input"/></param></func_call><expr><token value="i_loop1"/></expr></param></func_call></param></func_call></stmt> | |
<flow type="if"><expr><token value="s_input"/><operator type="ne"/><stringlit value=""/></expr><token value="and"/><expr><func_call function="left"><param><token value="s_input"/></param><param><number value="2"/></param></func_call><operator type="ne"/><stringlit value="//"/></expr> | |
<stmt type="insert"/><stringlit value="//"/><noise type="in"/><token value="s_input"/><token value="at"/><expr><token value="i_loop1"/></expr></flow> | |
<!-- APPEND S_NEW S_INPUT --> | |
<!-- I_LOOP = MAXINT-1 // stop processing --> | |
<stmt type="pfxplus" value="when"><stringlit value="&"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<index type="auto"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="%"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="append"><token value="s_new"/><stringlit value="<index type="acc"/>"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="<"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_punct"/><token value="s_char"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value=">"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_punct"/><token value="s_char"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="A"/><stringlit value="B"/><stringlit value="C"/><stringlit value="D"/><stringlit value="E"/><stringlit value="F"/><stringlit value="G"/><stringlit value="H"/><stringlit value="I"/><stringlit value="J"/><stringlit value="K"/><stringlit value="L"/><stringlit value="M"/><stringlit value="N"/><stringlit value="O"/> | |
<stringlit value="P"/><stringlit value="Q"/><stringlit value="R"/><stringlit value="S"/><stringlit value="T"/><stringlit value="U"/><stringlit value="V"/><stringlit value="W"/><stringlit value="X"/><stringlit value="Y"/><stringlit value="Z"/><stringlit value="#"/><stringlit value="?"/><stringlit value="@"/><stringlit value="_"/><stringlit value="\"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_token"/><func_call function="uppercase"><param><token value="s_char"/></param></func_call></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="0"/><stringlit value="1"/><stringlit value="2"/><stringlit value="3"/><stringlit value="4"/><stringlit value="5"/><stringlit value="6"/><stringlit value="7"/><stringlit value="8"/><stringlit value="9"/><stringlit value="0"/><stringlit value="."/></stmt> | |
<flow type="if"><token value="x_in_token"/></flow><block type="begin"> | |
<stmt type="append"><token value="s_token"/><func_call function="uppercase"><param><token value="s_char"/></param></func_call></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_punct"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_number"/><func_call function="uppercase"><param><token value="s_char"/></param></func_call></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><stringlit value="+"/><stringlit value="-"/><!-- could be an operator or part of a number-literal --></stmt> | |
<flow type="if"><token value="x_in_number"/><stmt type="append"/><token value="s_number"/><token value="s_char"/></flow> | |
<flow type="else"><stmt type="append"/><token value="s_hold"/><token value="s_char"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="E"/></stmt> | |
<flow type="if"><token value="x_in_number"/><stmt type="append"/><token value="s_number"/><stringlit value="e"/></flow> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_token"/><stringlit value="E"/></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><stringlit value="$"/><!-- can introduce a hex number or be part of a token --></stmt> | |
<flow type="if"><token value="x_in_token"/><stmt type="append"/><token value="s_token"/><token value="s_char"/></flow> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_number"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_number"/><stringlit value="0x"/></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><stringlit value="/"/><!-- could be a division operator or part of a date-literal --></stmt> | |
<flow type="if"><expr><token value="s_next"/><operator type="ne"/><stringlit value="/"/></expr><token value="and"/><expr><token value="s_next"/><operator type="ne"/><stringlit value="*"/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<flow type="if"><token value="x_in_number"/><stmt type="append"/><token value="s_number"/><stringlit value="/"/><!-- date-literal --></flow> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_punct"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_punct"/><token value="s_char"/></stmt> | |
</block> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_error"><token value="false"/></stmt> | |
<stmt type="append"><token value="s_pfx_comment"/><func_call function="right"><param><token value="s_input"/></param><param><func_call function="length"><param><token value="s_input"/></param></func_call><expr><token value="i_loop1"/></expr></param></func_call></stmt> | |
<stmt type="symbol" value="i_loop"><operator type="assign"/><token value="maxint1"/><!-- stop! --></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><stringlit value="|"/><!-- can be a token-letter or a statement separator --></stmt> | |
<flow type="if"><token value="x_in_token"/><token value="or"/><expr><token value="s_next"/><operator type="eq"/><stringlit value="F"/></expr><token value="or"/><expr><token value="s_next"/><operator type="eq"/><stringlit value="V"/></expr><token value="or"/><expr><token value="s_next"/><operator type="eq"/><stringlit value="W"/></expr></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_token"/><token value="s_char"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_error"><token value="false"/></stmt> | |
<stmt type="symbol" value="s_remainder"><operator type="assign"/><func_call function="trim"><param><func_call function="right"><param><token value="s_input"/></param><param><func_call function="length"><param><token value="s_input"/></param></func_call><token value="i_loop"/></param></func_call></param></func_call></stmt> | |
<stmt type="symbol" value="i_loop"><operator type="assign"/><token value="maxint1"/><!-- stop --></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><func_call function="character"><param><number value="0"/></param></func_call><func_call function="character"><param><number value="12"/></param></func_call><!-- null and FF are end of line --></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="s_remainder"><operator type="assign"/><func_call function="trim"><param><func_call function="right"><param><token value="s_input"/></param><param><func_call function="length"><param><token value="s_input"/></param></func_call><expr><token value="i_loop1"/></expr></param></func_call></param></func_call></stmt> | |
<stmt type="symbol" value="i_loop"><operator type="assign"/><token value="maxint1"/><!-- stop --></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="("/></stmt> | |
<flow type="if"><token value="x_in_token"/></flow><block type="begin"><!-- AND (S_TOKEN NE "SWITCH") --> | |
<stmt type="symbol" value="x_empty"><operator type="assign"/><expr><token value="s_next"/><operator type="eq"/><stringlit value=")"/></expr></stmt> | |
<stmt type="symbol" value="set_in_func_call"><token value="true"/><token value="x_empty"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
</block> | |
<flow type="else"></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_expr"><token value="true"/></stmt> | |
</block> | |
<stmt type="pfxplus" value="when"><stringlit value=")"/></stmt> | |
<flow type="if"><func_call function="right"><param><token value="s_bracket"/></param><param><number value="1"/></param></func_call><operator type="eq"/><stringlit value="E"/></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_expr"><token value="false"/></stmt> | |
</block> | |
<flow type="else"><flow type="if"/><func_call function="right"><param><token value="s_bracket"/></param><param><number value="1"/></param></func_call><operator type="eq"/><stringlit value="F"/></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_func_call"><token value="false"/><token value="x_empty"/></stmt> | |
</block> | |
<flow type="else"><stmt type="append"/><token value="s_new"/><stringlit value="<parse_error3/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="["/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_index"><token value="true"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="]"/></stmt> | |
<flow type="if"><token value="x_in_index"/></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_index"><token value="false"/></stmt> | |
</block> | |
<flow type="else"><stmt type="append"/><token value="s_new"/><stringlit value="<parse_error4/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="{"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_init"><token value="true"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value="]"/></stmt> | |
<flow type="if"><token value="x_in_init"/></flow><block type="begin"> | |
<stmt type="symbol" value="set_in_init"><token value="false"/></stmt> | |
</block> | |
<flow type="else"><stmt type="append"/><token value="s_new"/><stringlit value="<parse_error5/>"/></flow> | |
<stmt type="pfxplus" value="when"><stringlit value="="/><stringlit value="^"/><stringlit value="*"/><stringlit value="~"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_punct"><token value="true"/></stmt> | |
<stmt type="append"><token value="s_punct"/><token value="s_char"/></stmt> | |
<stmt type="pfxplus" value="when"><stringlit value=":"/></stmt> | |
<stmt type="symbol" value="set_in_label"><token value="true"/></stmt> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="otherwise"></stmt> | |
<stmt type="show"><token value="s_char"/></stmt> | |
<!-- APPEND S_NEW S_CHAR --> | |
</block> | |
</block> | |
</block> | |
</block> | |
<stmt type="symbol" value="set_in_token"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_number"><token value="false"/></stmt> | |
<!-- doesn't end expressions, need to handle continuation lines better now --> | |
<stmt type="move"><func_call function="trim"><param><token value="s_new"/></param></func_call><noise type="to"/><token value="s_pfx_code"/></stmt> | |
<stmt type="move"><func_call function="trim"><param><token value="s_pfx_comment"/></param></func_call><noise type="to"/><token value="s_pfx_comment"/></stmt> | |
<flow type="if"><token value="s_pfx_comment"/><operator type="ne"/><stringlit value=""/></flow><block type="begin"> | |
<!-- REPLACES '&' IN S_PFX_COMMENT WITH "&" --> | |
<!-- REPLACES '"' IN S_PFX_COMMENT WITH """ --> | |
<!-- APPEND S_PFX_CODE '<comment value="' S_PFX_COMMENT '"/>' --> | |
<stmt type="symbol" value="replaces"><stringlit value="--"/><noise type="in"/><token value="s_pfx_comment"/><token value="with"/><stringlit value="__"/></stmt> | |
<stmt type="append"><token value="s_pfx_code"/><stringlit value="<!-- "/><token value="s_pfx_comment"/><stringlit value=" -->"/></stmt> | |
</block> | |
<flow type="if"><expr><token value="s_pfx_code"/><operator type="ne"/><stringlit value=""/></expr><token value="and"/><token value="x_end_stmt"/> | |
<stmt type="append"/><token value="s_pfx_code"/><token value="s_st_type"/></flow> | |
<!-- limit inspection of code in this routine to declarations --> | |
<!-- for symbol rewriting etc, and pre-processor directives --> | |
</block> | |
<flow type="else"><stmt type="move"/><token value="s_input"/><noise type="to"/><token value="s_pfx_image"/><!-- TODO --></flow> | |
</block> | |
<!-- ___________________________________________________________________________[] --> | |
<block type="procedure"><token value="pfxs_init"/><declare type="indicator"/><token value="x_follow_includes"/><noise type="to"/><declare type="indicator"/><token value="x_cont"/><token value="byref"/> | |
<declare type="string"><token value="s_dummy"/><number value="1"/></declare> | |
<stmt type="move"><stringlit value="C"/><noise type="to"/><token value="s_pfx_state"/><!-- PfxPlus starts in code-mode unlike DataFlex --></stmt> | |
<stmt type="move"><number value="1"/><noise type="to"/><token value="i_pfx_line"/></stmt> | |
<stmt type="symbol" value="set_in_expr"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_index"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_in_init"><token value="false"/></stmt> | |
<stmt type="symbol" value="set_follow_includes"><token value="x_follow_includes"/></stmt> | |
<stmt type="symbol" value="set_rename_symbols"><token value="false"/></stmt> | |
<stmt type="symbol" value="pfxs_parse"><stringlit value=""/><noise type="to"/><token value="s_dummy"/><token value="x_cont"/><!-- returns all strings / indicators correctly conditioned --></stmt> | |
<stmt type="symbol" value="x_cont"><operator type="assign"/><token value="false"/><!-- except maybe that one --></stmt> | |
<stmt type="symbol" value="s_bracket"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="s_inc_stack"><operator type="assign"/><stringlit value=""/></stmt> | |
<stmt type="symbol" value="s_inc_done"><operator type="assign"/><stringlit value=""/></stmt> | |
</block> | |
</pfxplus> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment