jBC Programmers Reference Guide · jBC preprocessor grammar · Grammar files on GitHub

jBC grammar: railroad diagrams

Generated from spec/jbc.y by spec/tools/grammar_diagrams.py; do not edit. Diagrams read left to right; a track that turns back is a repetition.

FORkeyword(punctuation or operatorIdentifiertoken class (hover for members)resultantrule (click)ident_optionsrule not in this page
How the yacc rules were rewritten

Actions, %prec and error alternatives are dropped. Left recursion such as eols : EOL | eols EOL becomes repetition. Alternatives that share a first or last symbol are factored. These one-line rules are drawn inline where they are used: CFUNC_or_Identifier, Label_opt_colon, attrib_assign_list, b_func_types, basic_declarator, c_func_type, change_or_swap, collect_argument_list, cond_body_p2, delete_statement, echo_or_hush, end_dyn, field_type, fmt_type, for_mat_assign_list, for_or_waiting, func_declarator, func_ident, function_or_subroutine, get_getx, heading_type, insert_delims, keyin_or_in, loc_stat, mat_extract, matread_statement, matrix, matrix_assign_list, matwrite_statement, new_line, nobuf_or_flush, nocollect_argument_list, on_from, on_or_to, opt_append, opt_at, opt_b_var_list, opt_by_seq, opt_c_var_list, opt_clearf_fdsc, opt_collect_argument_list, opt_cond_body, opt_do, opt_dummy_then, opt_err_argument_list, opt_existing, opt_gen_resultant, opt_get_length, opt_ident_list, opt_identifier, opt_io_setting, opt_key, opt_mat_arg_list, opt_matbp_setting, opt_next_var, opt_nocollect_argument_list, opt_null_cond_body, opt_null_sw_cond_body, opt_open_fdsc, opt_param, opt_print_on, opt_read_next_or_prev, opt_readonly, opt_readt, opt_remove_at, opt_resultant, opt_returning, opt_sel_list2, opt_select_fdsc, opt_seq, opt_setting, opt_single_line_statements, opt_sleep, opt_sql_type, opt_static_decl, opt_stop_argument_list, opt_sw_locked_clause, opt_sw_onerror_clause, opt_sw_wait_clause, opt_tape_channel, opt_unfiltered, opt_until, opt_waiting, opt_while_until_body, opt_writet, optional_colon, optional_curpos, optional_exec_options, optional_from, optional_input_mask, optional_input_with, optional_pause, optional_prints, optional_sleep, optional_step, program_label, readv_statement, recordlock_statement, rp, rsq, send_sendx, sql_prefix, sselect_or_sselectn_or_sselectv, stat_sep, substring_assign_list, sw_cond_body_p2, to_or_with, writeseq_type, writev_statement. The diagrams describe the token stream after jpp and the lexer, so ambiguity that the yacc precedence declarations resolve is not shown; see the table below.

program

section
program ::= section
Used by: start symbol
yacc source
program
    : section
    ;

statement

@a variable or other nameIdentifier=resultanttoken PROGRAMPROGRAMa statement labelLabela variable or other nameIdentifieropening parenthesis of a matrix assignment(st_parameter_list)ident_assignmentsPP++MM--token COLLECTDATACOLLECTDATAident_optionsmat_statementtoken JAC_MATMATa variable or other nameIdentifierresultantcase_structuretoken CONTINUECONTINUEtoken DEFBDEFBa variable or other nameIdentifier()token DEFCDEFCtoken DEFCPPDEFCPPtoken DEFCEDEFCEtoken STATICSTATICc_func_typesa variable or other nameIdentifiera name declared earlier with DEFCCFUNC(c_var_list)token DECLAREDECLAREtoken FUNCTIONFUNCTIONfuncnametoken SUBROUTINESUB / SUBROUTINEtoken DEFFUNDEFFUNtoken DEFBDEFBa variable or other nameIdentifiera name declared earlier with DEFCCFUNC(b_var_list)token DELDELident_optionsopening bracket of a dynamic array reference in LOCATE or DEL<nocollect_mult_arg_listclosing bracket of a dynamic array reference>a name declared earlier with DEFCCFUNC(nocollect_mult_arg_list)token FILELOCKFILELOCKident_options,resultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statstoken FILEUNLOCKFILEUNLOCKident_optionserror_cond_bodytoken FINDFINDresultanttoken ININresultant,resultanttoken SETTINGRETURNING / SETTINGident_options,ident_options,ident_optionscond_body_p1token ELSEELSEcond_statstoken FINDSTRFINDSTRresultanttoken ININresultant,resultanttoken SETTINGRETURNING / SETTINGident_options,ident_options,ident_optionscond_body_p1token ELSEELSEcond_statstoken FOOTINGFOOTINGopt_onresultanttoken FORFORa variable or other nameIdentifier(st_parameter_list)=resultanttoken TOTOresultanttoken STEPSTEPresultantstatements_and_opt_while_until_bodytoken NEXTNEXTa variable or other nameIdentifier(st_parameter_list)token GROUPSTOREGROUPSTOREresultanttoken ININident_optionstoken USINGUSINGresultant,resultant,resultanttoken HEADINGHEADINGtoken HEADINGEHEADINGEtoken HEADINGNHEADINGNopt_onresultanttoken IFIFresultantcond_body_p1token ELSEELSEcond_statstoken INSINSresultanttoken BEFOREBEFOREident_optionsopening bracket of a dynamic array reference such as REC<2,1><nocollect_mult_arg_listclosing bracket of a dynamic array reference>token LOCATELOCATEresultanttoken ININresultantopt_loc_dyns,resultanttoken BYBYresultanttoken SETTINGRETURNING / SETTINGident_optionsopening parenthesis of a matrix assignment(nocollect_mult_arg_list;ident_options;resultant)cond_body_p1token ELSEELSEcond_statstoken LOOPLOOPsingle_line_statementsstatements_and_opt_while_until_bodytoken REPEATREPEATtoken CLOSECLOSEident_optionserror_cond_body,close_identifier_listtoken OBJEXCBACKOBJEXCALLBACKident_options,ident_optionscond_body_p1token ELSEELSEcond_statstoken OPENOPEN / OPENPATHcollect_mult_arg_listtoken TOTOident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OPENINDEXOPENINDEXresultant,resultanttoken TOTOident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OPENSEQOPENDEV / OPENSEQ / OSOPENtoken EXISTINGEXISTINGtoken APPENDAPPEND / APPENDINGcollect_mult_arg_listtoken READONLYREADONLYtoken TOTOident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OPENSEROPENSERcollect_mult_arg_listtoken TOTOident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken PAUSEPAUSEtoken UNLOCKUNLOCKresultanttoken CREATECREATEresultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken RANDOMIZERANDOMIZE(resultant)token READSEQREADSEQident_options_or_attypetoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OSREADOSREADident_options_or_attypetoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OSBREADOSBREADident_options_or_attypetoken FROMFROMresultanttoken ATATresultanttoken JAC_LENGTHLENGTHresultanttoken SETTINGRETURNING / SETTINGident_optionserror_cond_bodytoken OSBWRITEOSBWRITEresultanttoken ONONtoken TOTOresultanttoken ATATresultanttoken SETTINGRETURNING / SETTINGident_optionserror_cond_bodytoken READBLKREADBLKident_options_or_attypetoken FROMFROMresultant,resultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken WRITEBLKWRITEBLKresultanttoken ONONtoken TOTOresultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken WRITESEQWRITESEQtoken WRITESEQFWRITESEQFresultanttoken APPENDAPPEND / APPENDINGtoken ONONtoken TOTOident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OSWRITEOSWRITEresultanttoken APPENDAPPEND / APPENDINGtoken ONONtoken TOTOresultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken WAKEWAKE3 built-ins: INPUTERR, INPUTNULL, PROMPTFUNC_ARGS1token CHAINCHAINtoken DELETELISTDELETELISTtoken OUTOUTtoken PRECISIONPRECISIONtoken PROCWRITEPROCWRITEtoken RTNDATARTNDATAresultanttoken WEOFSEQWEOFSEQident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statsnull_sw_cond_body_p1token ELSEELSEcond_statstoken CLOSESEQCLOSESEQ / OSCLOSEident_optionserror_cond_bodytoken DELETESEQDELETESEQcollect_mult_arg_listtoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken OSDELETEOSDELETEresultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken READLISTREADLIST / READSELECTident_optionstoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken STATUSSTATUSident_optionstoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken FORMLISTFORMLISTresultantopt_select_totoken SETTINGRETURNING / SETTINGident_optionstoken GETLISTGETLISTresultantopt_select_totoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken READNEXTREADNEXTtoken READPREVREADPREVtoken KEYKEYident_options_or_attype,ident_options,ident_optionstoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statssw_cond_body_p1token ELSEELSEcond_statstoken READTREADTtoken READTXREADTXopt_mtuident_optionstoken ONONtoken FROMFROMresultantcond_body_p1token ELSEELSEcond_statstoken REMOVEREMOVEident_options_or_attypetoken FROMFROMident_options_or_attypetoken ATATident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken REWINDREWINDopt_mtutoken ONONtoken FROMFROMresultantcond_body_p1token ELSEELSEcond_statstoken SELECTSELECT / SELECTN / SELECTVident_optionsopt_select_totoken SETTINGRETURNING / SETTINGident_optionstoken ATKEYATKEYnocollect_mult_arg_listerror_cond_bodytoken SSELECTSSELECTtoken SSELECTNSSELECTNtoken SSELECTVSSELECTVident_optionsopt_select_totoken SETTINGRETURNING / SETTINGident_optionserror_cond_bodytoken SELECTESELECTEopt_select_totoken SETTINGRETURNING / SETTINGident_optionstoken SELECTINDEXSELECTINDEXresultant,resultanttoken FROMFROMident_optionsopt_select_totoken SETTINGRETURNING / SETTINGident_optionstoken ABORTABORTtoken STOPSTOPstop_argument_listtoken ASSIGNEDASSIGNresultanttoken TOTOtoken SYSTEMSYSTEM(resultant)token BREAKBREAKtoken ONONtoken OFFOFFresultanta name declared earlier with DEFFUNBFUNCopt_func_mat_arg_listtoken CALLCCALLC@a name declared earlier with DEFCCFUNCa variable or other nameIdentifieropt_func_mat_arg_listtoken CALLJCALLJresultant,resultant,resultanttoken SETTINGRETURNING / SETTINGa variable or other nameIdentifiertoken ONONtoken ERRORERRORcond_stats1 built-ins: CALLdotNETCALLdotNETresultant,resultant,resultanttoken SETTINGRETURNING / SETTINGa variable or other nameIdentifiertoken ONONtoken ERRORERRORcond_statstoken CALLCALLopening parenthesis of a matrix assignment(mat_argument_list)token CHANGECHANGE / EREPLACEtoken SWAPSWAPresultanttoken TOTOtoken WITHWITHresultanttoken ININident_optionsopt_dynstoken CLEARCLEARtoken CLEARCOMMONCLEARCOMMONopt_namedcommon_nametoken CLEARDATACLEARDATAtoken CLEARFILECLEARFILEident_optionstoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statstoken CLEARSELECTCLEARSELECTtoken ALLALLopt_sel_list1token COMMONCOM / COMMONopt_common_namecommon_identifier_listtoken CONVERTCONVERTresultanttoken TOTOresultanttoken ININident_optionsopt_dynstoken CRTCRT / DISPLAYmultiple_print_argtoken DATADATAcollect_mult_arg_listtoken JAC_DEBUGDEBUGtoken DELETEDELETEtoken DELETEUDELETEUnocollect_mult_arg_listtoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statstoken DIMDIM / DIMENSIONdimvar_listtoken ENTERENTERtoken EXECEXECtoken SQLSQLsql_statsexec_perfresultantoptional_exec_stufftoken EXITEXIT(resultant)token GETGET(token JAC_ARGARG.,resultant)ident_optionsnull_cond_body_p1token ELSEELSEcond_statstoken JAC_MSGMSG.,resultant)ident_optionscond_body_p1token ELSEELSEcond_statstoken GETGETtoken GETXGETXident_options,resultanttoken SETTINGRETURNING / SETTINGident_optionstoken FROMFROMresultanttoken UNTILUNTILresultanttoken SETTINGRETURNING / SETTINGident_optionstoken WAITINGWAITINGresultantcond_body_p1token ELSEELSEcond_statstoken SENDSENDtoken SENDXSENDXresultanttoken TOTOresultantcond_body_p1token ELSEELSEcond_statstoken GOSUBGOSUBa statement labelLabel:token GOTOGO / GOTOa statement labelLabel:token ININident_options_or_attypeoptional_timetoken INPUTINPUTcursorpos:ident_options_or_attypeoptional_input_limitoptional_input_colontoken WITHWITHresultanta number or a string literalConstantoptional_timetoken TATAtoken CLEARCLEARtoken INPUTCLEARCLEARINPUT / INPUTCLEARtoken JAC_ECHOECHOtoken JAC_HUSHHUSHtoken ONONtoken OFFOFFresultanttoken JAC_NULLGARBAGECOLLECT / NULLtoken LOCKLOCKresultantnull_cond_body_p1token ELSEELSEcond_statstoken MATBUILDMATBUILDident_optionstoken FROMFROMident_optionsopt_matbp_start_endopt_matbp_delimitertoken MATPARSEMATPARSEident_optionsopt_matbp_start_endtoken FROMFROMresultantopt_matbp_delimitertoken SETTINGRETURNING / SETTINGident_optionstoken MATREADMATREADtoken MATREADUMATREADUtoken MATREADLMATREADLident_optionstoken FROMFROMfile_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken MATWRITEMATWRITEtoken MATWRITEUMATWRITEUident_optionstoken ONONtoken TOTOfile_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statstoken NOBUFNOBUFtoken FLUSHFLUSHresultanttoken SETTINGRETURNING / SETTINGident_optionsnull_cond_body_p1token ELSEELSEcond_statstoken ONONresultanttoken GOSUBGOSUBgosub_label_listtoken GOTOGO / GOTOgoto_label_listtoken INPUTTRAPINPUTTRAPresultanttoken GOSUBGOSUBgosub_label_listtoken GOTOGO / GOTOgoto_label_listtoken PAGEPAGEopt_onresultanttoken PRINTPRINTtoken ONONsimple_print_expressionmultiple_print_argtoken PRINTERRPRINTERRresultanttoken FROMFROMresultanttoken PRINTERPRINTERptr_on_off_reset_closeopt_ontoken PROCREADPROCREADident_optionscond_body_p1token ELSEELSEcond_statstoken RECORDLOCKURECORDLOCKUtoken RECORDLOCKLRECORDLOCKLfile_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statsread_statementident_options_or_attypetoken FROMFROMfile_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken WAITINGWAITINGresultanttoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken READVREADVtoken READVUREADVUtoken READVLREADVLident_options_or_attypetoken FROMFROMattr_file_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statssw_cond_body_p1token ELSEELSEcond_statstoken RELEASERELEASEnocollect_mult_arg_listerror_cond_bodytoken RETURNRETURNtoken TOTOa statement labelLabel:resultant(resultant)token SEEKSEEKresultant,resultant,resultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken SUBROUTINESUB / SUBROUTINEtoken FUNCTIONFUNCTION(ident_list)token TRANSABORTTRANSABORTcollect_mult_arg_listcond_body_p1token ELSEELSEcond_statstoken TRANSTARTTRANSTARTsync_resultantcond_body_p1token ELSEELSEcond_statstoken TRANSENDTRANSENDcollect_mult_arg_listcond_body_p1token ELSEELSEcond_statstoken TTYCTLTTYCTLresultant,resultanttoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken TTYGETTTYGETident_optionstoken FROMFROMfilevar_or_lptr_or_mtutoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken TTYSETTTYSETresultanttoken ONONfilevar_or_lptr_or_mtutoken SETTINGRETURNING / SETTINGident_optionscond_body_p1token ELSEELSEcond_statstoken TIMEOUTTIMEOUTresultant,resultanttoken JAC_WEOFWEOFopt_mtutoken ONONtoken FROMFROMresultantcond_body_p1token ELSEELSEcond_statswrite_statementresultanttoken ONONtoken TOTOfile_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_statstoken WRITELISTWRITELISTresultanttoken ONONtoken TOTOresultanttoken SETTINGRETURNING / SETTINGident_optionserror_cond_bodytoken WRITETWRITETtoken WRITETXWRITETXopt_mturesultanttoken ONONtoken FROMFROMresultantcond_body_p1token ELSEELSEcond_statstoken WRITEVWRITEVtoken WRITEVUWRITEVUresultanttoken ONONtoken TOTOattr_file_specifiertoken SETTINGRETURNING / SETTINGident_optionstoken ONONtoken ERRORERRORcond_statstoken LOCKEDLOCKEDcond_stats
statement
    ::= '@' Identifier '=' resultant
     | 'PROGRAM'
     | Label
     | Identifier ( '(' st_parameter_list ')' )? ident_assignments
     | ( '++' | '--' | 'COLLECTDATA' ) ident_options
     | mat_statement ( 'MAT' Identifier | resultant )
     | case_structure
     | 'CONTINUE'
     | 'DEFB' Identifier '(' ')'
     | ( 'DEFC' | 'DEFCPP' | 'DEFCE' ) 'STATIC'? c_func_types? ( Identifier | CFUNC ) '(' c_var_list? ')'
     | 'DECLARE' ( 'FUNCTION' funcname | ( 'SUB' | 'SUBROUTINE' ) )
     | ( 'DEFFUN' | 'DEFB' ) ( Identifier | CFUNC ) '(' b_var_list? ')'
     | 'DEL' ident_options '<' nocollect_mult_arg_list? '>'
     | CFUNC '(' nocollect_mult_arg_list? ')'
     | 'FILELOCK' ident_options? ( ',' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | 'FILEUNLOCK' ident_options? error_cond_body?
     | 'FIND' resultant 'IN' resultant ( ',' resultant )? ( 'RETURNING' | 'SETTING' ) ident_options ( ',' ident_options )? ( ',' ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'FINDSTR' resultant 'IN' resultant ( ',' resultant )? ( 'RETURNING' | 'SETTING' ) ident_options ( ',' ident_options )? ( ',' ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'FOOTING' opt_on resultant
     | 'FOR' Identifier ( '(' st_parameter_list ')' )? '=' resultant 'TO' resultant ( 'STEP' resultant )? statements_and_opt_while_until_body 'NEXT' ( Identifier ( '(' st_parameter_list ')' )? )?
     | 'GROUPSTORE' resultant 'IN' ident_options 'USING' resultant ',' resultant ( ',' resultant )?
     | ( 'HEADING' | 'HEADINGE' | 'HEADINGN' ) opt_on resultant
     | 'IF' resultant cond_body_p1 ( 'ELSE' cond_stats )?
     | 'INS' resultant 'BEFORE' ident_options '<' nocollect_mult_arg_list? '>'
     | 'LOCATE' ( resultant 'IN' resultant opt_loc_dyns ( ',' resultant )? ( 'BY' resultant )? ( 'RETURNING' | 'SETTING' ) ident_options
      | '(' nocollect_mult_arg_list? ';' ident_options ( ';' resultant )? ')'
      ) cond_body_p1 ( 'ELSE' cond_stats )?
     | 'LOOP' single_line_statements? statements_and_opt_while_until_body 'REPEAT'
     | 'CLOSE' ident_options ( error_cond_body | ',' close_identifier_list )?
     | 'OBJEXCALLBACK' ident_options ',' ident_options cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'OPEN' | 'OPENPATH' ) collect_mult_arg_list? ( 'TO' ident_options )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OPENINDEX' resultant ',' resultant 'TO' ident_options ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'OPENDEV' | 'OPENSEQ' | 'OSOPEN' ) 'EXISTING'? ( 'APPEND' | 'APPENDING' )? collect_mult_arg_list? 'READONLY'? 'TO' ident_options ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OPENSER' collect_mult_arg_list? 'TO' ident_options ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'PAUSE' | 'UNLOCK' ) resultant?
     | 'CREATE' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'RANDOMIZE' ( '(' resultant? ')' )?
     | 'READSEQ' ident_options_or_attype 'FROM' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OSREAD' ident_options_or_attype 'FROM' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OSBREAD' ident_options_or_attype 'FROM' resultant 'AT' resultant 'LENGTH' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? error_cond_body?
     | 'OSBWRITE' resultant ( 'ON' | 'TO' ) resultant 'AT' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? error_cond_body?
     | 'READBLK' ident_options_or_attype 'FROM' resultant ',' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'WRITEBLK' resultant ( 'ON' | 'TO' ) resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'WRITESEQ' | 'WRITESEQF' ) resultant ( 'APPEND' | 'APPENDING' )? ( 'ON' | 'TO' ) ident_options ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OSWRITE' resultant ( 'APPEND' | 'APPENDING' )? ( 'ON' | 'TO' ) resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )?
     | ( 'WAKE' | FUNC_ARGS1 | 'CHAIN' | 'DELETELIST' | 'OUT' | 'PRECISION' | 'PROCWRITE' | 'RTNDATA' ) resultant
     | 'WEOFSEQ' ident_options ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( null_sw_cond_body_p1 ( 'ELSE' cond_stats )? )?
     | ( 'CLOSESEQ' | 'OSCLOSE' ) ident_options error_cond_body?
     | 'DELETESEQ' collect_mult_arg_list? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'OSDELETE' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )?
     | ( 'READLIST' | 'READSELECT' ) ident_options ( 'FROM' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'STATUS' ident_options 'FROM' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'FORMLIST' resultant opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )?
     | 'GETLIST' resultant opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'READNEXT' | 'READPREV' ) 'KEY'? ident_options_or_attype ( ',' ident_options )? ( ',' ident_options )? ( 'FROM' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'READT' | 'READTX' ) opt_mtu ident_options ( ( 'ON' | 'FROM' ) resultant )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'REMOVE' ident_options_or_attype 'FROM' ident_options_or_attype ( 'AT' ident_options )? ( 'RETURNING' | 'SETTING' ) ident_options
     | 'REWIND' opt_mtu ( ( 'ON' | 'FROM' ) resultant )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'SELECT' | 'SELECTN' | 'SELECTV' ) ident_options? opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ATKEY' nocollect_mult_arg_list? )? error_cond_body?
     | ( 'SSELECT' | 'SSELECTN' | 'SSELECTV' ) ident_options? opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )? error_cond_body?
     | 'SELECTE' opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )?
     | 'SELECTINDEX' resultant ( ',' resultant )? 'FROM' ident_options opt_select_to ( ( 'RETURNING' | 'SETTING' ) ident_options )?
     | ( 'ABORT' | 'STOP' ) stop_argument_list?
     | 'ASSIGN' resultant 'TO' 'SYSTEM' '(' resultant ')'
     | 'BREAK' ( 'ON' | 'OFF' | resultant )?
     | BFUNC opt_func_mat_arg_list
     | 'CALLC' '@'? ( CFUNC | Identifier ) opt_func_mat_arg_list
     | 'CALLJ' resultant ',' resultant ',' resultant ( 'RETURNING' | 'SETTING' ) Identifier ( 'ON' 'ERROR' cond_stats )?
     | CALLdotNET resultant ',' resultant ',' resultant ( 'RETURNING' | 'SETTING' ) Identifier ( 'ON' 'ERROR' cond_stats )?
     | 'CALL' ( '(' mat_argument_list ')' )?
     | ( ( 'CHANGE' | 'EREPLACE' ) | 'SWAP' ) resultant ( 'TO' | 'WITH' ) resultant 'IN' ident_options opt_dyns
     | 'CLEAR'
     | 'CLEARCOMMON' opt_namedcommon_name
     | 'CLEARDATA'
     | 'CLEARFILE' ident_options? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | 'CLEARSELECT' ( 'ALL' | opt_sel_list1 )
     | ( 'COM' | 'COMMON' ) opt_common_name common_identifier_list
     | 'CONVERT' resultant 'TO' resultant 'IN' ident_options opt_dyns
     | ( 'CRT' | 'DISPLAY' ) multiple_print_arg?
     | 'DATA' collect_mult_arg_list?
     | 'DEBUG'
     | ( 'DELETE' | 'DELETEU' ) nocollect_mult_arg_list? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | ( 'DIM' | 'DIMENSION' ) dimvar_list
     | 'ENTER'
     | 'EXEC' 'SQL' sql_stats
     | exec_perf resultant optional_exec_stuff?
     | 'EXIT' ( '(' resultant ')' )?
     | 'GET' '(' ( 'ARG.' ( ',' resultant )? ')' ident_options ( null_cond_body_p1 ( 'ELSE' cond_stats )? )?
      | 'MSG.' ( ',' resultant )? ')' ident_options cond_body_p1 ( 'ELSE' cond_stats )?
      )
     | ( 'GET' | 'GETX' ) ident_options ( ',' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? 'FROM' resultant ( 'UNTIL' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'WAITING' resultant )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'SEND' | 'SENDX' ) resultant 'TO' resultant cond_body_p1 ( 'ELSE' cond_stats )?
     | 'GOSUB' Label ':'?
     | ( 'GO' | 'GOTO' ) Label ':'?
     | 'IN' ident_options_or_attype optional_time
     | 'INPUT' ( cursorpos ':'? )? ident_options_or_attype optional_input_limit optional_input_colon ( 'WITH' resultant )? Constant? optional_time
     | 'TA' 'CLEAR'
     | ( 'CLEARINPUT' | 'INPUTCLEAR' )
     | ( 'ECHO' | 'HUSH' ) ( 'ON' | 'OFF' | resultant )
     | ( 'GARBAGECOLLECT' | 'NULL' )
     | 'LOCK' resultant ( null_cond_body_p1 ( 'ELSE' cond_stats )? )?
     | 'MATBUILD' ident_options 'FROM' ident_options opt_matbp_start_end opt_matbp_delimiter
     | 'MATPARSE' ident_options opt_matbp_start_end 'FROM' resultant opt_matbp_delimiter ( ( 'RETURNING' | 'SETTING' ) ident_options )?
     | ( 'MATREAD' | 'MATREADU' | 'MATREADL' ) ident_options 'FROM' file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'MATWRITE' | 'MATWRITEU' ) ident_options ( 'ON' | 'TO' ) file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | ( 'NOBUF' | 'FLUSH' ) resultant? ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( null_cond_body_p1 ( 'ELSE' cond_stats )? )?
     | 'ON' resultant ( 'GOSUB' gosub_label_list | ( 'GO' | 'GOTO' ) goto_label_list )
     | 'INPUTTRAP' resultant ( 'GOSUB' gosub_label_list | ( 'GO' | 'GOTO' ) goto_label_list )
     | 'PAGE' opt_on resultant?
     | 'PRINT' ( 'ON' simple_print_expression )? multiple_print_arg?
     | 'PRINTERR' resultant ( 'FROM' resultant )?
     | 'PRINTER' ptr_on_off_reset_close opt_on
     | 'PROCREAD' ident_options cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'RECORDLOCKU' | 'RECORDLOCKL' ) file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | read_statement ident_options_or_attype 'FROM' file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'WAITING' resultant )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'READV' | 'READVU' | 'READVL' ) ident_options_or_attype 'FROM' attr_file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )? sw_cond_body_p1 ( 'ELSE' cond_stats )?
     | 'RELEASE' nocollect_mult_arg_list? error_cond_body?
     | 'RETURN' ( 'TO' Label ':'? | resultant | '(' resultant? ')' )?
     | 'SEEK' resultant ( ',' resultant )? ( ',' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( ( 'SUB' | 'SUBROUTINE' ) | 'FUNCTION' ) ( '(' ident_list ')' )?
     | 'TRANSABORT' collect_mult_arg_list? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TRANSTART' sync_resultant cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TRANSEND' collect_mult_arg_list? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TTYCTL' resultant ',' resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TTYGET' ident_options 'FROM' filevar_or_lptr_or_mtu ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TTYSET' resultant 'ON' filevar_or_lptr_or_mtu ( ( 'RETURNING' | 'SETTING' ) ident_options )? cond_body_p1 ( 'ELSE' cond_stats )?
     | 'TIMEOUT' resultant ',' resultant
     | 'WEOF' opt_mtu ( ( 'ON' | 'FROM' ) resultant )? cond_body_p1 ( 'ELSE' cond_stats )?
     | write_statement resultant ( 'ON' | 'TO' ) file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
     | 'WRITELIST' resultant ( 'ON' | 'TO' ) resultant ( ( 'RETURNING' | 'SETTING' ) ident_options )? error_cond_body?
     | ( 'WRITET' | 'WRITETX' ) opt_mtu resultant ( ( 'ON' | 'FROM' ) resultant )? cond_body_p1 ( 'ELSE' cond_stats )?
     | ( 'WRITEV' | 'WRITEVU' ) resultant ( 'ON' | 'TO' ) attr_file_specifier ( ( 'RETURNING' | 'SETTING' ) ident_options )? ( 'ON' 'ERROR' cond_stats )? ( 'LOCKED' cond_stats )?
Used by: single_line_statements, statements
yacc source
statement
    : '@' Identifier {} '=' {} resultant
    | PROGRAM
    | program_label
    | Identifier {} matrix_assign_list ident_assignments
    | PP ident_options
    | MM ident_options
    | mat_statement JAC_MAT Identifier
    | mat_statement resultant
    | case_structure
    | CONTINUE
    | DEFB Identifier '(' {} ')'
    | func_declarator opt_static_decl c_func_type func_ident '(' {} opt_c_var_list ')'
    | DECLARE FUNCTION funcname
    | DECLARE SUBROUTINE
    | basic_declarator func_ident {} '(' {} opt_b_var_list ')'
    | DEL {} ident_options LOC_SDYN {} nocollect_argument_list end_dyn
    | CFUNC '(' {} opt_nocollect_argument_list ')'
    | FILELOCK opt_select_fdsc opt_param opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | FILEUNLOCK opt_select_fdsc {} opt_cond_body
    | FIND {} resultant IN resultant opt_param SETTING ident_options opt_identifier opt_identifier {} cond_body_p1 cond_body_p2
    | FINDSTR {} resultant IN resultant opt_param SETTING ident_options opt_identifier opt_identifier {} cond_body_p1 cond_body_p2
    | FOOTING opt_on resultant
    | FOR Identifier {} for_mat_assign_list '=' {} resultant TO resultant optional_step {} statements_and_opt_while_until_body NEXT opt_next_var
    | GROUPSTORE resultant IN ident_options USING resultant ',' resultant opt_param
    | heading_type opt_on resultant
    | IF resultant {} cond_body_p1 cond_body_p2
    | INS resultant BEFORE ident_options SDYN {} nocollect_argument_list end_dyn
    | loc_stat {} resultant IN {} resultant opt_loc_dyns {} opt_param opt_by_seq SETTING ident_options {} cond_body_p1 cond_body_p2
    | loc_stat LP {} nocollect_argument_list ';' ident_options opt_seq rp {} cond_body_p1 cond_body_p2
    | LOOP {} opt_single_line_statements statements_and_opt_while_until_body REPEAT
    | CLOSE ident_options {} opt_cond_body
    | CLOSE ident_options ',' {} close_identifier_list
    | OBJEXCBACK ident_options ',' ident_options {} cond_body_p1 cond_body_p2
    | OPEN {} collect_argument_list {} opt_open_fdsc opt_io_setting {} opt_sw_onerror_clause sw_cond_body_p1 sw_cond_body_p2
    | OPENINDEX resultant ',' resultant TO ident_options opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | OPENSEQ opt_existing opt_append {} collect_argument_list {} opt_readonly TO ident_options opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | OPENSER {} collect_argument_list {} TO ident_options opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | PAUSE optional_pause
    | CREATE resultant opt_io_setting {} cond_body_p1 cond_body_p2
    | RANDOMIZE
    | RANDOMIZE '(' rp
    | RANDOMIZE '(' resultant rp
    | READSEQ ident_options_or_attype FROM resultant opt_io_setting {} opt_sw_onerror_clause sw_cond_body_p1 sw_cond_body_p2
    | OSREAD ident_options_or_attype FROM resultant opt_io_setting {} opt_sw_onerror_clause sw_cond_body_p1 sw_cond_body_p2
    | OSBREAD ident_options_or_attype FROM resultant {} AT resultant JAC_LENGTH resultant opt_io_setting {} opt_cond_body
    | OSBWRITE resultant on_or_to resultant AT resultant opt_io_setting {} opt_cond_body
    | READBLK ident_options_or_attype FROM resultant ',' resultant opt_io_setting {} cond_body_p1 cond_body_p2
    | WRITEBLK resultant on_or_to resultant opt_io_setting {} cond_body_p1 cond_body_p2
    | writeseq_type resultant opt_append on_or_to ident_options opt_io_setting {} opt_sw_onerror_clause sw_cond_body_p1 sw_cond_body_p2
    | OSWRITE resultant opt_append on_or_to resultant opt_io_setting {} opt_sw_onerror_clause
    | WAKE resultant
    | WEOFSEQ ident_options opt_io_setting {} opt_sw_onerror_clause opt_null_sw_cond_body
    | CLOSESEQ ident_options {} opt_cond_body
    | DELETESEQ {} collect_argument_list {} opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | OSDELETE resultant opt_io_setting {} opt_sw_onerror_clause
    | READLIST ident_options optional_from opt_matbp_setting {} cond_body_p1 cond_body_p2
    | STATUS ident_options FROM resultant opt_io_setting {} cond_body_p1 cond_body_p2
    | FORMLIST resultant opt_select_to opt_setting
    | GETLIST resultant opt_select_to opt_matbp_setting {} cond_body_p1 cond_body_p2
    | opt_read_next_or_prev opt_key ident_options_or_attype opt_identifier opt_identifier optional_from opt_io_setting {} opt_sw_onerror_clause sw_cond_body_p1 sw_cond_body_p2
    | opt_readt opt_mtu ident_options opt_tape_channel {} cond_body_p1 cond_body_p2
    | REMOVE ident_options_or_attype FROM ident_options_or_attype opt_remove_at SETTING ident_options
    | REWIND opt_mtu opt_tape_channel {} cond_body_p1 cond_body_p2
    | SELECT opt_select_fdsc opt_select_to opt_setting {} opt_cond_body
    | SELECT opt_select_fdsc opt_select_to opt_setting ATKEY {} nocollect_argument_list {} opt_cond_body
    | sselect_or_sselectn_or_sselectv opt_select_fdsc opt_select_to opt_setting {} opt_cond_body
    | SELECTE opt_select_to opt_setting
    | SELECTINDEX resultant opt_param FROM ident_options opt_select_to opt_setting
    | opt_sleep optional_sleep
    | FUNC_ARGS1 resultant
    | ABORT {} opt_stop_argument_list
    | ASSIGNED resultant TO SYSTEM '(' resultant rp
    | BREAK
    | BREAK ON
    | BREAK OFF
    | BREAK resultant
    | BFUNC {} opt_func_mat_arg_list
    | CALLC opt_at CFUNC_or_Identifier {} opt_func_mat_arg_list
    | CALLJ resultant ',' resultant ',' resultant {} SETTING Identifier {} opt_sw_onerror_clause
    | CALLdotNET resultant ',' resultant ',' resultant {} SETTING Identifier {} opt_sw_onerror_clause
    | CALL {} opt_mat_arg_list
    | CHAIN resultant
    | change_or_swap resultant to_or_with resultant IN ident_options opt_dyns
    | CLEAR
    | CLEARCOMMON {} opt_namedcommon_name
    | CLEARDATA
    | CLEARFILE opt_clearf_fdsc opt_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | CLEARSELECT ALL
    | CLEARSELECT opt_sel_list1
    | COMMON {} opt_common_name common_identifier_list
    | CONVERT resultant TO resultant IN ident_options opt_dyns
    | CRT {} optional_prints
    | DATA {} collect_argument_list
    | JAC_DEBUG
    | DELETELIST resultant
    | delete_statement {} nocollect_argument_list opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | DIM {} dimvar_list
    | ENTER
    | sql_prefix sql_stats
    | exec_perf resultant {} optional_exec_options
    | EXIT
    | EXIT '(' resultant ')'
    | GET '(' JAC_ARG opt_param ')' ident_options {} opt_null_cond_body
    | GET '(' JAC_MSG opt_param ')' ident_options {} cond_body_p1 cond_body_p2
    | get_getx ident_options opt_get_length opt_setting FROM resultant opt_until opt_returning opt_waiting {} cond_body_p1 cond_body_p2
    | send_sendx {} resultant TO {} resultant {} cond_body_p1 cond_body_p2
    | GOSUB {} Label_opt_colon
    | GOTO {} Label_opt_colon
    | IN ident_options_or_attype {} optional_time
    | INPUT optional_curpos ident_options_or_attype {} optional_input_limit optional_input_colon optional_input_with optional_input_mask {} optional_time
    | TA CLEAR
    | INPUTCLEAR
    | echo_or_hush ON
    | echo_or_hush OFF
    | echo_or_hush resultant
    | JAC_NULL
    | LOCK resultant {} opt_null_cond_body
    | MATBUILD ident_options FROM {} ident_options {} opt_matbp_start_end opt_matbp_delimiter
    | MATPARSE {} ident_options {} opt_matbp_start_end FROM resultant opt_matbp_delimiter opt_matbp_setting
    | matread_statement {} ident_options {} FROM file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | matwrite_statement {} ident_options {} on_or_to file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | nobuf_or_flush opt_resultant opt_io_setting {} opt_null_cond_body
    | ON resultant GOSUB {} gosub_label_list
    | ON resultant GOTO {} goto_label_list
    | INPUTTRAP resultant GOSUB {} gosub_label_list
    | INPUTTRAP resultant GOTO {} goto_label_list
    | OUT resultant
    | PAGE opt_on opt_gen_resultant
    | PRECISION resultant
    | PRINT {} opt_print_on optional_prints
    | PRINTERR resultant optional_from
    | PRINTER ptr_on_off_reset_close opt_on
    | PROCREAD ident_options {} cond_body_p1 cond_body_p2
    | PROCWRITE resultant
    | recordlock_statement file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | read_statement ident_options_or_attype FROM file_specifier opt_io_setting opt_sw_wait_clause {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | readv_statement ident_options_or_attype FROM attr_file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause sw_cond_body_p1 sw_cond_body_p2
    | RELEASE {} opt_nocollect_argument_list {} opt_cond_body
    | RETURN
    | RETURN TO {} Label_opt_colon
    | RETURN resultant
    | RETURN '(' opt_resultant rp
    | STOP {} opt_stop_argument_list
    | SEEK resultant opt_param opt_param opt_io_setting {} cond_body_p1 cond_body_p2
    | function_or_subroutine {} opt_ident_list
    | TRANSABORT {} opt_collect_argument_list {} cond_body_p1 cond_body_p2
    | TRANSTART sync_resultant {} cond_body_p1 cond_body_p2
    | TRANSEND {} opt_collect_argument_list {} cond_body_p1 cond_body_p2
    | TTYCTL resultant ',' resultant opt_io_setting {} cond_body_p1 cond_body_p2
    | TTYGET ident_options {} FROM filevar_or_lptr_or_mtu opt_io_setting {} cond_body_p1 cond_body_p2
    | TTYSET resultant {} ON filevar_or_lptr_or_mtu opt_io_setting {} cond_body_p1 cond_body_p2
    | TIMEOUT resultant ',' resultant
    | UNLOCK
    | UNLOCK resultant
    | JAC_WEOF opt_mtu opt_tape_channel {} cond_body_p1 cond_body_p2
    | write_statement resultant on_or_to file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | WRITELIST resultant on_or_to resultant opt_io_setting {} opt_cond_body
    | opt_writet opt_mtu resultant opt_tape_channel {} cond_body_p1 cond_body_p2
    | writev_statement resultant on_or_to attr_file_specifier opt_io_setting {} opt_sw_onerror_clause opt_sw_locked_clause
    | RTNDATA resultant
    | COLLECTDATA ident_options
    ;

resultant

Starts with one of:

@a variable or other nameIdentifiertoken DATADATAtoken SENTENCESENTENCE8 built-ins: COL1, COL2, DATE, TIME, TIMEDATE, TIMESTAMP, TRANSQUERY, UNIQUEKEYFUNC_PARM0-+resultantcursorpostoken BITLOADBITLOAD(nocollect_mult_arg_list)token CALLCCALLC@a name declared earlier with DEFCCFUNCa variable or other nameIdentifieropt_func_mat_arg_lista name declared earlier with DEFFUNBFUNCopt_func_mat_arg_lista name declared earlier with DEFCCFUNC(nocollect_mult_arg_list)token CHANGECHANGE / EREPLACEtoken SWAPSWAP(nocollect_mult_arg_list)token KEYINKEYINtoken ININ()token CHARCHAR(resultant)token COMPARECOMPARE(nocollect_mult_arg_list)token CONTROLCHARCONTROLCHAR(nocollect_mult_arg_list)token CONVERTCONVERT(nocollect_mult_arg_list)token DELETEDELETE(nocollect_mult_arg_list)token GETENVGETENV(resultant,ident_options)token EXTRACTEXTRACT(nocollect_mult_arg_list)token CRCCRC(nocollect_mult_arg_list)token DROUNDDROUND(resultant,resultant)token FFIXFFIX(resultant,resultant)token FIELDFIELDtoken FIELDSFIELDS(nocollect_mult_arg_list)token TATA(resultant)84 built-ins: ABS, ABSS, ACOS, ALPHA, ASCII, ASIN, ASSIGNED, ATAN, BITCHANGE, BITCHECK, BITNOT, BITRESET, BITSET, BYTELEN, CALLONEXIT, CHARS, CHDIR, CHECKSUM, COS, DELENV, DIR, DOWNCASE, DQUOTE, DTX, EBCDIC, EXP, FFLT, GETUSERGROUP, GETUSERNAME, ISALNUM, ISALPHA, ISCNTRL, ISDIGIT, ISGRAPH, ISLOWER, ISPRINT, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT, ITYPE, LATIN1, LEN, LENDP, LENS, LENSDP, LN, LOWCASE, LOWER, MAXIMUM, MINIMUM, NEG, NEGS, NOT, NOTS, NUM, NUMS, PUTENV, QUOTE, RAISE, REUSE, RND, SEQ, SEQS, SIN, SORT, SOUNDEX, SPACE, SPACES, SQRT, SQUOTE, SUM, SUMMATION, TAN, TRANSSYNC, TRIMB, TRIMBS, TRIMF, TRIMFS, TRIMS, UNASSIGNED, UPCASE, UTF8, XTDFUNC_PARM1(resultant)46 built-ins: ADDS, ANDS, BITAND, BITOR, BITXOR, CATS, CHANGETIMESTAMP, COUNT, COUNTS, DCOUNT, DIV, DIVS, EQS, FADD, FCMP, FDIV, FILEINFO, FMUL, FOLD, FSUB, GES, GTS, ICONV, ICONVS, JBASECOREDUMP, LEFT, LES, LOCALDATE, LOCALTIME, LTS, MOD, MODS, MULS, NES, OCONV, OCONVS, ORS, PWR, RECORDLOCKED, REGEXP, REM, RIGHT, SCMP, STR, STRS, SUBSFUNC_PARM2(resultant,resultant)10 built-ins: DECRYPT, ENCRYPT, IFS, INDEX, IOCTL, MAKETIMESTAMP, MATCHFIELD, SPLICE, SUBSTRINGS, TIMEDIFFFUNC_PARM3(nocollect_mult_arg_list)8 built-ins: COL1, COL2, DATE, TIME, TIMEDATE, TIMESTAMP, TRANSQUERY, UNIQUEKEYFUNC_PARM0()token SELECTINFOSELECTINFO(nocollect_mult_arg_list)token ERRTEXTERRTEXT(resultant,stop_argument_list)token GETCWDGETCWD(ident_options)token GROUPGROUP(nocollect_mult_arg_list)token INDICESINDICES(ident_options,resultant)token INMATINMAT(nocollect_mult_arg_list)token INSERTINSERT(nocollect_mult_arg_list;resultant)token JAC_INTINT(resultant)token JQLCOMPILEJQLCOMPILE(resultant,resultant,resultant,ident_options)token JQLGETPROPERTYJQLGETPROPERTY(ident_options,ident_options,resultant,resultant)token JQLPUTPROPERTYJQLPUTPROPERTY(resultant,ident_options,resultant,resultant)token JQLEXECUTEJQLEXECUTE(ident_options,ident_options)token JQLFETCHJQLFETCH(ident_options,ident_options,ident_options)xml_type(resultant,resultant,ident_options)token VALIDATE_PRODUCT_LICENSEVALIDATE_PRODUCT_LICENSE(resultant)token VALIDATE_METRICS_LICENSEVALIDATE_METRICS_LICENSE(resultant)token CONSUME_METRICS_LICENSECONSUME_METRICS_LICENSE(resultant,resultant)token PERRORPERROR(resultant)token READNEXTREADNEXTtoken READPREVREADPREVtoken KEYKEYident_options_or_attype,ident_options,ident_optionstoken FROMFROMresultanttoken SETTINGRETURNING / SETTINGident_optionstoken REPLACEREPLACE(nocollect_mult_arg_list;resultant)opt_str_math(nocollect_mult_arg_list)token SENTENCESENTENCE(resultant)token SPOOLERSPOOLER(nocollect_mult_arg_list)token SYSTEMSYSTEM(resultant)token TRANSTRANS / XLATE(nocollect_mult_arg_list)token TRIMTRIM(nocollect_mult_arg_list)dynamic_referencetoken FMTFMTtoken FMTSFMTS(resultant,resultant)token STATUSSTATUS()token REMOVEREMOVE(resultant,ident_options)PP++MM--ident_optionspost_ident_expressionsa number or a string literalConstant(resultant)token IFIFresultanttoken THENTHENresultanttoken ELSEELSEresultant

Then any number of:

+^-/*comparison: =, EQ=comparison: <, LT<comparison: >=, =>, GE>=comparison: <=, =<, LE<=comparison: #, <>, ><, NE#token ANDANDtoken ORORtoken MATCHESMATCH / MATCHESresultant:resultant[resultant,resultant,resultant]comparison: >, GT>comparison: =, EQ=resultantformat_options
resultant
    ::= ( '@' ( Identifier | 'DATA' | 'SENTENCE' | FUNC_PARM0 )
    | ( '-' | '+' ) resultant
    | cursorpos
    | 'BITLOAD' '(' nocollect_mult_arg_list? ')'
    | 'CALLC' '@'? ( CFUNC | Identifier ) opt_func_mat_arg_list
    | BFUNC opt_func_mat_arg_list
    | CFUNC '(' nocollect_mult_arg_list? ')'
    | ( ( 'CHANGE' | 'EREPLACE' ) | 'SWAP' ) '(' nocollect_mult_arg_list? ')'
    | ( 'KEYIN' | 'IN' ) '(' ')'
    | 'CHAR' '(' resultant ')'
    | 'COMPARE' '(' nocollect_mult_arg_list? ')'
    | 'CONTROLCHAR' '(' nocollect_mult_arg_list? ')'
    | 'CONVERT' '(' nocollect_mult_arg_list? ')'
    | 'DELETE' '(' nocollect_mult_arg_list? ')'
    | 'GETENV' '(' resultant ( ',' ident_options )? ')'
    | 'EXTRACT' '(' nocollect_mult_arg_list? ')'
    | 'CRC' '(' nocollect_mult_arg_list? ')'
    | 'DROUND' '(' resultant ( ',' resultant )? ')'
    | 'FFIX' '(' resultant ( ',' resultant )? ')'
    | ( 'FIELD' | 'FIELDS' ) '(' nocollect_mult_arg_list? ')'
    | 'TA' '(' resultant ')'
    | FUNC_PARM1 '(' resultant ')'
    | FUNC_PARM2 '(' resultant ',' resultant ')'
    | FUNC_PARM3 '(' nocollect_mult_arg_list? ')'
    | FUNC_PARM0 '(' ')'
    | 'SELECTINFO' '(' nocollect_mult_arg_list? ')'
    | 'ERRTEXT' '(' resultant ( ',' stop_argument_list )? ')'
    | 'GETCWD' '(' ident_options ')'
    | 'GROUP' '(' nocollect_mult_arg_list? ')'
    | 'INDICES' '(' ident_options ( ',' resultant )? ')'
    | 'INMAT' '(' nocollect_mult_arg_list? ')'
    | 'INSERT' '(' nocollect_mult_arg_list? ( ';' resultant )? ')'
    | 'INT' '(' resultant ')'
    | 'JQLCOMPILE' '(' resultant ',' resultant ',' resultant ',' ident_options ')'
    | 'JQLGETPROPERTY' '(' ident_options ',' ident_options ',' resultant ',' resultant ')'
    | 'JQLPUTPROPERTY' '(' resultant ',' ident_options ',' resultant ',' resultant ')'
    | 'JQLEXECUTE' '(' ident_options ',' ident_options ')'
    | 'JQLFETCH' '(' ident_options ',' ident_options ',' ident_options ')'
    | xml_type '(' resultant ',' resultant ( ',' ident_options )? ')'
    | 'VALIDATE_PRODUCT_LICENSE' '(' resultant ')'
    | 'VALIDATE_METRICS_LICENSE' '(' resultant ')'
    | 'CONSUME_METRICS_LICENSE' '(' resultant ',' resultant ')'
    | 'PERROR' '(' resultant ')'
    | ( 'READNEXT' | 'READPREV' ) 'KEY'? ident_options_or_attype ( ',' ident_options )? ( ',' ident_options )? ( 'FROM' resultant )? ( ( 'RETURNING' | 'SETTING' ) ident_options )?
    | 'REPLACE' '(' nocollect_mult_arg_list? ( ';' resultant )? ')'
    | opt_str_math '(' nocollect_mult_arg_list? ')'
    | 'SENTENCE' '(' resultant? ')'
    | 'SPOOLER' '(' nocollect_mult_arg_list? ')'
    | 'SYSTEM' '(' resultant ')'
    | ( 'TRANS' | 'XLATE' ) '(' nocollect_mult_arg_list? ')'
    | 'TRIM' '(' nocollect_mult_arg_list? ')'
    | dynamic_reference
    | ( 'FMT' | 'FMTS' ) '(' resultant ',' resultant ')'
    | 'STATUS' '(' ')'
    | 'REMOVE' '(' resultant ',' ident_options ')'
    | ( '++' | '--' ) ident_options
    | post_ident_expressions
    | Constant
    | '(' resultant ')'
    | 'IF' resultant 'THEN' resultant 'ELSE' resultant
    ) ( ( '+' | '^' | '-' | '/' | '*' | '=' | '<' | '>=' | '<=' | '#' | 'AND' | 'OR' | ( 'MATCH' | 'MATCHES' ) ) resultant
    | ':' resultant?
    | '[' resultant ( ',' resultant ( ',' resultant )? )? ']'
    | '>' '='? resultant
    | format_options
    )*
Used by: cases, collect_mult_arg_list, dynamic_reference, ex_parameter_list, file_specifier, filevar_or_lptr_or_mtu, ident_assignments, matrix_arg, nocollect_mult_arg_list, opt_dyns, opt_loc_dyns, opt_matbp_delimiter, opt_matbp_start_end, opt_mtu, optional_exec_stats, optional_input_limit, optional_time, print_arg, resultant, simple_print_expression, st_parameter_list, statement, stop_argument_list, sync_resultant, while_until
yacc source
resultant
    : '@' Identifier
    | '@' DATA
    | '@' SENTENCE
    | '@' FUNC_PARM0
    | '-' resultant
    | '+' resultant
    | resultant '+' resultant
    | resultant '^' resultant
    | resultant '-' resultant
    | resultant '/' resultant
    | resultant '*' resultant
    | resultant ':' resultant
    | resultant ':'
    | resultant EQ resultant
    | resultant '=' resultant
    | resultant '[' resultant rsq
    | resultant '[' resultant ',' resultant rsq
    | resultant '[' resultant ',' resultant ',' resultant rsq
    | resultant GT resultant
    | resultant GT EQ resultant
    | resultant LT resultant
    | resultant GE resultant
    | resultant LE resultant
    | resultant NE resultant
    | resultant AND resultant
    | cursorpos
    | resultant OR resultant
    | BITLOAD '(' {} opt_nocollect_argument_list rp
    | CALLC opt_at CFUNC_or_Identifier {} opt_func_mat_arg_list
    | BFUNC {} opt_func_mat_arg_list
    | CFUNC '(' {} opt_nocollect_argument_list ')'
    | change_or_swap '(' {} nocollect_argument_list rp
    | keyin_or_in '(' rp
    | CHAR '(' resultant ')'
    | COMPARE {} '(' nocollect_argument_list rp
    | CONTROLCHAR '(' {} nocollect_argument_list rp
    | CONVERT '(' {} nocollect_argument_list rp
    | DELETE {} '(' nocollect_argument_list rp
    | GETENV '(' resultant rp
    | GETENV '(' resultant ',' ident_options rp
    | EXTRACT '(' {} nocollect_argument_list rp
    | CRC {} '(' nocollect_argument_list rp
    | DROUND '(' resultant opt_param rp
    | FFIX '(' resultant opt_param rp
    | field_type '(' {} nocollect_argument_list rp
    | TA '(' resultant rp
    | FUNC_PARM1 '(' resultant rp
    | FUNC_PARM2 '(' resultant ',' resultant rp
    | FUNC_PARM3 '(' {} nocollect_argument_list rp
    | FUNC_PARM0 '(' rp
    | SELECTINFO '(' {} nocollect_argument_list rp
    | ERRTEXT '(' resultant {} opt_err_argument_list rp
    | GETCWD '(' ident_options rp
    | GROUP '(' {} nocollect_argument_list rp
    | INDICES '(' ident_options opt_param ')'
    | INMAT '(' {} opt_nocollect_argument_list rp
    | INSERT {} '(' nocollect_argument_list insert_delims rp
    | JAC_INT '(' resultant rp
    | JQLCOMPILE '(' resultant ',' resultant ',' resultant ',' ident_options rp
    | JQLGETPROPERTY '(' ident_options ',' ident_options ',' resultant ',' resultant rp
    | JQLPUTPROPERTY '(' resultant ',' ident_options ',' resultant ',' resultant rp
    | JQLEXECUTE '(' ident_options ',' ident_options rp
    | JQLFETCH '(' ident_options ',' ident_options ',' ident_options rp
    | xml_type '(' resultant ',' resultant rp
    | xml_type '(' resultant ',' resultant ',' ident_options rp
    | VALIDATE_PRODUCT_LICENSE '(' resultant rp
    | VALIDATE_METRICS_LICENSE '(' resultant rp
    | CONSUME_METRICS_LICENSE '(' resultant ',' resultant rp
    | PERROR '(' resultant rp
    | resultant MATCHES resultant
    | opt_read_next_or_prev opt_key ident_options_or_attype opt_identifier opt_identifier optional_from opt_io_setting
    | REPLACE {} '(' nocollect_argument_list insert_delims rp
    | opt_str_math '(' {} nocollect_argument_list rp
    | SENTENCE '(' rp
    | SENTENCE '(' resultant rp
    | SPOOLER {} '(' nocollect_argument_list rp
    | SYSTEM '(' resultant rp
    | TRANS '(' {} nocollect_argument_list rp
    | TRIM {} '(' nocollect_argument_list rp
    | dynamic_reference
    | fmt_type '(' resultant ',' resultant ')'
    | STATUS '(' rp
    | REMOVE '(' resultant ',' ident_options rp
    | resultant format_options %prec Identifier
    | PP ident_options
    | MM ident_options
    | post_ident_expressions
    | Constant
    | '(' resultant rp
    | IF resultant THEN resultant ELSE resultant
    ;

Other rules

Rules used by program, statement, resultant, in the order they are first referenced.

section

statementsopt_end_prog
section ::= statements opt_end_prog
Used by: program
yacc source
section
    : statements opt_end_prog
    ;

st_parameter_list

resultant,resultant
st_parameter_list ::= resultant ( ',' resultant )*
Used by: statement
yacc source
st_parameter_list
    : resultant
    | st_parameter_list ',' resultant
    ;

ident_assignments

PP++MM--assign_optionsassign_operatorsresultant
ident_assignments ::= '++' | '--' | assign_options assign_operators resultant
Used by: statement
yacc source
ident_assignments
    : PP
    | MM
    | assign_options assign_operators {} resultant
    ;

ident_options

a variable or other nameIdentifier(ex_parameter_list)a variable or other nameIdentifier
ident_options ::= Identifier '(' ex_parameter_list ')' | Identifier
Used by: close_identifier_list, dynamic_var_reference, file_specifier, format_options, ident_options_or_attype, opt_on, opt_sel_list1, opt_select_to, optional_exec_stats, post_ident_expressions, resultant, simple_print_expression, statement
yacc source
ident_options
    : mat_extract ex_parameter_list rp
    | Identifier
    ;

mat_statement

token JAC_MATMATa variable or other nameIdentifier=
mat_statement ::= 'MAT' Identifier '='
Used by: statement
yacc source
mat_statement
    : JAC_MAT Identifier {} '='
    ;

case_structure

token JAC_BEGINBEGINtoken CASECASEstatement_separatorcasestoken JAC_ENDENDtoken CASECASE
case_structure ::= 'BEGIN' 'CASE' statement_separator cases 'END' 'CASE'
Used by: statement
yacc source
case_structure
    : JAC_BEGIN CASE statement_separator cases {} JAC_END CASE
    ;

c_func_types

token JAC_INTINTtoken JAC_FLOATFLOATtoken JAC_VARVARtoken JAC_STRINGSTRING
c_func_types ::= 'INT' | 'FLOAT' | 'VAR' | 'STRING'
Used by: c_var_list, statement
yacc source
c_func_types
    : JAC_INT
    | JAC_FLOAT
    | JAC_VAR
    | JAC_STRING
    ;

c_var_list

c_func_types,c_func_types
c_var_list ::= c_func_types ( ',' c_func_types )*
Used by: statement
yacc source
c_var_list
    : c_func_types
    | c_var_list ',' c_func_types
    ;

funcname

a variable or other nameIdentifier,a variable or other nameIdentifier
funcname ::= Identifier ( ',' Identifier )*
Used by: statement
yacc source
funcname
    : Identifier
    | funcname ',' Identifier
    ;

b_var_list

Starts with one of:

a variable or other nameIdentifiertoken JAC_MATMATa variable or other nameIdentifier

Then any number of:

,a variable or other nameIdentifiertoken JAC_MATMATa variable or other nameIdentifier
b_var_list ::= ( Identifier | 'MAT' Identifier ) ( ',' ( Identifier | 'MAT' Identifier ) )*
Used by: statement
yacc source
b_var_list
    : b_func_types
    | b_var_list ',' b_func_types
    ;

nocollect_mult_arg_list

resultant,resultant
nocollect_mult_arg_list ::= resultant ( ',' resultant )*
Used by: assign_options, attr_file_specifier, cursorpos, dimvar, dynamic_reference, dynamic_var_reference, resultant, statement
yacc source
nocollect_mult_arg_list
    : resultant
    | nocollect_mult_arg_list ',' resultant
    ;

cond_stats

statementstoken JAC_ENDENDsingle_line_statements
cond_stats ::= statements 'END' | single_line_statements
Used by: cond_body_p1, error_cond_body, null_cond_body_p1, null_sw_cond_body_p1, optional_time, statement, sw_cond_body_p1
yacc source
cond_stats
    : statements JAC_END
    | single_line_statements
    ;

error_cond_body

token ONONtoken ERRORERRORcond_stats
error_cond_body ::= 'ON' 'ERROR' cond_stats
Used by: statement
yacc source
error_cond_body
    : ON ERROR {} cond_stats
    ;

cond_body_p1

token THENTHENcond_statstoken THENTHENtoken ELSEELSEcond_stats
cond_body_p1 ::= 'THEN' cond_stats | 'THEN'? 'ELSE' cond_stats
Used by: optional_time, statement
yacc source
cond_body_p1
    : THEN {} cond_stats
    | opt_dummy_then ELSE {} cond_stats
    ;

opt_on

token ONONa number or a string literalConstantident_options
opt_on ::= ( 'ON' ( Constant | ident_options ) )?
Used by: statement
yacc source
opt_on
    : ON Constant
    | ON ident_options
    |  
    ;

statements_and_opt_while_until_body

statementswhile_untiltoken DODOstat_bodywhile_untiltoken DODOstat_body
statements_and_opt_while_until_body
    ::= statements ( while_until 'DO'? stat_body )? ( while_until 'DO'? stat_body )?*
Used by: statement
yacc source
statements_and_opt_while_until_body
    : statements opt_while_until_body
    | statements_and_opt_while_until_body opt_while_until_body
    ;

opt_loc_dyns

opening bracket of a dynamic array reference in LOCATE or DEL<resultant,resultant,resultantclosing bracket of a dynamic array reference>
opt_loc_dyns ::= ( '<' resultant ( ',' resultant )? ( ',' resultant )? '>' )?
Used by: statement
yacc source
opt_loc_dyns
    : LOC_SDYN {} resultant opt_param opt_param end_dyn
    |  
    ;

single_line_statements

statement;statement
single_line_statements ::= statement ( ';' statement? )*
Used by: cond_stats, stat_body, statement
yacc source
single_line_statements
    : statement
    | single_line_statements stat_sep
    | single_line_statements stat_sep statement
    ;

close_identifier_list

ident_options,ident_options
close_identifier_list ::= ident_options ( ',' ident_options )*
Used by: statement
yacc source
close_identifier_list
    : ident_options
    | close_identifier_list ',' ident_options
    ;

collect_mult_arg_list

resultant,resultant
collect_mult_arg_list ::= resultant ( ',' resultant )*
Used by: statement
yacc source
collect_mult_arg_list
    : resultant
    | collect_mult_arg_list ',' resultant
    ;

sw_cond_body_p1

token THENTHENcond_statstoken THENTHENtoken ELSEELSEcond_stats
sw_cond_body_p1 ::= 'THEN' cond_stats | 'THEN'? 'ELSE' cond_stats
Used by: statement
yacc source
sw_cond_body_p1
    : THEN {} cond_stats
    | opt_dummy_then ELSE {} cond_stats
    ;

ident_options_or_attype

ident_options@a variable or other nameIdentifier
ident_options_or_attype ::= ident_options | '@' Identifier
Used by: resultant, statement
yacc source
ident_options_or_attype
    : ident_options
    | '@' Identifier
    ;

null_sw_cond_body_p1

token THENTHENtoken ELSEELSEcond_stats
null_sw_cond_body_p1 ::= ( 'THEN' | 'ELSE' ) cond_stats
Used by: statement
yacc source
null_sw_cond_body_p1
    : THEN {} cond_stats
    | ELSE {} cond_stats
    ;

opt_select_to

token TOTOident_optionsa number or a string literalConstant
opt_select_to ::= ( 'TO' ( ident_options | Constant ) )?
Used by: statement
yacc source
opt_select_to
    :  
    | TO ident_options
    | TO Constant
    ;

opt_mtu

token UNITUNIT(resultant)
opt_mtu ::= ( 'UNIT' '(' resultant ')' )?
Used by: statement
yacc source
opt_mtu
    :  
    | UNIT '(' resultant ')'
    ;

stop_argument_list

resultant,resultant
stop_argument_list ::= resultant ( ',' resultant )*
Used by: resultant, statement
yacc source
stop_argument_list
    : resultant
    | stop_argument_list ',' resultant
    ;

opt_func_mat_arg_list

opening parenthesis of a matrix assignment(opt_func_mat_argument_list)
opt_func_mat_arg_list ::= '(' opt_func_mat_argument_list ')'
Used by: resultant, statement
yacc source
opt_func_mat_arg_list
    : LP {} opt_func_mat_argument_list ')'
    ;

mat_argument_list

matrix_arg,matrix_arg
mat_argument_list ::= matrix_arg ( ',' matrix_arg )*
Used by: opt_func_mat_argument_list, statement
yacc source
mat_argument_list
    : matrix_arg
    | mat_argument_list ',' matrix_arg
    ;

opt_dyns

opening bracket of a dynamic array reference such as REC<2,1><resultant,resultant,resultantclosing bracket of a dynamic array reference>
opt_dyns ::= ( '<' resultant ( ',' resultant )? ( ',' resultant )? '>' )?
Used by: statement
yacc source
opt_dyns
    : SDYN resultant opt_param opt_param end_dyn
    |  
    ;

opt_namedcommon_name

/a number or a string literalConstant/
opt_namedcommon_name ::= ( '/' Constant '/' )?
Used by: statement
yacc source
opt_namedcommon_name
    : '/' {} Constant {} '/'
    |  
    ;

opt_sel_list1

ident_optionsa number or a string literalConstant
opt_sel_list1 ::= ( ident_options | Constant )?
Used by: optional_exec_stats, statement
yacc source
opt_sel_list1
    : ident_options
    |  
    | Constant
    ;

opt_common_name

/a number or a string literalConstant/
opt_common_name ::= ( '/' Constant '/' )?
Used by: statement
yacc source
opt_common_name
    : '/' {} Constant {} '/'
    |  
    ;

common_identifier_list

common_identifier,common_identifier
common_identifier_list ::= common_identifier ( ',' common_identifier )*
Used by: statement
yacc source
common_identifier_list
    : common_identifier
    | common_identifier_list ',' common_identifier
    ;

multiple_print_arg

print_arg
multiple_print_arg ::= print_arg+
Used by: statement
yacc source
multiple_print_arg
    : print_arg
    | multiple_print_arg print_arg
    ;

dimvar_list

dimvar,dimvar
dimvar_list ::= dimvar ( ',' dimvar )*
Used by: statement
yacc source
dimvar_list
    : dimvar
    | dimvar_list ',' dimvar
    ;

sql_stats

token DECLAREDECLAREa variable or other nameIdentifiertoken TABLETABLE(sql_tabdefs);token JAC_BEGINBEGINtoken DECLAREDECLAREtoken SECTIONSECTION;sql_declarationstoken EXECEXECtoken SQLSQLtoken JAC_ENDENDtoken DECLAREDECLAREtoken SECTIONSECTION;;
sql_stats
    ::= ( 'DECLARE' Identifier 'TABLE' '(' sql_tabdefs ')' ';'
    | 'BEGIN' 'DECLARE' 'SECTION' ';' sql_declarations 'EXEC' 'SQL' 'END' 'DECLARE' 'SECTION' ';'
    | ';'
    )?
Used by: statement
yacc source
sql_stats
    : DECLARE Identifier TABLE '(' {} sql_tabdefs ')' ';'
    | JAC_BEGIN DECLARE SECTION ';' {} sql_declarations sql_prefix JAC_END DECLARE SECTION ';'
    | ';'
    |  
    ;

exec_perf

token EXECUTEEXECUTEtoken PERFORMPERFORMtoken PCPERFORMPCPERFORMtoken MDPERFORMMDPERFORMtoken UDTEXECUTEUDTEXECUTEtoken EXECEXEC
exec_perf ::= 'EXECUTE' | 'PERFORM' | 'PCPERFORM' | 'MDPERFORM' | 'UDTEXECUTE' | 'EXEC'
Used by: statement
yacc source
exec_perf
    : EXECUTE
    | PERFORM
    | PCPERFORM
    | MDPERFORM
    | UDTEXECUTE
    | EXEC
    ;

optional_exec_stuff

optional_exec_stats
optional_exec_stuff ::= optional_exec_stats+
Used by: statement
yacc source
optional_exec_stuff
    : optional_exec_stats
    | optional_exec_stuff optional_exec_stats
    ;

null_cond_body_p1

token THENTHENtoken ELSEELSEcond_stats
null_cond_body_p1 ::= ( 'THEN' | 'ELSE' ) cond_stats
Used by: statement
yacc source
null_cond_body_p1
    : THEN {} cond_stats
    | ELSE {} cond_stats
    ;

optional_time

token UNFILTEREDUNFILTEREDtoken FORFORtoken WAITINGWAITINGresultanttoken UNFILTEREDUNFILTEREDcond_body_p1token ELSEELSEcond_stats
optional_time
    ::= ( 'UNFILTERED'
    | ( 'FOR' | 'WAITING' ) resultant 'UNFILTERED'? cond_body_p1 ( 'ELSE' cond_stats )?
    )?
Used by: statement
yacc source
optional_time
    : opt_unfiltered
    | for_or_waiting resultant opt_unfiltered {} cond_body_p1 cond_body_p2
    ;

cursorpos

token POSCURPOSCUR(nocollect_mult_arg_list)
cursorpos ::= 'POSCUR' '(' nocollect_mult_arg_list? ')'
Used by: resultant, statement
yacc source
cursorpos
    : POSCUR '(' {} nocollect_argument_list rp
    ;

optional_input_limit

,resultant,resultant
optional_input_limit ::= ( ',' resultant ( ',' resultant )? )?
Used by: statement
yacc source
optional_input_limit
    :  
    | ',' resultant
    | ',' resultant ',' resultant
    ;

optional_input_colon

:__:
optional_input_colon ::= ( ':' '_'? | '_' ':'? )?
Used by: statement
yacc source
optional_input_colon
    :  
    | ':'
    | '_'
    | '_' ':'
    | ':' '_'
    ;

opt_matbp_start_end

,resultant,resultant
opt_matbp_start_end ::= ( ',' resultant ( ',' resultant )? )?
Used by: statement
yacc source
opt_matbp_start_end
    :  
    | ',' resultant
    | ',' resultant ',' resultant
    ;

opt_matbp_delimiter

token USINGUSING,resultant
opt_matbp_delimiter ::= ( ( 'USING' | ',' ) resultant )?
Used by: statement
yacc source
opt_matbp_delimiter
    :  
    | USING resultant
    | ',' resultant
    ;

file_specifier

resultantident_options,resultant
file_specifier ::= resultant | ident_options ',' resultant
Used by: statement
yacc source
file_specifier
    : resultant
    | ident_options ',' resultant
    ;

gosub_label_list

a statement labelLabel:,a statement labelLabel:
gosub_label_list ::= Label ':'? ( ',' Label ':'? )*
Used by: statement
yacc source
gosub_label_list
    : Label_opt_colon
    | gosub_label_list ',' {} Label_opt_colon
    ;

goto_label_list

a statement labelLabel:,a statement labelLabel:
goto_label_list ::= Label ':'? ( ',' Label ':'? )*
Used by: statement
yacc source
goto_label_list
    : Label_opt_colon
    | goto_label_list ',' {} Label_opt_colon
    ;

simple_print_expression

Starts with one of:

a number or a string literalConstant(resultant)ident_options

Then any number of:

+-simple_print_expression
simple_print_expression
    ::= ( Constant | '(' resultant ')' | ident_options ) ( ( '+' | '-' ) simple_print_expression )*
Used by: simple_print_expression, statement
yacc source
simple_print_expression
    : Constant
    | '(' resultant ')'
    | ident_options
    | simple_print_expression '+' simple_print_expression
    | simple_print_expression '-' simple_print_expression
    ;

ptr_on_off_reset_close

token ONONtoken OFFOFFtoken RESETRESETtoken CLOSECLOSE
ptr_on_off_reset_close ::= 'ON' | 'OFF' | 'RESET' | 'CLOSE'
Used by: statement
yacc source
ptr_on_off_reset_close
    : ON
    | OFF
    | RESET
    | CLOSE
    ;

read_statement

token READREADtoken READUREADUtoken READLREADLtoken READXREADXtoken READXUREADXUtoken READXLREADXLtoken READXMLREADXMLtoken READXMLUREADXMLU
read_statement ::= 'READ' | 'READU' | 'READL' | 'READX' | 'READXU' | 'READXL' | 'READXML' | 'READXMLU'
Used by: statement
yacc source
read_statement
    : READ
    | READU
    | READL
    | READX
    | READXU
    | READXL
    | READXML
    | READXMLU
    ;

attr_file_specifier

nocollect_mult_arg_list
attr_file_specifier ::= nocollect_mult_arg_list?
Used by: statement
yacc source
attr_file_specifier
    : {} nocollect_argument_list
    ;

ident_list

Starts with one of:

a variable or other nameIdentifiertoken JAC_MATMATa variable or other nameIdentifier

Then any number of:

,token JAC_MATMATa variable or other nameIdentifier
ident_list ::= ( Identifier | 'MAT' Identifier ) ( ',' 'MAT'? Identifier )*
Used by: statement
yacc source
ident_list
    : Identifier
    | ident_list ',' Identifier
    | JAC_MAT Identifier
    | ident_list ',' JAC_MAT Identifier
    ;

sync_resultant

token SYNCSYNCresultantresultant
sync_resultant ::= ( 'SYNC' resultant? | resultant )?
Used by: statement
yacc source
sync_resultant
    : SYNC
    | SYNC resultant
    | resultant
    |  
    ;

filevar_or_lptr_or_mtu

resultanttoken JAC_LPTRLPTRtoken MTUMTUresultant
filevar_or_lptr_or_mtu ::= resultant | ( 'LPTR' | 'MTU' ) resultant
Used by: statement
yacc source
filevar_or_lptr_or_mtu
    : resultant
    | JAC_LPTR resultant
    | MTU resultant
    ;

write_statement

token WRITEWRITEtoken WRITEXWRITEXtoken WRITEUWRITEUtoken WRITEXUWRITEXUtoken WRITEXMLWRITEXMLtoken WRITEXMLUWRITEXMLU
write_statement ::= 'WRITE' | 'WRITEX' | 'WRITEU' | 'WRITEXU' | 'WRITEXML' | 'WRITEXMLU'
Used by: statement
yacc source
write_statement
    : WRITE
    | WRITEX
    | WRITEU
    | WRITEXU
    | WRITEXML
    | WRITEXMLU
    ;

xml_type

token DYNTOXMLDYNTOXMLtoken XMLTODYNXMLTODYNtoken XMLTOXMLXMLTOXMLtoken XMLADDTEXTXML.ADD.TEXTtoken XMLADDNODEXML.ADD.NODEtoken XMLVALIDATEXML.VALIDATEtoken XMLGETTAGVALUEXML.GET.TAG.VALUE
xml_type
    ::= 'DYNTOXML' | 'XMLTODYN' | 'XMLTOXML' | 'XML.ADD.TEXT' | 'XML.ADD.NODE' | 'XML.VALIDATE' | 'XML.GET.TAG.VALUE'
Used by: resultant
yacc source
xml_type
    : DYNTOXML
    | XMLTODYN
    | XMLTOXML
    | XMLADDTEXT
    | XMLADDNODE
    | XMLVALIDATE
    | XMLGETTAGVALUE
    ;

opt_str_math

token SADDSADDtoken SSUBSSUBtoken SDIVSDIVtoken SMULSMUL
opt_str_math ::= 'SADD' | 'SSUB' | 'SDIV' | 'SMUL'
Used by: resultant
yacc source
opt_str_math
    : SADD
    | SSUB
    | SDIV
    | SMUL
    ;

dynamic_reference

resultantopening bracket of a dynamic array reference such as REC<2,1><nocollect_mult_arg_listclosing bracket of a dynamic array reference>
dynamic_reference ::= resultant '<' nocollect_mult_arg_list? '>'
Used by: resultant
yacc source
dynamic_reference
    : resultant SDYN {} nocollect_argument_list end_dyn
    ;

post_ident_expressions

ident_optionsPP++MM--
post_ident_expressions ::= ident_options ( '++' | '--' )?
Used by: resultant
yacc source
post_ident_expressions
    : ident_options
    | ident_options PP
    | ident_options MM
    ;

format_options

a number or a string literalConstantident_optionsdynamic_var_reference
format_options ::= Constant | ident_options | dynamic_var_reference
Used by: resultant
yacc source
format_options
    : Constant
    | ident_options
    | dynamic_var_reference
    ;

statements

statement_separatorstatement
statements ::= ( statement_separator statement? )*
Used by: cond_stats, redundant_statements, section, stat_body, statements_and_opt_while_until_body
yacc source
statements
    : statements statement_separator statement
    | statements statement_separator
    | statements error EOL
    |  
    ;

opt_end_prog

token JAC_ENDENDeolstoken JAC_ENDENDeolsredundant_statements
opt_end_prog ::= ( 'END' eols )? ( 'END' eols redundant_statements )*
Used by: section
yacc source
opt_end_prog
    :  
    | JAC_END eols
    | opt_end_prog JAC_END {} eols redundant_statements
    ;

assign_options

opening bracket of a dynamic array reference such as REC<2,1><nocollect_mult_arg_listclosing bracket of a dynamic array reference>[nocollect_mult_arg_list]
assign_options ::= ( '<' nocollect_mult_arg_list? '>' )? ( '[' nocollect_mult_arg_list? ']' )?
Used by: ident_assignments
yacc source
assign_options
    : attrib_assign_list substring_assign_list
    ;

assign_operators

=PE+=ME-=TE*=DE/=CE:=
assign_operators ::= '=' | '+=' | '-=' | '*=' | '/=' | ':='
Used by: ident_assignments
yacc source
assign_operators
    : '='
    | PE
    | ME
    | TE
    | DE
    | CE
    ;

ex_parameter_list

resultant,resultant
ex_parameter_list ::= resultant ( ',' resultant )*
Used by: ident_options
yacc source
ex_parameter_list
    : resultant
    | ex_parameter_list ',' resultant
    ;

statement_separator

EOLend of line;
statement_separator ::= ( 'end of line' | ';' )+
Used by: case_structure, statements
yacc source
statement_separator
    : statement_separator new_line
    | statement_separator stat_sep
    | new_line
    | stat_sep
    ;

cases

token CASECASEresultantstat_bodytoken CASECASEresultantstat_body
cases ::= ( 'CASE' resultant stat_body )? ( 'CASE' resultant stat_body )*
Used by: case_structure
yacc source
cases
    :  
    | CASE resultant {} stat_body
    | cases CASE resultant {} stat_body
    | cases error
    ;

while_until

token WHILEWHILEtoken UNTILUNTILresultant
while_until ::= ( 'WHILE' | 'UNTIL' ) resultant
Used by: statements_and_opt_while_until_body
yacc source
while_until
    : WHILE resultant
    | UNTIL resultant
    ;

stat_body

statementssingle_line_statements
stat_body ::= statements | single_line_statements
Used by: cases, statements_and_opt_while_until_body
yacc source
stat_body
    : statements
    | single_line_statements
    ;

opt_func_mat_argument_list

matrix_argmat_argument_list,matrix_arg
opt_func_mat_argument_list ::= ( matrix_arg | mat_argument_list ',' matrix_arg )?
Used by: opt_func_mat_arg_list
yacc source
opt_func_mat_argument_list
    :  
    | matrix_arg
    | mat_argument_list ',' matrix_arg
    ;

matrix_arg

resultanttoken JAC_MATMATa variable or other nameIdentifier
matrix_arg ::= resultant | 'MAT' Identifier
Used by: mat_argument_list, opt_func_mat_argument_list
yacc source
matrix_arg
    : resultant
    | matrix
    ;

common_identifier

a variable or other nameIdentifierdimvar
common_identifier ::= Identifier | dimvar
Used by: common_identifier_list
yacc source
common_identifier
    : Identifier
    | dimvar
    ;

dimvar

a variable or other nameIdentifier(nocollect_mult_arg_list)
dimvar ::= Identifier '(' nocollect_mult_arg_list? ')'
Used by: common_identifier, dimvar_list
yacc source
dimvar
    : Identifier '(' {} nocollect_argument_list rp
    ;

sql_tabdefs

sql_tabfld,sql_tabfld
sql_tabdefs ::= sql_tabfld ( ',' sql_tabfld )*
Used by: sql_stats
yacc source
sql_tabdefs
    : sql_tabfld
    | sql_tabdefs ',' {} sql_tabfld
    ;

sql_declarations

sql_declare
sql_declarations ::= sql_declare+
Used by: sql_stats
yacc source
sql_declarations
    : sql_declare
    | sql_declarations sql_declare
    ;

optional_exec_stats

token CAPTURINGCAPTURINGtoken SETTINGRETURNING / SETTINGtoken RTNDATARTNDATAident_optionstoken PASSLISTPASSLISTresultanttoken RTNLISTRTNLISTopt_sel_list1token PASSDATAPASSDATAresultant
optional_exec_stats
    ::= ( 'CAPTURING' | ( 'RETURNING' | 'SETTING' ) | 'RTNDATA' ) ident_options
     | 'PASSLIST' resultant?
     | 'RTNLIST' opt_sel_list1
     | 'PASSDATA' resultant
Used by: optional_exec_stuff
yacc source
optional_exec_stats
    : CAPTURING ident_options
    | SETTING ident_options
    | PASSLIST opt_sel_list2
    | RTNLIST opt_sel_list1
    | PASSDATA resultant
    | RTNDATA ident_options
    ;

dynamic_var_reference

ident_optionsopening bracket of a dynamic array reference such as REC<2,1><nocollect_mult_arg_listclosing bracket of a dynamic array reference>
dynamic_var_reference ::= ident_options '<' nocollect_mult_arg_list? '>'
Used by: format_options
yacc source
dynamic_var_reference
    : ident_options SDYN {} nocollect_argument_list end_dyn
    ;

eols

EOLend of line
eols ::= 'end of line'+
Used by: opt_end_prog
yacc source
eols
    : EOL
    | eols EOL
    ;

redundant_statements

statements
redundant_statements ::= statements
Used by: opt_end_prog
yacc source
redundant_statements
    : statements
    ;

sql_tabfld

token SMALLINTSMALLINTtoken JAC_INTINTtoken JAC_FLOATFLOATa variable or other nameIdentifiertoken JAC_STRINGSTRING(a number or a string literalConstant)a variable or other nameIdentifier
sql_tabfld ::= ( 'SMALLINT' | 'INT' | 'FLOAT' ) Identifier | 'STRING' '(' Constant ')' Identifier
Used by: sql_tabdefs
yacc source
sql_tabfld
    : SMALLINT Identifier
    | JAC_INT Identifier
    | JAC_STRING '(' Constant ')' Identifier
    | JAC_FLOAT Identifier
    ;

sql_declare

token SMALLINTSMALLINTa variable or other nameIdentifier;token JAC_INTINTa variable or other nameIdentifier;token JAC_FLOATFLOATa variable or other nameIdentifier;token JAC_STRINGSTRINGtoken BLOBBLOBtoken VARCHARVARCHAR(a number or a string literalConstant)a variable or other nameIdentifier;token EXECEXECtoken SQLSQLtoken JAC_VARVAR
sql_declare
    ::= 'SMALLINT' Identifier ';'
     | 'INT' Identifier ';'
     | 'FLOAT' Identifier ';'
     | ( 'STRING' | 'BLOB' | 'VARCHAR' ) '(' Constant ')' Identifier ';'
     | 'EXEC' 'SQL' 'VAR'
Used by: sql_declarations
yacc source
sql_declare
    : SMALLINT Identifier ';'
    | JAC_INT Identifier ';'
    | JAC_FLOAT Identifier ';'
    | opt_sql_type '(' Constant ')' Identifier ';'
    | sql_prefix JAC_VAR
    ;

precedence

BindsAssociativityTokens
1right++ --
2left^ THEN ELSE
3left* /
4left+ -
6left:
7leftMATCH / MATCHES
8left>= <= > <
9left= #
10leftOR AND
11right+= -= *= /= :=

Level 1 binds tightest. Taken from the %left, %right and %nonassoc declarations of the grammar.