/* * Production: String Expression (P) * FIRST set: { <<, e } */ void string_expression_p(void) { /* If the current token code is not SCC_OP_T (string concatination operator), return. */ if (lookahead.code != SCC_OP_T) return; match(SCC_OP_T, NO_ATTR); primary_string_expression(); string_expression_p(); }
/* FIRST(string expression’)={<>,e} <string expression’> -> <> <primary string expression> <string expression’> | e Author: Kwok Hong Kelvin Chan */ void string_expression_p(void){ switch (lookahead_token.code){ case SCC_OP_T: match(SCC_OP_T, NO_ATTR); primary_string_expression(); string_expression_p(); break; } }
/* FIRST(string expression)={SVID_T, STR_T} <string expression> -> <primary string expression> <string expression’> Author: Kyle Hinskens */ void string_expression(void){ switch (lookahead_token.code){ case SVID_T: case STR_T: primary_string_expression(); string_expression_p(); gen_incode("String expression parsed"); break; } }
/* * Production: String Expression * FIRST set: { SVID_T, STR_T } */ void string_expression(void) { primary_string_expression(); string_expression_p(); gen_incode("PLATY: String expression parsed"); }