sh-2.03$ make g++ -g2 -c main.cpp g++ -g2 -c scan.cpp g++ -g2 main.o scan.o -o cminus sh-2.03$ sh-2.03$ sh-2.03$ sh-2.03$ sh-2.03$ cminus usage: cminus [-no_parse] [-no_analyze] [-no_code][-trace_scan] [-trace_parse] [-trace_analyze][-trace_code] sh-2.03$ sh-2.03$ sh-2.03$ cminus -no_parse -trace_scan nfact.mns CMINUS COMPILATION: nfact.mns NO PARSING TRACE SCAN 10: reserved word: int 10: ID, name = nfact 10: LPAREN ( 10: reserved word: int 10: ID, name = n 10: RPAREN ) 11: LCRLY { 12: reserved word: if 12: LPAREN ( 12: ID, name = n 12: EQ == 12: NUM, val= 0 12: RPAREN ) 13: LCRLY { 14: reserved word: return 14: NUM, val= 1 14: SEMI ; 15: RCRLY } 16: reserved word: else 17: LCRLY { 18: reserved word: return 18: LPAREN ( 18: ID, name = n 18: TIMES * 18: ID, name = nfact 18: LPAREN ( 18: ID, name = n 18: MINUS - 18: NUM, val= 1 18: RPAREN ) 18: RPAREN ) 18: SEMI ; 19: RCRLY } 21: reserved word: return 21: NUM, val= 0 21: SEMI ; 22: RCRLY } 24: reserved word: void 24: ID, name = main 24: LPAREN ( 24: reserved word: void 24: RPAREN ) 25: LCRLY { 26: reserved word: int 26: ID, name = n 26: SEMI ; 27: ID, name = n 27: ASSIGN = 27: ID, name = input 27: LPAREN ( 27: RPAREN ) 27: SEMI ; 28: ID, name = n 28: ASSIGN = 28: ID, name = nfact 28: LPAREN ( 28: ID, name = n 28: RPAREN ) 28: SEMI ; 29: ID, name = output 29: LPAREN ( 29: ID, name = n 29: RPAREN ) 29: SEMI ; 30: RCRLY } 31: ENDFILE EOF sh-2.03$ sh-2.03$ sh-2.03$ sh-2.03$ sh-2.03$ cminus -no_parse -trace_scan error_nfact.mns CMINUS COMPILATION: error_nfact.mns NO PARSING TRACE SCAN 10: reserved word: int 10: ID, name = nfact 10: LPAREN ( 10: reserved word: int 10: ID, name = n 10: RPAREN ) 11: LCRLY { 12: reserved word: if 12: LPAREN ( 12: ID, name = n 12: EQ == 12: NUM, val= 0 12: RPAREN ) 13: LCRLY { 14: reserved word: return 14: ERROR: UNEXPECT CHARACTER 1a 14: NUM, val= 1 14: SEMI ; 15: RCRLY } 16: reserved word: else 17: LCRLY { 18: reserved word: return 18: LPAREN ( 18: ID, name = n 18: TIMES * 18: ERROR: UNEXPECT NUMBER nfa3 18: ERROR: UNEXPECT CHARACTER 32c 18: ID, name = ct 18: LPAREN ( 18: ID, name = n 18: MINUS - 18: NUM, val= 1 18: RPAREN ) 18: RPAREN ) 18: SEMI ; 19: RCRLY } 21: reserved word: return 21: NUM, val= 0 21: SEMI ; 22: RCRLY } 24: reserved word: void 24: ID, name = main 24: LPAREN ( 24: reserved word: void 24: RPAREN ) 25: LCRLY { 26: reserved word: int 26: ID, name = n 26: SEMI ; 27: ID, name = n 27: ASSIGN = 27: ID, name = input 27: LPAREN ( 27: RPAREN ) 27: SEMI ; 28: ID, name = n 28: ASSIGN = 28: ID, name = nfact 28: LPAREN ( 28: ID, name = n 28: RPAREN ) 28: SEMI ; 29: ID, name = output 29: LPAREN ( 29: ID, name = n 29: RPAREN ) 29: SEMI ; 30: RCRLY } 31: ENDFILE EOF sh-2.03$ sh-2.03$ sh-2.03$ make clean rm cminus rm main.o scan.o sh-2.03$ exit exit script done on Sun 27 Jan 2002 05:17:44 PM PST