Exemplo n.º 1
0
/* FIRST(statements’)={AVID,SVID,IF,USING,INPUT,OUTPUT,e}
<statements’> -> 
	<statement><statements’>|e
Author: Kyle Hinskens */
void statements_p(void){
	switch(lookahead_token.code){
		case AVID_T:
		case SVID_T: statement(); statements_p(); break;
		case KW_T:
			if (lookahead_token.attribute.get_int == IF
				|| lookahead_token.attribute.get_int == USING
				|| lookahead_token.attribute.get_int == INPUT
				|| lookahead_token.attribute.get_int == OUTPUT) 
			{
				statement();
				statements_p();
			}	
			break;
 	}
}
Exemplo n.º 2
0
/*
 * Production: Statements (P)
 * { AVID_T, SVID_T, KW_T (only IF, USING, INPUT, OUTPUT), e }
 */
void statements_p(void) {
    switch (lookahead.code) {
        case KW_T:
            /*
             * The token attribute must be ELSE, PLATYPUS, REPEAT or THEN. If the
             * keyword token attribute doesn't match any of the previous, return.
             */
            switch (lookahead.attribute.kwt_idx) {
                case ELSE:
                case PLATYPUS:
                case REPEAT:
                case THEN:
                    return;
            }
        
        case AVID_T:
        case SVID_T:
            statement();
            statements_p();
            return;
    }
}
Exemplo n.º 3
0
/*
 * Production: Statements
 * FIRST set: { AVID_T, SVID_T, KW_T (only IF, USING, INPUT, OUTPUT) }
 */
void statements(void) {
    statement();
    statements_p();
}