示例#1
0
/* FIRST(variable list’)={,,e}
<variable list’> ->
	,<variable identifier> <variable list’>|e
Author: Kwok Hong Kelvin Chan */
void variable_list_p(void) {
	switch(lookahead_token.code) {
	case COM_T:
		match(COM_T, NO_ATTR);
		variable_identifier();
		variable_list_p();
		break;
	}
}
/*
 * Production: Variable List (P)
 * FIRST set: { ,, e }
 */
void variable_list_p(void) {
    
    /* If the token code is not COM_T (comma token), return.b  */
    if (lookahead.code != COM_T)
        return;
    
    match(COM_T, NO_ATTR);
    variable_identifier();
    variable_list_p();
}
/*
 * Production: Variable List
 * FIRST set: { AVID_T, SVID_T }
 */
void variable_list(void) {
    variable_identifier();
    variable_list_p();
    gen_incode("PLATY: Variable list parsed");
}