home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
cs.rhul.ac.uk
/
www.cs.rhul.ac.uk.zip
/
www.cs.rhul.ac.uk
/
pub
/
rdp
/
rdp_cs3470.tar
/
rdp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-05-07
|
86KB
|
2,145 lines
/*******************************************************************************
*
* Parser generated by RDP on May 04 1998 09:45:17 from rdp.bnf
*
*******************************************************************************/
#include <time.h>
#include "arg.h"
#include "graph.h"
#include "memalloc.h"
#include "scan.h"
#include "set.h"
#include "symbol.h"
#include "textio.h"
#include "rdp_aux.h"
#include "rdp_gram.h"
#include "rdp_prnt.h"
#include "rdp.h"
char
*rdp_sourcefilename = NULL, /* source file name */
*rdp_outputfilename = "rdparser"; /* output file name */
int
rdp_symbol_echo = 0, /* symbol echo flag */
rdp_verbose = 0, /* verbosity flag */
rdp_pass; /* pass number */
int rdp_error_return = 0; /* return value for main routine */
char *rdp_tokens = "IGNORE\0"
"ID\0" "INTEGER\0" "REAL\0" "CHAR\0" "CHAR_ESC\0" "STRING\0" "STRING_ESC\0" "COMMENT\0"
"COMMENT_VISIBLE\0" "COMMENT_NEST\0" "COMMENT_NEST_VISIBLE\0" "COMMENT_LINE\0" "COMMENT_LINE_VISIBLE\0" "EOF\0" "EOLN\0" "'\"'\0"
"'#'\0" "'\''\0" "'('\0" "'(*'\0" "')'\0" "'*'\0" "'.'\0" "':'\0"
"'::'\0" "'::='\0" "'<'\0" "'>'\0" "'@'\0" "'ALT_ID'\0" "'ANNOTATED_EPSILON_TREE'\0" "'ARG_BLANK'\0"
"'ARG_BOOLEAN'\0" "'ARG_NUMERIC'\0" "'ARG_STRING'\0" "'CASE_INSENSITIVE'\0" "'CHAR'\0" "'CHAR_ESC'\0" "'COMMENT'\0" "'COMMENT_LINE'\0"
"'COMMENT_LINE_VISIBLE'\0" "'COMMENT_NEST'\0" "'COMMENT_NEST_VISIBLE'\0" "'COMMENT_VISIBLE'\0" "'EPSILON_TREE'\0" "'HASH_PRIME'\0" "'HASH_SIZE'\0" "'INCLUDE'\0"
"'INTERPRETER'\0" "'MAX_ERRORS'\0" "'MAX_WARNINGS'\0" "'NEW_ID'\0" "'NUMBER'\0" "'OPTION'\0" "'OUTPUT_FILE'\0" "'PARSER'\0"
"'PASSES'\0" "'POST_PARSE'\0" "'POST_PROCESS'\0" "'PRE_PARSE'\0" "'PRE_PROCESS'\0" "'SET_SIZE'\0" "'SHOW_SKIPS'\0" "'STRING'\0"
"'STRING_ESC'\0" "'SUFFIX'\0" "'SYMBOL_TABLE'\0" "'TAB_WIDTH'\0" "'TEXT_SIZE'\0" "'TITLE'\0" "'TREE'\0" "'USES'\0"
"'['\0" "'[*'\0" "']'\0" "'^'\0" "'^^'\0" "'^^^'\0" "'^_'\0" "'{'\0"
"'|'\0" "'}'\0" ;
locals_data * locals_temp = NULL;
void* locals = NULL;
codes_data * codes_temp = NULL;
void* codes = NULL;
tokens_data * tokens_temp = NULL;
void* tokens = NULL;
rdp_data * rdp_temp = NULL;
void* rdp = NULL;
/* Load keywords */
static void rdp_load_keywords(void)
{
scan_load_keyword("\"", "\\", RDP_T_16 /* " */, SCAN_P_STRING_ESC);
scan_load_keyword("#", NULL, RDP_T_17 /* # */, SCAN_P_IGNORE);
scan_load_keyword("\'", "\\", RDP_T_18 /* ' */, SCAN_P_STRING_ESC);
scan_load_keyword("(", NULL, RDP_T_19 /* ( */, SCAN_P_IGNORE);
scan_load_keyword("(*", "*)", RDP_T_20 /* (* */, SCAN_P_COMMENT);
scan_load_keyword(")", NULL, RDP_T_21 /* ) */, SCAN_P_IGNORE);
scan_load_keyword("*", NULL, RDP_T_22 /* * */, SCAN_P_IGNORE);
scan_load_keyword(".", NULL, RDP_T_23 /* . */, SCAN_P_IGNORE);
scan_load_keyword(":", NULL, RDP_T_24 /* : */, SCAN_P_IGNORE);
scan_load_keyword("::", NULL, RDP_T_25 /* :: */, SCAN_P_IGNORE);
scan_load_keyword("::=", NULL, RDP_T_26 /* ::= */, SCAN_P_IGNORE);
scan_load_keyword("<", NULL, RDP_T_27 /* < */, SCAN_P_IGNORE);
scan_load_keyword(">", NULL, RDP_T_28 /* > */, SCAN_P_IGNORE);
scan_load_keyword("@", NULL, RDP_T_29 /* @ */, SCAN_P_IGNORE);
scan_load_keyword("ALT_ID", NULL, RDP_T_ALT_ID, SCAN_P_IGNORE);
scan_load_keyword("ANNOTATED_EPSILON_TREE", NULL, RDP_T_ANNOTATED_EPSILON_TREE, SCAN_P_IGNORE);
scan_load_keyword("ARG_BLANK", NULL, RDP_T_ARG_BLANK, SCAN_P_IGNORE);
scan_load_keyword("ARG_BOOLEAN", NULL, RDP_T_ARG_BOOLEAN, SCAN_P_IGNORE);
scan_load_keyword("ARG_NUMERIC", NULL, RDP_T_ARG_NUMERIC, SCAN_P_IGNORE);
scan_load_keyword("ARG_STRING", NULL, RDP_T_ARG_STRING, SCAN_P_IGNORE);
scan_load_keyword("CASE_INSENSITIVE", NULL, RDP_T_CASE_INSENSITIVE, SCAN_P_IGNORE);
scan_load_keyword("CHAR", NULL, RDP_T_CHAR, SCAN_P_IGNORE);
scan_load_keyword("CHAR_ESC", NULL, RDP_T_CHAR_ESC, SCAN_P_IGNORE);
scan_load_keyword("COMMENT", NULL, RDP_T_COMMENT, SCAN_P_IGNORE);
scan_load_keyword("COMMENT_LINE", NULL, RDP_T_COMMENT_LINE, SCAN_P_IGNORE);
scan_load_keyword("COMMENT_LINE_VISIBLE", NULL, RDP_T_COMMENT_LINE_VISIBLE, SCAN_P_IGNORE);
scan_load_keyword("COMMENT_NEST", NULL, RDP_T_COMMENT_NEST, SCAN_P_IGNORE);
scan_load_keyword("COMMENT_NEST_VISIBLE", NULL, RDP_T_COMMENT_NEST_VISIBLE, SCAN_P_IGNORE);
scan_load_keyword("COMMENT_VISIBLE", NULL, RDP_T_COMMENT_VISIBLE, SCAN_P_IGNORE);
scan_load_keyword("EPSILON_TREE", NULL, RDP_T_EPSILON_TREE, SCAN_P_IGNORE);
scan_load_keyword("HASH_PRIME", NULL, RDP_T_HASH_PRIME, SCAN_P_IGNORE);
scan_load_keyword("HASH_SIZE", NULL, RDP_T_HASH_SIZE, SCAN_P_IGNORE);
scan_load_keyword("INCLUDE", NULL, RDP_T_INCLUDE, SCAN_P_IGNORE);
scan_load_keyword("INTERPRETER", NULL, RDP_T_INTERPRETER, SCAN_P_IGNORE);
scan_load_keyword("MAX_ERRORS", NULL, RDP_T_MAX_ERRORS, SCAN_P_IGNORE);
scan_load_keyword("MAX_WARNINGS", NULL, RDP_T_MAX_WARNINGS, SCAN_P_IGNORE);
scan_load_keyword("NEW_ID", NULL, RDP_T_NEW_ID, SCAN_P_IGNORE);
scan_load_keyword("NUMBER", NULL, RDP_T_NUMBER, SCAN_P_IGNORE);
scan_load_keyword("OPTION", NULL, RDP_T_OPTION, SCAN_P_IGNORE);
scan_load_keyword("OUTPUT_FILE", NULL, RDP_T_OUTPUT_FILE, SCAN_P_IGNORE);
scan_load_keyword("PARSER", NULL, RDP_T_PARSER, SCAN_P_IGNORE);
scan_load_keyword("PASSES", NULL, RDP_T_PASSES, SCAN_P_IGNORE);
scan_load_keyword("POST_PARSE", NULL, RDP_T_POST_PARSE, SCAN_P_IGNORE);
scan_load_keyword("POST_PROCESS", NULL, RDP_T_POST_PROCESS, SCAN_P_IGNORE);
scan_load_keyword("PRE_PARSE", NULL, RDP_T_PRE_PARSE, SCAN_P_IGNORE);
scan_load_keyword("PRE_PROCESS", NULL, RDP_T_PRE_PROCESS, SCAN_P_IGNORE);
scan_load_keyword("SET_SIZE", NULL, RDP_T_SET_SIZE, SCAN_P_IGNORE);
scan_load_keyword("SHOW_SKIPS", NULL, RDP_T_SHOW_SKIPS, SCAN_P_IGNORE);
scan_load_keyword("STRING", NULL, RDP_T_STRING, SCAN_P_IGNORE);
scan_load_keyword("STRING_ESC", NULL, RDP_T_STRING_ESC, SCAN_P_IGNORE);
scan_load_keyword("SUFFIX", NULL, RDP_T_SUFFIX, SCAN_P_IGNORE);
scan_load_keyword("SYMBOL_TABLE", NULL, RDP_T_SYMBOL_TABLE, SCAN_P_IGNORE);
scan_load_keyword("TAB_WIDTH", NULL, RDP_T_TAB_WIDTH, SCAN_P_IGNORE);
scan_load_keyword("TEXT_SIZE", NULL, RDP_T_TEXT_SIZE, SCAN_P_IGNORE);
scan_load_keyword("TITLE", NULL, RDP_T_TITLE, SCAN_P_IGNORE);
scan_load_keyword("TREE", NULL, RDP_T_TREE, SCAN_P_IGNORE);
scan_load_keyword("USES", NULL, RDP_T_USES, SCAN_P_IGNORE);
scan_load_keyword("[", NULL, RDP_T_73 /* [ */, SCAN_P_IGNORE);
scan_load_keyword("[*", "*]", RDP_T_74 /* [* */, SCAN_P_COMMENT_VISIBLE);
scan_load_keyword("]", NULL, RDP_T_75 /* ] */, SCAN_P_IGNORE);
scan_load_keyword("^", NULL, RDP_T_76 /* ^ */, SCAN_P_IGNORE);
scan_load_keyword("^^", NULL, RDP_T_77 /* ^^ */, SCAN_P_IGNORE);
scan_load_keyword("^^^", NULL, RDP_T_78 /* ^^^ */, SCAN_P_IGNORE);
scan_load_keyword("^_", NULL, RDP_T_79 /* ^_ */, SCAN_P_IGNORE);
scan_load_keyword("{", NULL, RDP_T_80 /* { */, SCAN_P_IGNORE);
scan_load_keyword("|", NULL, RDP_T_81 /* | */, SCAN_P_IGNORE);
scan_load_keyword("}", NULL, RDP_T_82 /* } */, SCAN_P_IGNORE);
}
/* Set declarations */
set_ String_stop = SET_NULL;
set_ code_stop = SET_NULL;
set_ comment_stop = SET_NULL;
set_ dir_first = SET_NULL;
set_ dir_stop = SET_NULL;
set_ item_com_first = SET_NULL;
set_ item_com_stop = SET_NULL;
set_ item_inl_first = SET_NULL;
set_ item_inl_stop = SET_NULL;
set_ item_ret_first = SET_NULL;
set_ item_ret_stop = SET_NULL;
set_ prod_first = SET_NULL;
set_ prod_stop = SET_NULL;
set_ rdp_dir_11_first = SET_NULL;
set_ rdp_dir_3_first = SET_NULL;
set_ rdp_dir_30_first = SET_NULL;
set_ rdp_dir_33_first = SET_NULL;
set_ rdp_dir_7_first = SET_NULL;
set_ rdp_item_inl_14_first = SET_NULL;
set_ rdp_item_inl_15_first = SET_NULL;
set_ rdp_item_inl_16_first = SET_NULL;
set_ rdp_item_inl_21_first = SET_NULL;
set_ rdp_item_inl_22_first = SET_NULL;
set_ rdp_item_inl_9_first = SET_NULL;
set_ rdp_item_ret_4_first = SET_NULL;
set_ rdp_item_ret_5_first = SET_NULL;
set_ rdp_item_ret_6_first = SET_NULL;
set_ rdp_prod_0_first = SET_NULL;
set_ rdp_prod_1_first = SET_NULL;
set_ rdp_prod_2_first = SET_NULL;
set_ rdp_rule_16_first = SET_NULL;
set_ rdp_seq_0_first = SET_NULL;
set_ rdp_seq_1_first = SET_NULL;
set_ rdp_seq_10_first = SET_NULL;
set_ rdp_seq_17_first = SET_NULL;
set_ rdp_seq_2_first = SET_NULL;
set_ rdp_seq_23_first = SET_NULL;
set_ rdp_seq_24_first = SET_NULL;
set_ rdp_seq_25_first = SET_NULL;
set_ rdp_seq_28_first = SET_NULL;
set_ rdp_seq_29_first = SET_NULL;
set_ rdp_seq_30_first = SET_NULL;
set_ rdp_seq_31_first = SET_NULL;
set_ rdp_seq_32_first = SET_NULL;
set_ rdp_seq_9_first = SET_NULL;
set_ rdp_unit_1_first = SET_NULL;
set_ rdp_unit_2_first = SET_NULL;
set_ rdp_unit_3_first = SET_NULL;
set_ rule_stop = SET_NULL;
set_ seq_first = SET_NULL;
set_ seq_stop = SET_NULL;
set_ token_stop = SET_NULL;
set_ unit_first = SET_NULL;
set_ unit_stop = SET_NULL;
/* Initialise sets */
static void rdp_set_initialise(void)
{
set_assign_list(&String_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_75 /* ] */, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */,
RDP_T_79 /* ^_ */, RDP_T_80 /* { */, RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&code_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_29 /* @ */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC,
RDP_T_COMMENT, RDP_T_COMMENT_LINE, RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST,
RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE, RDP_T_NEW_ID, RDP_T_NUMBER,
RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */, RDP_T_74 /* [* */, RDP_T_75 /* ] */,
RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, RDP_T_80 /* { */,
RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&comment_stop, SCAN_P_EOF,SET_END);
set_assign_list(&dir_first, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN, RDP_T_ARG_NUMERIC,
RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE, RDP_T_HASH_PRIME,
RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS, RDP_T_MAX_WARNINGS,
RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES, RDP_T_POST_PARSE,
RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE, RDP_T_SHOW_SKIPS,
RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE, RDP_T_TITLE,
RDP_T_TREE, RDP_T_USES, SET_END);
set_assign_list(&dir_stop, SCAN_P_ID, SCAN_P_EOF, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN,
RDP_T_ARG_NUMERIC, RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE,
RDP_T_HASH_PRIME, RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS,
RDP_T_MAX_WARNINGS, RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES,
RDP_T_POST_PARSE, RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE,
RDP_T_SHOW_SKIPS, RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE,
RDP_T_TITLE, RDP_T_TREE, RDP_T_USES,SET_END);
set_assign_list(&item_com_first, RDP_T_COMMENT, RDP_T_COMMENT_LINE, RDP_T_COMMENT_NEST, SET_END);
set_assign_list(&item_com_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_75 /* ] */, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */,
RDP_T_79 /* ^_ */, RDP_T_80 /* { */, RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&item_inl_first, RDP_T_19 /* ( */, RDP_T_27 /* < */, RDP_T_73 /* [ */, RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&item_inl_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_75 /* ] */, RDP_T_80 /* { */, RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&item_ret_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_ALT_ID,
RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST_VISIBLE,
RDP_T_COMMENT_VISIBLE, RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, SET_END);
set_assign_list(&item_ret_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_75 /* ] */, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */,
RDP_T_79 /* ^_ */, RDP_T_80 /* { */, RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&prod_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&prod_stop, SCAN_P_EOF, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_28 /* > */, RDP_T_75 /* ] */,
RDP_T_82 /* } */,SET_END);
set_assign_list(&rdp_dir_11_first, SCAN_P_ID, RDP_T_74 /* [* */, SET_END);
set_assign_list(&rdp_dir_3_first, SCAN_P_ID, RDP_T_74 /* [* */, SET_END);
set_assign_list(&rdp_dir_30_first, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_EPSILON_TREE, RDP_T_TREE, SET_END);
set_assign_list(&rdp_dir_33_first, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_EPSILON_TREE, RDP_T_TREE, SET_END);
set_assign_list(&rdp_dir_7_first, SCAN_P_ID, RDP_T_74 /* [* */, SET_END);
set_assign_list(&rdp_item_inl_14_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_item_inl_15_first, SCAN_P_INTEGER, RDP_T_29 /* @ */, SET_END);
set_assign_list(&rdp_item_inl_16_first, SCAN_P_INTEGER, RDP_T_29 /* @ */, SET_END);
set_assign_list(&rdp_item_inl_21_first, RDP_T_19 /* ( */, RDP_T_27 /* < */, RDP_T_73 /* [ */, RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_item_inl_22_first, RDP_T_19 /* ( */, RDP_T_27 /* < */, RDP_T_73 /* [ */, RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_item_inl_9_first, RDP_T_17 /* # */, RDP_T_18 /* ' */, SET_END);
set_assign_list(&rdp_item_ret_4_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, SET_END);
set_assign_list(&rdp_item_ret_5_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, SET_END);
set_assign_list(&rdp_item_ret_6_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, SET_END);
set_assign_list(&rdp_prod_0_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_prod_1_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_prod_2_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_rule_16_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_seq_0_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_ALT_ID,
RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST_VISIBLE,
RDP_T_COMMENT_VISIBLE, RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, SET_END);
set_assign_list(&rdp_seq_1_first, RDP_T_COMMENT, RDP_T_COMMENT_LINE, RDP_T_COMMENT_NEST, SET_END);
set_assign_list(&rdp_seq_10_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_ALT_ID,
RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE, RDP_T_COMMENT_LINE_VISIBLE,
RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE, RDP_T_NEW_ID,
RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, SET_END);
set_assign_list(&rdp_seq_17_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_seq_2_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_ALT_ID,
RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE, RDP_T_COMMENT_LINE_VISIBLE,
RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE, RDP_T_NEW_ID,
RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, SET_END);
set_assign_list(&rdp_seq_23_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_seq_24_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_seq_25_first, RDP_T_74 /* [* */, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_seq_28_first, RDP_T_19 /* ( */, RDP_T_27 /* < */, RDP_T_73 /* [ */, RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_seq_29_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_seq_30_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_seq_31_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_seq_32_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&rdp_seq_9_first, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */, RDP_T_79 /* ^_ */, SET_END);
set_assign_list(&rdp_unit_1_first, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN, RDP_T_ARG_NUMERIC,
RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE, RDP_T_HASH_PRIME,
RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS, RDP_T_MAX_WARNINGS,
RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES, RDP_T_POST_PARSE,
RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE, RDP_T_SHOW_SKIPS,
RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE, RDP_T_TITLE,
RDP_T_TREE, RDP_T_USES, SET_END);
set_assign_list(&rdp_unit_2_first, SCAN_P_ID, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN, RDP_T_ARG_NUMERIC,
RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE, RDP_T_HASH_PRIME,
RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS, RDP_T_MAX_WARNINGS,
RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES, RDP_T_POST_PARSE,
RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE, RDP_T_SHOW_SKIPS,
RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE, RDP_T_TITLE,
RDP_T_TREE, RDP_T_USES, SET_END);
set_assign_list(&rdp_unit_3_first, SCAN_P_ID, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN, RDP_T_ARG_NUMERIC,
RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE, RDP_T_HASH_PRIME,
RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS, RDP_T_MAX_WARNINGS,
RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES, RDP_T_POST_PARSE,
RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE, RDP_T_SHOW_SKIPS,
RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE, RDP_T_TITLE,
RDP_T_TREE, RDP_T_USES, SET_END);
set_assign_list(&rule_stop, SCAN_P_ID, SCAN_P_EOF, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN,
RDP_T_ARG_NUMERIC, RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE,
RDP_T_HASH_PRIME, RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS,
RDP_T_MAX_WARNINGS, RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES,
RDP_T_POST_PARSE, RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE,
RDP_T_SHOW_SKIPS, RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE,
RDP_T_TITLE, RDP_T_TREE, RDP_T_USES,SET_END);
set_assign_list(&seq_first, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, RDP_T_16 /* " */, RDP_T_18 /* ' */, RDP_T_19 /* ( */,
RDP_T_27 /* < */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_80 /* { */, SET_END);
set_assign_list(&seq_stop, SCAN_P_EOF, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_28 /* > */, RDP_T_75 /* ] */,
RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&token_stop, SCAN_P_ID, SCAN_P_INTEGER, SCAN_P_REAL, SCAN_P_EOF, RDP_T_16 /* " */, RDP_T_18 /* ' */,
RDP_T_19 /* ( */, RDP_T_21 /* ) */, RDP_T_23 /* . */, RDP_T_24 /* : */, RDP_T_27 /* < */,
RDP_T_28 /* > */, RDP_T_ALT_ID, RDP_T_CHAR, RDP_T_CHAR_ESC, RDP_T_COMMENT, RDP_T_COMMENT_LINE,
RDP_T_COMMENT_LINE_VISIBLE, RDP_T_COMMENT_NEST, RDP_T_COMMENT_NEST_VISIBLE, RDP_T_COMMENT_VISIBLE,
RDP_T_NEW_ID, RDP_T_NUMBER, RDP_T_STRING, RDP_T_STRING_ESC, RDP_T_73 /* [ */,
RDP_T_74 /* [* */, RDP_T_75 /* ] */, RDP_T_76 /* ^ */, RDP_T_77 /* ^^ */, RDP_T_78 /* ^^^ */,
RDP_T_79 /* ^_ */, RDP_T_80 /* { */, RDP_T_81 /* | */, RDP_T_82 /* } */,SET_END);
set_assign_list(&unit_first, SCAN_P_ID, RDP_T_ANNOTATED_EPSILON_TREE, RDP_T_ARG_BLANK, RDP_T_ARG_BOOLEAN, RDP_T_ARG_NUMERIC,
RDP_T_ARG_STRING, RDP_T_CASE_INSENSITIVE, RDP_T_EPSILON_TREE, RDP_T_HASH_PRIME,
RDP_T_HASH_SIZE, RDP_T_INCLUDE, RDP_T_INTERPRETER, RDP_T_MAX_ERRORS, RDP_T_MAX_WARNINGS,
RDP_T_OPTION, RDP_T_OUTPUT_FILE, RDP_T_PARSER, RDP_T_PASSES, RDP_T_POST_PARSE,
RDP_T_POST_PROCESS, RDP_T_PRE_PARSE, RDP_T_PRE_PROCESS, RDP_T_SET_SIZE, RDP_T_SHOW_SKIPS,
RDP_T_SUFFIX, RDP_T_SYMBOL_TABLE, RDP_T_TAB_WIDTH, RDP_T_TEXT_SIZE, RDP_T_TITLE,
RDP_T_TREE, RDP_T_USES, SET_END);
set_assign_list(&unit_stop, SCAN_P_EOF,SET_END);
}
/* Parser forward declarations and macros */
static char* String(void);
static char* code(void);
static void dir(void);
static rdp_data* item_com(void);
static rdp_data* item_inl(void);
static rdp_data* item_ret(void);
static rdp_list* prod(void);
static rdp_data* rule(void);
static rdp_list* seq(void);
static char* token(void);
void unit(void);
/* Parser functions */
static char* String(void)
{
char* result;
{
scan_test(NULL, RDP_T_16 /* " */, &String_stop);
result = SCAN_CAST->id;
scan_();
scan_test_set(NULL, &String_stop, &String_stop);
}
return result;
}
static char* code(void)
{
char* result;
{
scan_test(NULL, RDP_T_74 /* [* */, &code_stop);
result = SCAN_CAST->id;
scan_();
scan_test_set(NULL, &code_stop, &code_stop);
}
return result;
}
static void dir(void)
{
char* filename;
char* key;
char* var;
char* desc;
char* name;
long int size;
long int prime;
char* compare;
char* hash;
char* print;
char* data_fields;
char* s;
long int n;
char* str;
{
if (scan_test(NULL, RDP_T_INCLUDE, NULL))
{
scan_test(NULL, RDP_T_INCLUDE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
filename = code();
if (rdp_pass == 2) { \
if (text_open(filename) == NULL) \
text_message(TEXT_ERROR_ECHO, "include file '%s' not found\n", filename); \
text_get_char(); \
scan_(); \
\
}
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_ARG_BOOLEAN, NULL))
{
scan_test(NULL, RDP_T_ARG_BOOLEAN, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
key = SCAN_CAST->id;
scan_();
{ /* Start of rdp_dir_3 */
while (1)
{
scan_test_set(NULL, &rdp_dir_3_first, &dir_stop);
{
if (scan_test(NULL, SCAN_P_ID, NULL))
{
scan_test(NULL, SCAN_P_ID, &dir_stop);
var = SCAN_CAST->id;
scan_();
}
else
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{
var = code();
}
else
scan_test_set(NULL, &rdp_dir_3_first, &dir_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_3 */
desc = String();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
if (rdp_pass == 2) { \
rdp_add_arg(ARG_BOOLEAN, key, var, desc); \
}
}
else
if (scan_test(NULL, RDP_T_ARG_NUMERIC, NULL))
{
scan_test(NULL, RDP_T_ARG_NUMERIC, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
key = SCAN_CAST->id;
scan_();
{ /* Start of rdp_dir_7 */
while (1)
{
scan_test_set(NULL, &rdp_dir_7_first, &dir_stop);
{
if (scan_test(NULL, SCAN_P_ID, NULL))
{
scan_test(NULL, SCAN_P_ID, &dir_stop);
var = SCAN_CAST->id;
scan_();
}
else
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{
var = code();
}
else
scan_test_set(NULL, &rdp_dir_7_first, &dir_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_7 */
desc = String();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
if (rdp_pass == 2) { \
rdp_add_arg(ARG_NUMERIC, key, var, desc); \
}
}
else
if (scan_test(NULL, RDP_T_ARG_STRING, NULL))
{
scan_test(NULL, RDP_T_ARG_STRING, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
key = SCAN_CAST->id;
scan_();
{ /* Start of rdp_dir_11 */
while (1)
{
scan_test_set(NULL, &rdp_dir_11_first, &dir_stop);
{
if (scan_test(NULL, SCAN_P_ID, NULL))
{
scan_test(NULL, SCAN_P_ID, &dir_stop);
var = SCAN_CAST->id;
scan_();
}
else
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{
var = code();
}
else
scan_test_set(NULL, &rdp_dir_11_first, &dir_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_11 */
desc = String();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
if (rdp_pass == 2) { \
rdp_add_arg(ARG_STRING, key, var, desc); \
}
}
else
if (scan_test(NULL, RDP_T_ARG_BLANK, NULL))
{
scan_test(NULL, RDP_T_ARG_BLANK, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
desc = String();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
if (rdp_pass == 2) { \
rdp_add_arg(ARG_BLANK, NULL, NULL, desc); \
}
}
else
if (scan_test(NULL, RDP_T_SYMBOL_TABLE, NULL))
{
rdp_table_list *temp;
scan_test(NULL, RDP_T_SYMBOL_TABLE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
name = SCAN_CAST->id;
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
size = SCAN_CAST->data.i;
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
prime = SCAN_CAST->data.i;
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
compare = SCAN_CAST->id;
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
hash = SCAN_CAST->id;
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
print = SCAN_CAST->id;
scan_();
data_fields = code();
if (rdp_pass == 2) { \
temp = (rdp_table_list*) mem_malloc(sizeof(rdp_table_list)); \
temp->name = name; \
temp->size = (unsigned) size; \
temp->prime = (unsigned) prime; \
temp->compare = compare; \
temp->hash = hash; \
temp->print = print; \
temp->data_fields = data_fields; \
temp->next = rdp_dir_symbol_table; \
rdp_dir_symbol_table = temp; \
\
}
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_USES, NULL))
{
rdp_string_list *temp;
scan_test(NULL, RDP_T_USES, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = String();
if (rdp_pass == 2) { \
temp = (rdp_string_list*) mem_malloc(sizeof(rdp_string_list)); \
temp->str1 = s; \
temp->next = rdp_dir_include; \
rdp_dir_include = temp; \
\
}
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_OUTPUT_FILE, NULL))
{
scan_test(NULL, RDP_T_OUTPUT_FILE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = String();
rdp_dir_output_file = s;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_PARSER, NULL))
{
scan_test(NULL, RDP_T_PARSER, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &dir_stop);
name = SCAN_CAST->id;
scan_();
if (rdp_pass == 2) { \
rdp_start_prod = rdp_find(name, K_PRIMARY, RDP_OLD); rdp_start_prod->call_count++; \
}
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_POST_PARSE, NULL))
{
scan_test(NULL, RDP_T_POST_PARSE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = code();
rdp_dir_post_parse = s;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_PRE_PARSE, NULL))
{
scan_test(NULL, RDP_T_PRE_PARSE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = code();
rdp_dir_pre_parse = s;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_SUFFIX, NULL))
{
scan_test(NULL, RDP_T_SUFFIX, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = String();
rdp_dir_suffix = s;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_TITLE, NULL))
{
scan_test(NULL, RDP_T_TITLE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
s = String();
rdp_dir_title = s;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_MAX_ERRORS, NULL))
{
scan_test(NULL, RDP_T_MAX_ERRORS, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
n = SCAN_CAST->data.i;
scan_();
rdp_dir_max_errors = (unsigned) n;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_MAX_WARNINGS, NULL))
{
scan_test(NULL, RDP_T_MAX_WARNINGS, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
n = SCAN_CAST->data.i;
scan_();
rdp_dir_max_warnings = (unsigned) n;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_PASSES, NULL))
{
scan_test(NULL, RDP_T_PASSES, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
n = SCAN_CAST->data.i;
scan_();
rdp_dir_passes = (unsigned) n;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_TAB_WIDTH, NULL))
{
scan_test(NULL, RDP_T_TAB_WIDTH, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
n = SCAN_CAST->data.i;
scan_();
rdp_dir_tab_width = (unsigned) n;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_TEXT_SIZE, NULL))
{
scan_test(NULL, RDP_T_TEXT_SIZE, &dir_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
n = SCAN_CAST->data.i;
scan_();
rdp_dir_text_size = (unsigned) n;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test_set(NULL, &rdp_dir_33_first, NULL))
{
{ /* Start of rdp_dir_30 */
while (1)
{
scan_test_set(NULL, &rdp_dir_30_first, &dir_stop);
{
if (scan_test(NULL, RDP_T_ANNOTATED_EPSILON_TREE, NULL))
{
scan_test(NULL, RDP_T_ANNOTATED_EPSILON_TREE, &dir_stop);
scan_();
rdp_dir_annotated_epsilon_tree = 1; rdp_dir_epsilon_tree = 1;
}
else
if (scan_test(NULL, RDP_T_EPSILON_TREE, NULL))
{
scan_test(NULL, RDP_T_EPSILON_TREE, &dir_stop);
scan_();
rdp_dir_epsilon_tree = 1;
}
else
if (scan_test(NULL, RDP_T_TREE, NULL))
{
scan_test(NULL, RDP_T_TREE, &dir_stop);
scan_();
}
else
scan_test_set(NULL, &rdp_dir_30_first, &dir_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_30 */
if (rdp_pass == 1) { \
rdp_dir_tree = 1; \
}
if (scan_test(NULL, RDP_T_19 /* ( */, NULL))
{ /* Start of rdp_dir_32 */
while (1)
{
{
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
str = code();
rdp_dir_tree_fields = str;
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_32 */
}
else
if (scan_test(NULL, RDP_T_CASE_INSENSITIVE, NULL))
{
scan_test(NULL, RDP_T_CASE_INSENSITIVE, &dir_stop);
scan_();
rdp_dir_case_insensitive = 1;
}
else
if (scan_test(NULL, RDP_T_SHOW_SKIPS, NULL))
{
scan_test(NULL, RDP_T_SHOW_SKIPS, &dir_stop);
scan_();
rdp_dir_show_skips = 1;
}
else
if (scan_test(NULL, RDP_T_OPTION, NULL))
{
scan_test(NULL, RDP_T_OPTION, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: OPTION replaced by ARG_* at version 1.5\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
String();
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{ /* Start of rdp_dir_37 */
while (1)
{
{
code();
}
break; /* hi limit is 1! */
}
} /* end of rdp_dir_37 */
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_PRE_PROCESS, NULL))
{
scan_test(NULL, RDP_T_PRE_PROCESS, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: PRE_PROCESS renamed PRE_PARSE at version 1.3\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
code();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_POST_PROCESS, NULL))
{
scan_test(NULL, RDP_T_POST_PROCESS, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: POST_PROCESS renamed POST_PARSE at version 1.3\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
code();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_SET_SIZE, NULL))
{
scan_test(NULL, RDP_T_SET_SIZE, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: SET_SIZE deleted at version 1.4\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
scan_();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_HASH_SIZE, NULL))
{
scan_test(NULL, RDP_T_HASH_SIZE, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: HASH_SIZE replaced by SYMBOL_TABLE at version 1.4\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
scan_();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_HASH_PRIME, NULL))
{
scan_test(NULL, RDP_T_HASH_PRIME, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: HASH_PRIME replaced by SYMBOL_TABLE at version 1.4\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
scan_();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
if (scan_test(NULL, RDP_T_INTERPRETER, NULL))
{
scan_test(NULL, RDP_T_INTERPRETER, &dir_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete directive: INTERPRETER mode deleted at version 1.4\n");
scan_test(NULL, RDP_T_19 /* ( */, &dir_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &dir_stop);
scan_();
scan_test(NULL, RDP_T_21 /* ) */, &dir_stop);
scan_();
}
else
scan_test_set(NULL, &dir_first, &dir_stop) ;
scan_test_set(NULL, &dir_stop, &dir_stop);
}
}
static rdp_data* item_com(void)
{
rdp_data* result;
char* name;
char* close;
{
if (scan_test(NULL, RDP_T_COMMENT, NULL))
{
scan_test(NULL, RDP_T_COMMENT, &item_com_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_com_stop);
scan_();
name = token();
close = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_com_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, close, SCAN_P_COMMENT); \
}
}
else
if (scan_test(NULL, RDP_T_COMMENT_LINE, NULL))
{
scan_test(NULL, RDP_T_COMMENT_LINE, &item_com_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_com_stop);
scan_();
name = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_com_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, NULL, SCAN_P_COMMENT_LINE); \
}
}
else
if (scan_test(NULL, RDP_T_COMMENT_NEST, NULL))
{
scan_test(NULL, RDP_T_COMMENT_NEST, &item_com_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_com_stop);
scan_();
name = token();
close = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_com_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, close, SCAN_P_COMMENT_NEST); \
}
}
else
scan_test_set(NULL, &item_com_first, &item_com_stop) ;
scan_test_set(NULL, &item_com_stop, &item_com_stop);
}
return result;
}
static rdp_data* item_inl(void)
{
rdp_data* result;
char* name;
long int pass;
rdp_list* body;
long int val;
char* delimiter;
{
int promote_op = PROMOTE_DEFAULT;
{ /* Start of rdp_item_inl_21 */
while (1)
{
scan_test_set(NULL, &rdp_item_inl_21_first, &item_inl_stop);
{
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{
name = code();
if (rdp_pass == 2) { \
result = rdp_find(name, K_CODE, RDP_ANY); \
result->contains_null = 1; \
result->call_count++; /* increment call count */ \
\
}
if (scan_test(NULL, RDP_T_29 /* @ */, NULL))
{ /* Start of rdp_item_inl_1 */
while (1)
{
{
scan_test(NULL, RDP_T_29 /* @ */, &item_inl_stop);
scan_();
scan_test(NULL, SCAN_P_INTEGER, &item_inl_stop);
pass = SCAN_CAST->data.i;
scan_();
if (rdp_pass == 2) { \
result->code_pass = (unsigned) pass; \
}
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_1 */
}
else
if (scan_test(NULL, RDP_T_19 /* ( */, NULL))
{
scan_test(NULL, RDP_T_19 /* ( */, &item_inl_stop);
scan_();
body = prod();
scan_test(NULL, RDP_T_21 /* ) */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find(text_insert_substring("rdp", rdp_primary_id, rdp_component++), K_LIST, RDP_ANY); \
result->promote = promote_op; \
result->list = body; \
result->call_count++; \
result->lo = 1; \
result->hi = 1; \
\
}
if (scan_test_set(NULL, &rdp_item_inl_16_first, NULL))
{ /* Start of rdp_item_inl_16 */
while (1)
{
{
if (scan_test(NULL, SCAN_P_INTEGER, NULL))
{ /* Start of rdp_item_inl_4 */
while (1)
{
{
scan_test(NULL, SCAN_P_INTEGER, &item_inl_stop);
val = SCAN_CAST->data.i;
scan_();
if (rdp_pass == 2) { \
result->lo = val; \
}
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_4 */
scan_test(NULL, RDP_T_29 /* @ */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result->hi = 0; /* iterate for ever by default */ \
}
if (scan_test(NULL, SCAN_P_INTEGER, NULL))
{ /* Start of rdp_item_inl_6 */
while (1)
{
{
scan_test(NULL, SCAN_P_INTEGER, &item_inl_stop);
val = SCAN_CAST->data.i;
scan_();
if (rdp_pass == 2) { \
result->hi = val; \
}
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_6 */
if (rdp_pass == 2) { \
if (result->lo == 0) result->contains_null = 1; \
if (result->hi != 0 && (result->hi < result->lo)) \
text_message(TEXT_ERROR_ECHO,"Iterator high count must be greater than low count"); \
\
}if (rdp_pass == 2) { \
result->delimiter_promote = PROMOTE_DONT; \
}
{ /* Start of rdp_item_inl_9 */
while (1)
{
scan_test_set(NULL, &rdp_item_inl_9_first, &item_inl_stop);
{
if (scan_test(NULL, RDP_T_18 /* ' */, NULL))
{
delimiter = token();
if (rdp_pass == 2) { \
result->supplementary_token = rdp_find(delimiter, K_TOKEN, RDP_ANY); \
}
}
else
if (scan_test(NULL, RDP_T_17 /* # */, NULL))
{
scan_test(NULL, RDP_T_17 /* # */, &item_inl_stop);
scan_();
}
else
scan_test_set(NULL, &rdp_item_inl_9_first, &item_inl_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_9 */
if (scan_test_set(NULL, &rdp_item_inl_14_first, NULL))
{ /* Start of rdp_item_inl_14 */
while (1)
{
{
if (scan_test(NULL, RDP_T_79 /* ^_ */, NULL))
{
scan_test(NULL, RDP_T_79 /* ^_ */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result->delimiter_promote = PROMOTE_DONT; \
}
}
else
if (scan_test(NULL, RDP_T_76 /* ^ */, NULL))
{
scan_test(NULL, RDP_T_76 /* ^ */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result->delimiter_promote = PROMOTE; \
}
}
else
if (scan_test(NULL, RDP_T_77 /* ^^ */, NULL))
{
scan_test(NULL, RDP_T_77 /* ^^ */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result->delimiter_promote = PROMOTE_AND_COPY; \
}
}
else
if (scan_test(NULL, RDP_T_78 /* ^^^ */, NULL))
{
scan_test(NULL, RDP_T_78 /* ^^^ */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result->delimiter_promote = PROMOTE_ABOVE; \
}
}
else
scan_test_set(NULL, &rdp_item_inl_14_first, &item_inl_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_14 */
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_16 */
}
else
if (scan_test(NULL, RDP_T_80 /* { */, NULL))
{
scan_test(NULL, RDP_T_80 /* { */, &item_inl_stop);
scan_();
body = prod();
scan_test(NULL, RDP_T_82 /* } */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find(text_insert_substring("rdp", rdp_primary_id, rdp_component++), K_LIST, RDP_ANY); \
result->promote = promote_op; \
result->list = body; result->contains_null = 1; \
result->call_count++; \
result->lo = 0; \
result->hi = 0; \
\
}
}
else
if (scan_test(NULL, RDP_T_73 /* [ */, NULL))
{
scan_test(NULL, RDP_T_73 /* [ */, &item_inl_stop);
scan_();
body = prod();
scan_test(NULL, RDP_T_75 /* ] */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find(text_insert_substring("rdp", rdp_primary_id, rdp_component++), K_LIST, RDP_ANY); \
result->promote = promote_op; \
result->list = body; result->contains_null = 1; \
result->call_count++; \
result->lo = 0; \
result->hi = 1; \
\
}
}
else
if (scan_test(NULL, RDP_T_27 /* < */, NULL))
{
scan_test(NULL, RDP_T_27 /* < */, &item_inl_stop);
scan_();
body = prod();
scan_test(NULL, RDP_T_28 /* > */, &item_inl_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find(text_insert_substring("rdp", rdp_primary_id, rdp_component++), K_LIST, RDP_ANY); \
result->promote = promote_op; \
result->list = body; \
result->call_count++; \
result->lo = 1; \
result->hi = 0; \
\
}
}
else
scan_test_set(NULL, &rdp_item_inl_21_first, &item_inl_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_inl_21 */
scan_test_set(NULL, &item_inl_stop, &item_inl_stop);
}
return result;
}
static rdp_data* item_ret(void)
{
rdp_data* result;
char* name;
long int n;
double r;
char* str;
char* quote;
char* close;
{
if (scan_test(NULL, SCAN_P_ID, NULL))
{
scan_test(NULL, SCAN_P_ID, &item_ret_stop);
name = SCAN_CAST->id;
scan_();
if (rdp_pass == 2) { \
result = rdp_find(name, K_PRIMARY, RDP_OLD); \
rdp_check_eoln(name); \
result->call_count++; /* increment call count */ \
result->actuals = NULL; \
\
} if (rdp_pass == 2 && result->parameterised ) {
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
if (scan_test_set(NULL, &rdp_item_ret_6_first, NULL))
{ /* Start of rdp_item_ret_6 */
while (1)
{
{
rdp_param_list *param;
{ /* Start of rdp_item_ret_4 */
while (1)
{
scan_test_set(NULL, &rdp_item_ret_4_first, &item_ret_stop);
{
if (scan_test(NULL, SCAN_P_INTEGER, NULL))
{
scan_test(NULL, SCAN_P_INTEGER, &item_ret_stop);
n = SCAN_CAST->data.i;
scan_();
if (rdp_pass == 2) { \
param = (rdp_param_list* ) mem_calloc(sizeof(rdp_param_list), 1); \
param->n = n; \
param->next = result->actuals; \
result->actuals = param; \
param->flavour = PARAM_INTEGER; \
\
}
}
else
if (scan_test(NULL, SCAN_P_REAL, NULL))
{
scan_test(NULL, SCAN_P_REAL, &item_ret_stop);
r = SCAN_CAST->data.r;
scan_();
if (rdp_pass == 2) { \
param = (rdp_param_list* ) mem_calloc(sizeof(rdp_param_list), 1); \
param->r = r; \
param->next = result->actuals; \
result->actuals = param; \
param->flavour = PARAM_REAL; \
\
}
}
else
if (scan_test(NULL, RDP_T_16 /* " */, NULL))
{
str = String();
if (rdp_pass == 2) { \
param = (rdp_param_list* ) mem_calloc(sizeof(rdp_param_list), 1); \
param->id = str; \
param->next = result->actuals; \
result->actuals = param; \
param->flavour = PARAM_STRING; \
\
}
}
else
if (scan_test(NULL, SCAN_P_ID, NULL))
{
scan_test(NULL, SCAN_P_ID, &item_ret_stop);
name = SCAN_CAST->id;
scan_();
if (rdp_pass == 2) { \
param = (rdp_param_list* ) mem_calloc(sizeof(rdp_param_list), 1); \
param->id = name; \
param->next = result->actuals; \
result->actuals = param; \
param->flavour = PARAM_ID; \
\
}
}
else
scan_test_set(NULL, &rdp_item_ret_4_first, &item_ret_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_item_ret_4 */
}
if (!scan_test_set(NULL, &rdp_item_ret_6_first, NULL)) break;
}
} /* end of rdp_item_ret_6 */
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
}
}
else
if (scan_test(NULL, RDP_T_18 /* ' */, NULL))
{
name = token();
if (rdp_pass == 2) { \
result = (rdp_data*) rdp_process_token(name); \
}
}
else
if (scan_test(NULL, RDP_T_CHAR, NULL))
{
scan_test(NULL, RDP_T_CHAR, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, NULL, SCAN_P_CHAR); \
}
}
else
if (scan_test(NULL, RDP_T_CHAR_ESC, NULL))
{
scan_test(NULL, RDP_T_CHAR_ESC, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
quote = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, quote, SCAN_P_CHAR_ESC); \
}
}
else
if (scan_test(NULL, RDP_T_STRING, NULL))
{
scan_test(NULL, RDP_T_STRING, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, NULL, SCAN_P_STRING); \
}
}
else
if (scan_test(NULL, RDP_T_STRING_ESC, NULL))
{
scan_test(NULL, RDP_T_STRING_ESC, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
quote = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, quote, SCAN_P_STRING_ESC); \
}
}
else
if (scan_test(NULL, RDP_T_COMMENT_VISIBLE, NULL))
{
scan_test(NULL, RDP_T_COMMENT_VISIBLE, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
close = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, close, SCAN_P_COMMENT_VISIBLE); \
}
}
else
if (scan_test(NULL, RDP_T_COMMENT_NEST_VISIBLE, NULL))
{
scan_test(NULL, RDP_T_COMMENT_NEST_VISIBLE, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
close = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, close, SCAN_P_COMMENT_NEST_VISIBLE); \
}
}
else
if (scan_test(NULL, RDP_T_COMMENT_LINE_VISIBLE, NULL))
{
scan_test(NULL, RDP_T_COMMENT_LINE_VISIBLE, &item_ret_stop);
scan_();
scan_test(NULL, RDP_T_19 /* ( */, &item_ret_stop);
scan_();
name = token();
scan_test(NULL, RDP_T_21 /* ) */, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
result = rdp_find_extended(name, NULL, SCAN_P_COMMENT_LINE_VISIBLE); \
}
}
else
if (scan_test(NULL, RDP_T_NUMBER, NULL))
{
scan_test(NULL, RDP_T_NUMBER, &item_ret_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete scanner primitive: NUMBER renamed INTEGER at version 1.3\n");
}
else
if (scan_test(NULL, RDP_T_NEW_ID, NULL))
{
scan_test(NULL, RDP_T_NEW_ID, &item_ret_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete scanner primitive: NEW_ID deleted at version 1.4\n");
}
else
if (scan_test(NULL, RDP_T_ALT_ID, NULL))
{
scan_test(NULL, RDP_T_ALT_ID, &item_ret_stop);
scan_();
text_message(TEXT_ERROR_ECHO, "Obsolete scanner primitive: ALT_ID deleted at version 1.4\n");
}
else
if (scan_test(NULL, RDP_T_16 /* " */, NULL))
{
str = String();
if (rdp_pass == 2) { \
text_message(TEXT_ERROR_ECHO, "Illegal grammar element: perhaps you intended to write '%s'\n", str); \
}
}
else
if (scan_test(NULL, SCAN_P_INTEGER, NULL))
{
scan_test(NULL, SCAN_P_INTEGER, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
text_message(TEXT_ERROR_ECHO, "Illegal grammar element: an integer may not appear here\n"); \
}
}
else
if (scan_test(NULL, SCAN_P_REAL, NULL))
{
scan_test(NULL, SCAN_P_REAL, &item_ret_stop);
scan_();
if (rdp_pass == 2) { \
text_message(TEXT_ERROR_ECHO, "Illegal grammar element: a real may not appear here\n"); \
}
}
else
scan_test_set(NULL, &item_ret_first, &item_ret_stop) ;
scan_test_set(NULL, &item_ret_stop, &item_ret_stop);
}
return result;
}
static rdp_list* prod(void)
{
rdp_list* result;
rdp_list* body;
{
rdp_list* end; if (rdp_pass == 2) { \
end = result = (rdp_list*) mem_calloc(sizeof(rdp_list), 1); \
}
{ /* Start of rdp_prod_1 */
while (1)
{
scan_test_set(NULL, &rdp_prod_1_first, &prod_stop);
{
body = seq();
if (rdp_pass == 2) { \
end->next = (rdp_list*) mem_calloc(sizeof(rdp_list), 1); \
end = end->next; \
end->production = rdp_find(text_insert_substring("rdp", rdp_primary_id, rdp_component++), K_SEQUENCE, RDP_NEW); \
end->production->call_count++; \
end->production->list = body; \
\
}
}
if (SCAN_CAST->token != RDP_T_81 /* | */) break;
scan_();
}
} /* end of rdp_prod_1 */
if (rdp_pass == 2) { \
result = result->next; \
}
scan_test_set(NULL, &prod_stop, &prod_stop);
}
return result;
}
static rdp_data* rule(void)
{
rdp_data* result;
char* name;
char* type;
rdp_list* body;
{
unsigned stars;
scan_test(NULL, SCAN_P_ID, &rule_stop);
name = SCAN_CAST->id;
scan_();
rdp_primary_id = name; rdp_component = 0; \
rdp_rule_count++; \
result = rdp_find(rdp_primary_id, K_PRIMARY, rdp_pass == 1 ? RDP_NEW : RDP_OLD); \
if (rdp_start_prod == NULL) \
{ \
rdp_start_prod = result; \
result->call_count++; \
} \
if (scan_test(NULL, RDP_T_19 /* ( */, NULL))
{ /* Start of rdp_rule_7 */
while (1)
{
{
scan_test(NULL, RDP_T_19 /* ( */, &rule_stop);
scan_();
result->parameterised = 1;
if (scan_test(NULL, SCAN_P_ID, NULL))
{ /* Start of rdp_rule_5 */
while (1)
{
{
rdp_param_list *param; type = "void";
scan_test(NULL, SCAN_P_ID, &rule_stop);
name = SCAN_CAST->id;
scan_();
if (scan_test(NULL, RDP_T_24 /* : */, NULL))
{ /* Start of rdp_rule_3 */
while (1)
{
{
scan_test(NULL, RDP_T_24 /* : */, &rule_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &rule_stop);
type = SCAN_CAST->id;
scan_();
stars = 0;
if (scan_test(NULL, RDP_T_22 /* * */, NULL))
{ /* Start of rdp_rule_1 */
while (1)
{
{
scan_test(NULL, RDP_T_22 /* * */, &rule_stop);
scan_();
stars++;
}
if (!scan_test(NULL, RDP_T_22 /* * */, NULL)) break;
}
} /* end of rdp_rule_1 */
}
break; /* hi limit is 1! */
}
} /* end of rdp_rule_3 */
if (rdp_pass == 1) { \
param = (rdp_param_list* ) mem_calloc(sizeof(rdp_param_list), 1); \
param->id = name; \
param->type = type; \
param->stars = stars; \
param->next = result->params; \
result->params = param; \
\
}
}
if (!scan_test(NULL, SCAN_P_ID, NULL)) break;
}
} /* end of rdp_rule_5 */
scan_test(NULL, RDP_T_21 /* ) */, &rule_stop);
scan_();
}
break; /* hi limit is 1! */
}
} /* end of rdp_rule_7 */
type = "void"; stars = 0;
if (scan_test(NULL, RDP_T_24 /* : */, NULL))
{ /* Start of rdp_rule_11 */
while (1)
{
{
scan_test(NULL, RDP_T_24 /* : */, &rule_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &rule_stop);
type = SCAN_CAST->id;
scan_();
if (scan_test(NULL, RDP_T_22 /* * */, NULL))
{ /* Start of rdp_rule_9 */
while (1)
{
{
scan_test(NULL, RDP_T_22 /* * */, &rule_stop);
scan_();
stars++;
}
if (!scan_test(NULL, RDP_T_22 /* * */, NULL)) break;
}
} /* end of rdp_rule_9 */
}
break; /* hi limit is 1! */
}
} /* end of rdp_rule_11 */
if (rdp_pass == 2) { \
result->promote_default = PROMOTE_DONT; \
}
if (scan_test_set(NULL, &rdp_rule_16_first, NULL))
{ /* Start of rdp_rule_16 */
while (1)
{
{
if (scan_test(NULL, RDP_T_79 /* ^_ */, NULL))
{
scan_test(NULL, RDP_T_79 /* ^_ */, &rule_stop);
scan_();
if (rdp_pass == 2) { \
result->promote_default = PROMOTE_DONT; \
}
}
else
if (scan_test(NULL, RDP_T_76 /* ^ */, NULL))
{
scan_test(NULL, RDP_T_76 /* ^ */, &rule_stop);
scan_();
if (rdp_pass == 2) { \
result->promote_default = PROMOTE; \
}
}
else
if (scan_test(NULL, RDP_T_77 /* ^^ */, NULL))
{
scan_test(NULL, RDP_T_77 /* ^^ */, &rule_stop);
scan_();
if (rdp_pass == 2) { \
result->promote_default = PROMOTE_AND_COPY; \
}
}
else
if (scan_test(NULL, RDP_T_78 /* ^^^ */, NULL))
{
scan_test(NULL, RDP_T_78 /* ^^^ */, &rule_stop);
scan_();
if (rdp_pass == 2) { \
result->promote_default = PROMOTE_ABOVE; \
}
}
else
scan_test_set(NULL, &rdp_rule_16_first, &rule_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_rule_16 */
rdp_comment_only = 1; /* set comments only flag */
scan_test(NULL, RDP_T_26 /* ::= */, &rule_stop);
scan_();
body = prod();
if (rdp_pass == 2) { \
rdp_rule_count++; \
result->list = body; \
result->been_defined = 1; \
result->return_type = type; \
result->return_type_stars = stars; \
result->comment_only = rdp_comment_only; \
\
}
scan_test(NULL, RDP_T_23 /* . */, &rule_stop);
scan_();
scan_test_set(NULL, &rule_stop, &rule_stop);
}
return result;
}
static rdp_list* seq(void)
{
rdp_list* result;
rdp_data* body;
char* ret_name;
char* default_action;
{
rdp_list* end; int promote_op; int promote_epsilon; if (rdp_pass == 2) { \
end = result = (rdp_list*) mem_calloc(sizeof(rdp_list), 1); \
}
{ /* Start of rdp_seq_31 */
while (1)
{
scan_test_set(NULL, &rdp_seq_31_first, &seq_stop);
{
if (rdp_pass == 2) { \
ret_name = NULL; promote_epsilon = PROMOTE_DONT; promote_op = PROMOTE_DEFAULT; \
}
{ /* Start of rdp_seq_29 */
while (1)
{
scan_test_set(NULL, &rdp_seq_29_first, &seq_stop);
{
if (scan_test_set(NULL, &rdp_seq_10_first, NULL))
{
{ /* Start of rdp_seq_2 */
while (1)
{
scan_test_set(NULL, &rdp_seq_2_first, &seq_stop);
{
if (scan_test_set(NULL, &rdp_seq_0_first, NULL))
{
body = item_ret();
rdp_comment_only = 0;
}
else
if (scan_test_set(NULL, &rdp_seq_1_first, NULL))
{
body = item_com();
}
else
scan_test_set(NULL, &rdp_seq_2_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_2 */
if (scan_test(NULL, RDP_T_24 /* : */, NULL))
{ /* Start of rdp_seq_4 */
while (1)
{
{
scan_test(NULL, RDP_T_24 /* : */, &seq_stop);
scan_();
scan_test(NULL, SCAN_P_ID, &seq_stop);
ret_name = SCAN_CAST->id;
scan_();
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_4 */
if (scan_test_set(NULL, &rdp_seq_9_first, NULL))
{ /* Start of rdp_seq_9 */
while (1)
{
{
if (scan_test(NULL, RDP_T_79 /* ^_ */, NULL))
{
scan_test(NULL, RDP_T_79 /* ^_ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_op = PROMOTE_DONT; \
}
}
else
if (scan_test(NULL, RDP_T_76 /* ^ */, NULL))
{
scan_test(NULL, RDP_T_76 /* ^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_op = PROMOTE; \
}
}
else
if (scan_test(NULL, RDP_T_77 /* ^^ */, NULL))
{
scan_test(NULL, RDP_T_77 /* ^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_op = PROMOTE_AND_COPY; \
}
}
else
if (scan_test(NULL, RDP_T_78 /* ^^^ */, NULL))
{
scan_test(NULL, RDP_T_78 /* ^^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_op = PROMOTE_ABOVE; \
}
}
else
scan_test_set(NULL, &rdp_seq_9_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_9 */
}
else
if (scan_test_set(NULL, &rdp_seq_28_first, NULL))
{
body = item_inl();
rdp_comment_only = 0;
if (rdp_pass == 2) { \
promote_op=body->promote; default_action = NULL; \
}
if (scan_test(NULL, RDP_T_24 /* : */, NULL))
{ /* Start of rdp_seq_27 */
while (1)
{
{
scan_test(NULL, RDP_T_24 /* : */, &seq_stop);
scan_();
if (scan_test(NULL, SCAN_P_ID, NULL))
{ /* Start of rdp_seq_12 */
while (1)
{
{
scan_test(NULL, SCAN_P_ID, &seq_stop);
scan_();
if (rdp_pass == 2) { \
text_message(TEXT_ERROR_ECHO,"Illegal grammar element: expressions may not retun a value"); \
}
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_12 */
if (scan_test_set(NULL, &rdp_seq_25_first, NULL))
{ /* Start of rdp_seq_25 */
while (1)
{
{
if (scan_test(NULL, RDP_T_74 /* [* */, NULL))
{
default_action = code();
if (scan_test_set(NULL, &rdp_seq_17_first, NULL))
{ /* Start of rdp_seq_17 */
while (1)
{
{
if (scan_test(NULL, RDP_T_79 /* ^_ */, NULL))
{
scan_test(NULL, RDP_T_79 /* ^_ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_DONT; \
}
}
else
if (scan_test(NULL, RDP_T_76 /* ^ */, NULL))
{
scan_test(NULL, RDP_T_76 /* ^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE; \
}
}
else
if (scan_test(NULL, RDP_T_77 /* ^^ */, NULL))
{
scan_test(NULL, RDP_T_77 /* ^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_AND_COPY; \
}
}
else
if (scan_test(NULL, RDP_T_78 /* ^^^ */, NULL))
{
scan_test(NULL, RDP_T_78 /* ^^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_ABOVE; \
}
}
else
scan_test_set(NULL, &rdp_seq_17_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_17 */
}
else
if (scan_test_set(NULL, &rdp_seq_24_first, NULL))
{
{ /* Start of rdp_seq_23 */
while (1)
{
scan_test_set(NULL, &rdp_seq_23_first, &seq_stop);
{
if (scan_test(NULL, RDP_T_79 /* ^_ */, NULL))
{
scan_test(NULL, RDP_T_79 /* ^_ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_DONT; \
}
}
else
if (scan_test(NULL, RDP_T_76 /* ^ */, NULL))
{
scan_test(NULL, RDP_T_76 /* ^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE; \
}
}
else
if (scan_test(NULL, RDP_T_77 /* ^^ */, NULL))
{
scan_test(NULL, RDP_T_77 /* ^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_AND_COPY; \
}
}
else
if (scan_test(NULL, RDP_T_78 /* ^^^ */, NULL))
{
scan_test(NULL, RDP_T_78 /* ^^^ */, &seq_stop);
scan_();
if (rdp_pass == 2) { \
promote_epsilon = PROMOTE_ABOVE; \
}
}
else
scan_test_set(NULL, &rdp_seq_23_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_23 */
}
else
scan_test_set(NULL, &rdp_seq_25_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_25 */
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_27 */
}
else
scan_test_set(NULL, &rdp_seq_29_first, &seq_stop) ;
}
break; /* hi limit is 1! */
}
} /* end of rdp_seq_29 */
if (rdp_pass == 2) { \
end->next = (rdp_list*) mem_calloc(sizeof(rdp_list), 1); \
end = end->next; \
end->production = body; \
end->actuals = body->actuals; \
end->return_name = ret_name; \
end->promote = promote_op; \
end->promote_epsilon = promote_epsilon; \
end->default_action = default_action; \
\
}
}
if (!scan_test_set(NULL, &rdp_seq_31_first, NULL)) break;
}
} /* end of rdp_seq_31 */
if (rdp_pass == 2) { \
result = result->next; \
}
scan_test_set(NULL, &seq_stop, &seq_stop);
}
return result;
}
static char* token(void)
{
char* result;
{
scan_test(NULL, RDP_T_18 /* ' */, &token_stop);
result = SCAN_CAST->id;
scan_();
scan_test_set(NULL, &token_stop, &token_stop);
}
return result;
}
void unit(void)
{
{
if (scan_test_set(NULL, &rdp_unit_2_first, NULL))
{ /* Start of rdp_unit_2 */
while (1)
{
{
if (scan_test(NULL, SCAN_P_ID, NULL))
{
rule();
}
else
if (scan_test_set(NULL, &rdp_unit_1_first, NULL))
{
dir();
}
else
scan_test_set(NULL, &rdp_unit_2_first, &unit_stop) ;
}
if (!scan_test_set(NULL, &rdp_unit_2_first, NULL)) break;
}
} /* end of rdp_unit_2 */
if (rdp_rule_count == 0) text_message(TEXT_FATAL,"no rule definitions found\n");
scan_test_set(NULL, &unit_stop, &unit_stop);
}
}
int main(int argc, char *argv[])
{
clock_t rdp_finish_time, rdp_start_time = clock();
int
rdp_symbol_statistics = 0, /* show symbol_ table statistics flag */
rdp_line_echo_all = 0, /* make a listing on all passes flag */
rdp_filter = 0, /* filter flag */
rdp_line_echo = 0; /* make listing flag */
unsigned long rdp_textsize = 34000l; /* size of scanner text array */
unsigned long rdp_tabwidth = 8l; /* tab expansion width */
char* rdp_vcg_filename = NULL; /* filename for -V option */
arg_message("Recursive descent parser generator V1.50 (c) Adrian Johnstone 1997\n" RDP_STAMP "\n\n""Usage: rdp [options] source[.bnf]");
arg_message("");
arg_boolean('f', "Filter mode (read from stdin and write to stdout)", &rdp_filter);
arg_boolean('l', "Make a listing", &rdp_line_echo);
arg_string ('o', "Write output to filename", &rdp_outputfilename);
arg_boolean('s', "Echo each scanner symbol as it is read", &rdp_symbol_echo);
arg_boolean('S', "Print summary symbol table statistics", &rdp_symbol_statistics);
arg_numeric('t', "Tab expansion width (default 8)", &rdp_tabwidth);
arg_numeric('T', "Text buffer size in bytes for scanner (default 20000)", &rdp_textsize);
arg_boolean('v', "Set verbose mode", &rdp_verbose);
arg_string ('V', "Write derivation tree to filename in VCG format", &rdp_vcg_filename);
arg_message("");
arg_boolean('e', "Write out expanded BNF along with first and follow sets", &rdp_expanded);
arg_boolean('E', "Add rule name to error messages in generated parser", &rdp_error_production_name);
arg_boolean('F', "Force creation of output files", &rdp_force);
arg_boolean('p', "Make parser only (omit semantic actions from generated code)", &rdp_parser_only);
arg_boolean('R', "Add rule entry and exit messages", &rdp_trace);
arg_message("");
arg_message("You can contact the author (Adrian Johnstone) at:");
arg_message("");
arg_message("Computer Science Department, Royal Holloway, University of London");
arg_message("Egham, Surrey, TW20 0EX UK. Email: A.Johnstone@rhbnc.ac.uk");
rdp_sourcefilename = *arg_process(argc, argv);
if (rdp_filter)
{
rdp_sourcefilename = "-";
rdp_outputfilename = "-";
}
if (rdp_sourcefilename == NULL)
arg_help("No source file specified");
rdp_sourcefilename = text_default_filetype(rdp_sourcefilename, "bnf");
text_init(rdp_textsize, 50, 120, (int) rdp_tabwidth);
scan_init(0, 0, 1, rdp_symbol_echo, rdp_tokens);
locals = symbol_new_table("locals", 101, 31, symbol_compare_string, symbol_hash_string, symbol_print_string);
codes = symbol_new_table("codes", 101, 31, symbol_compare_string, symbol_hash_string, symbol_print_string);
tokens = symbol_new_table("tokens", 101, 31, symbol_compare_string, symbol_hash_string, symbol_print_string);
rdp = symbol_new_table("rdp", 101, 31, symbol_compare_string, symbol_hash_string, symbol_print_string);
rdp_set_initialise();
rdp_load_keywords();
if (rdp_verbose)
text_printf("\nRecursive descent parser generator V1.50 (c) Adrian Johnstone 1997\n" RDP_STAMP "\n\n");
rdp_pre_parse();
for (rdp_pass = 1; rdp_pass <= RDP_PASSES; rdp_pass++)
{
text_echo(rdp_line_echo_all || (rdp_line_echo && rdp_pass == RDP_PASSES));
if (text_open(rdp_sourcefilename) == NULL)
arg_help("unable to open source file");
text_get_char();
scan_();
unit(); /* call parser at top level */
if (text_total_errors() != 0)
text_message(TEXT_FATAL, "error%s detected in source file\n", text_total_errors() == 1 ? "" : "s"); /* crash quietly */
}
if (rdp_symbol_statistics)
symbol_print_all_table_statistics(11);
rdp_post_parse(rdp_outputfilename, rdp_force);
text_print_total_errors();
if (rdp_verbose)
{
rdp_finish_time = clock();
text_message(TEXT_INFO, "%.3f CPU seconds used\n", ((double) (rdp_finish_time-rdp_start_time)) / CLOCKS_PER_SEC);
}
return rdp_error_return;
}
/* End of rdp.c */