summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5b91861..6646d79 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,7 +1,6 @@
1#include "gamebuilder.h" 1#include "gamebuilder.h"
2#include "game.h" 2#include "game.h"
3#include "gamestate.h" 3#include "gamestate.h"
4#include "parser.tab.h"
5 4
6#include <stdlib.h> 5#include <stdlib.h>
7#include <time.h> 6#include <time.h>
@@ -13,30 +12,12 @@
13#include <bu/sio.h> 12#include <bu/sio.h>
14using namespace Bu; 13using namespace Bu;
15 14
16typedef void *yyscan_t;
17void yylex_init( yyscan_t * );
18void yylex_destroy( yyscan_t );
19void yyparse( yyscan_t, GameBuilder &bld );
20void yyset_in( FILE *, yyscan_t );
21
22int main( int argc, char *argv[] ) 15int main( int argc, char *argv[] )
23{ 16{
24 yyscan_t scanner;
25
26 GameBuilder bld;
27
28 yylex_init( &scanner );
29
30 FILE *in = fopen( argv[1], "rb" );
31 yyset_in( in, scanner );
32
33 yyparse( scanner, bld );
34 yylex_destroy( scanner );
35
36 fclose( in );
37
38 srandom( time( NULL ) ); 17 srandom( time( NULL ) );
39 18
19 GameBuilder bld;
20 bld.parse( argv[1] );
40 Game *pGame = bld.getGame(); 21 Game *pGame = bld.getGame();
41 22
42 GameState gs( pGame ); 23 GameState gs( pGame );