view token.c @ 16:5b631c16f89b

llvm output
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 02 Nov 2012 14:04:35 +0900 (2012-11-02)
parents 6bf66c125dbc
children e5c8532ab38d
line wrap: on
line source
/*
    Very Simple Compiler
    Tokenizer Tester 
	$Id$
 */

#include "s-compile.h"

int
main() 
{
    int d;
    char buf[BUFSIZ];

    while (fgets(buf,BUFSIZ,stdin)) {
	ptr = buf;
	before = buf;
	printf("#### %s",buf);
	do {
	    token();
	    switch(last_token) {
	    case '0':
		printf("%d\tvalue\n",value);
		break;
	    case 'v':
		printf("%c\tvariable\n",value+'a');
		break;
	    case EOF:
		break;
	    default:
		printf("%c\ttoken\n",last_token);
		break;
	    }
	} while(last_token!=EOF);
    }
    return 0;
}



/* end */