/* begin x:=9; if x > 0 then x:= 2*x+1/3; end # */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define _KEY_WORD_END "waiting for your expanding" typedef struct { int typenum; char *word; }WORD; char input[255]; char token[255]=""; int p_input; int p_token; char ch; char* rwtab[] = {"begin","if","then","while","do","end",_KEY_WORD_END}; WORD * scaner(); int main() { int over = 1; WORD* oneword = new WORD; printf("Enter Your words(end with #):"); scanf("%[^#]s",input); p_input = 0; printf("Your words: %s ",input); while(over < 1000 &&over !=-1) { oneword = scaner(); if(oneword->typenum <1000) printf("(%d,%s) ",oneword->typenum,oneword->word); over = oneword->typenum; } printf(" press # to exit:"); scanf("%[^#]s",input); return 0; } char m_getch() { ch = input[p_input]; p_input = p_input+1; return(ch); } void getbc() { while(ch == ' '||ch == 10) { ch = input[p_input]; p_input++; } } void concat() { token[p_token] = ch; p_token++; token[p_token] = '