main.c 730 字节
Newer Older
饶先宏's avatar
饶先宏 已提交
1 2 3 4
#include <stdio.h>
#include <stdlib.h>

#include "object.h"
5
#include "dlist.h"
6
#include "bignumber.h"
7
#include "conststring.h"
饶先宏's avatar
饶先宏 已提交
8 9 10
#include "preprocess.h"
#include "verilog_preprocess.h"
#include "string.h"
11
#include "verilog_parsetree.h"
饶先宏's avatar
饶先宏 已提交
12 13 14

int SetPreProcess(HOBJECT object);
int yylex();
饶先宏's avatar
饶先宏 已提交
15
extern char* yytext;
饶先宏's avatar
饶先宏 已提交
16 17 18 19 20 21 22

int main(int argc, char* argv[])
{
	int token;
	IPreprocess** p;
	preprocessVerilogCreate(&p);
	objectCall1(p, AddIncludePath, "c:/tools/");
23
	hdl4se_parser_SetPreProcess(p);
饶先宏's avatar
饶先宏 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37
	if (argc == 1)
		objectCall2(p, SetFile, "d:/TestDriver.v", 0);
	else
		objectCall2(p, SetFile, argv[1], 0);

	do {
		token = yylex();
		if (token > 0)
			printf("token %d: %s\n", token, yytext);
	} while (token > 0);

	objectRelease(p);
	return 0;
}