2 /* Copyright: (c) Julian Smart */
3 /* Licence: wxWindows Licence */
10 #if defined(__GNUWIN32__) && !defined(__TWIN32__)
11 #include <sys/unistd.h>
14 #include "wx/deprecated/expr.h"
17 #define __EXTERN_C__ 1
20 #if defined(__cplusplus) || defined(__STDC__)
21 #if defined(__cplusplus) && defined(__EXTERN_C__)
28 int yyback(int *, int);
31 /* You may need to put /DLEX_SCANNER in your makefile
32 * if you're using LEX!
36 #if defined(__cplusplus) || defined(__STDC__)
37 #if defined(__cplusplus) && defined(__EXTERN_C__)
45 /* struct pexpr *expr; */
61 %token CLOSE_SQUARE 10
65 /* %type <expr> command expr arglist arg arg1 */
66 %type <s> command expr arglist arg arg1
70 commands : /* empty */
75 {process_command(proio_cons(wxmake_word($1), NULL)); free($1);}
77 {process_command($1);}
79 {syntax_error("Unrecognized command.");}
82 expr : WORD OPEN arglist CLOSE
83 {$$ = proio_cons(wxmake_word($1), $3); free($1);}
84 | OPEN_SQUARE arglist CLOSE_SQUARE
89 {$$ = proio_cons(NULL, NULL);}
91 {$$ = proio_cons($1, NULL);}
94 {$$ = proio_cons($1, $3);}
97 arg : WORD EQUALS arg1
98 {$$ = proio_cons(wxmake_word("="), proio_cons(wxmake_word($1), proio_cons($3, NULL)));
105 {$$ = wxmake_word($1); free($1);}
107 {$$ = wxmake_string($1); free($1);}
109 {$$ = wxmake_integer($1); free($1);}
110 | INTEGER PERIOD INTEGER
111 {$$ = wxmake_real($1, $3); free($1); free($3); }
112 | INTEGER EXP INTEGER
113 {$$ = wxmake_exp($1, $3); free($1); free($3); }
115 INTEGER PERIOD INTEGER EXP INTEGER
116 {$$ = wxmake_exp2($1, $3, $5); free($1); free($3);
125 /* We include lexer.c if we are building for gtk, wine or motif
126 * and also whenever we are using configure (marked by __WX_SETUP_H__) for,
127 * for example, cross compilation. */
128 #if (defined(__WXGTK__) || defined(__WXWINE__) || defined(__WXMOTIF__)) || defined(__WX_SETUP_H__) && !defined(NO_CONFIGURE)
130 #elif defined(__WXMAC__) && defined(__APPLE__)
132 #elif defined(__MWERKS__)
133 #include "cwlex_yy.c"
146 /* Ansi prototype. If this doesn't work for you... uncomment
150 void yyerror(char *s)
156 * Unfortunately, my DOS version of FLEX
157 * requires yywrap to be #def'ed, whereas
158 * the UNIX flex expects a proper function.
161 /* At least on alphaev6-dec-osf4.0e yywrap() must be #define'd.
162 * RL: ... but on Debian/Alpha(linux) it must not, so hopefully
163 * testing for __OSF__ here is what we really want.
170 /* HH: Added test for __WX_SETUP_H__ for gnuwin builds
172 #if !defined(__SC__) && !defined(__GNUWIN32__)
177 #elif !defined(__ultrix)
178 int yywrap() { return 1; }
179 #elif defined(__VMS__)
180 int yywrap() { return 1; }
182 #elif defined(__WX_SETUP_H__)
183 int yywrap() { return 1; }