summaryrefslogtreecommitdiff
path: root/src/intersim2/config.y
diff options
context:
space:
mode:
authorDongdong Li <[email protected]>2013-08-08 00:15:58 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:58 -0700
commit7f49fe9feb174d34efc2a011bad79b38522a360b (patch)
treeab5b7b66e40315a81871acbf386722981020f866 /src/intersim2/config.y
parent5f91e7435742bab74dfbeca18afc63e466498f36 (diff)
Intesim2 Integration
Details: See Review 80001 https://gpgpu-sim-code-review.appspot.com/80001/ [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16747]
Diffstat (limited to 'src/intersim2/config.y')
-rw-r--r--src/intersim2/config.y37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/intersim2/config.y b/src/intersim2/config.y
new file mode 100644
index 0000000..377d467
--- /dev/null
+++ b/src/intersim2/config.y
@@ -0,0 +1,37 @@
+%{
+
+int yylex(void);
+void yyerror(char * msg);
+void config_assign_string( char const * field, char const * value );
+void config_assign_int( char const * field, int value );
+void config_assign_float( char const * field, double value );
+
+#ifdef _WIN32
+#pragma warning ( disable : 4102 )
+#pragma warning ( disable : 4244 )
+#endif
+
+%}
+
+%union {
+ char *name;
+ int num;
+ double fnum;
+}
+
+%token <name> STR
+%token <num> NUM
+%token <fnum> FNUM
+
+%%
+
+commands : commands command
+ | command
+;
+
+command : STR '=' STR ';' { config_assign_string( $1, $3 ); free( $1 ); free( $3 ); }
+ | STR '=' NUM ';' { config_assign_int( $1, $3 ); free( $1 ); }
+ | STR '=' FNUM ';' { config_assign_float( $1, $3 ); free( $1 ); }
+;
+
+%%