summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-01-04 00:06:07 -0700
committerMike Buland <eichlan@xagasoft.com>2012-01-04 00:06:07 -0700
commitd8f0276ec9d3b538a5ef8918a3072e3528a480d5 (patch)
tree41c8cb65f07053e6a0a4d15a0b0a5f5e1c56bb33 /src/main.cpp
parent3a0f68b527cc85bd9847127085415739af784eca (diff)
downloadstage-d8f0276ec9d3b538a5ef8918a3072e3528a480d5.tar.gz
stage-d8f0276ec9d3b538a5ef8918a3072e3528a480d5.tar.bz2
stage-d8f0276ec9d3b538a5ef8918a3072e3528a480d5.tar.xz
stage-d8f0276ec9d3b538a5ef8918a3072e3528a480d5.zip
Parse moved to GameBuilder.
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 );