Fixed errors
git-svn-id: http://picoc.googlecode.com/svn/trunk@4 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
b5f685e744
commit
32c5617d83
6
parse.c
6
parse.c
|
@ -7,6 +7,7 @@ struct Table GlobalTable;
|
||||||
struct TableEntry GlobalHashTable[GLOBAL_TABLE_SIZE];
|
struct TableEntry GlobalHashTable[GLOBAL_TABLE_SIZE];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ParseInit()
|
void ParseInit()
|
||||||
{
|
{
|
||||||
TableInit(&GlobalTable, &GlobalHashTable[0], "global", GLOBAL_TABLE_SIZE);
|
TableInit(&GlobalTable, &GlobalHashTable[0], "global", GLOBAL_TABLE_SIZE);
|
||||||
|
@ -17,10 +18,11 @@ void ParseInit()
|
||||||
void ParseScan(const Str *FileName, const Str *Source)
|
void ParseScan(const Str *FileName, const Str *Source)
|
||||||
{
|
{
|
||||||
enum LexToken Token;
|
enum LexToken Token;
|
||||||
|
struct LexState Lexer;
|
||||||
|
|
||||||
LexInit(Source);
|
LexInit(&Lexer, Source, FileName, 1);
|
||||||
|
|
||||||
while ( (Token = LexGetToken()) != TokenEOF)
|
while ( (Token = LexGetToken(&Lexer)) != TokenEOF)
|
||||||
{
|
{
|
||||||
/* do parsey things here */
|
/* do parsey things here */
|
||||||
printf("token %d\n", (int)Token);
|
printf("token %d\n", (int)Token);
|
||||||
|
|
Loading…
Reference in a new issue