[Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/standalone
lexer.l, 1.9, 1.10
David Gay
idgay at users.sourceforge.net
Wed Apr 18 15:49:16 PDT 2007
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/standalone
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv646
Modified Files:
lexer.l
Log Message:
get rid of old junky way of doing multiple input sources
Index: lexer.l
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/standalone/lexer.l,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** lexer.l 19 Nov 2005 00:42:09 -0000 1.9
--- lexer.l 18 Apr 2007 22:49:14 -0000 1.10
***************
*** 40,48 ****
#define YY_USE_PROTOS
- #undef YY_INPUT
- #define YY_INPUT(buf, result, max_size) \
- { if (!line_read) (result) = read(fileno(yyin), (buf), (max_size)); \
- else (result) = string_read((buf), (max_size)); }
-
static int string_read(char *buf, int max_size);
--- 40,43 ----
***************
*** 274,283 ****
void read_from_file(FILE *f, bool is_scheme)
{
! if (!mbuf) mbuf = yy_create_buffer(f, YY_BUF_SIZE);
! else yy_init_buffer(mbuf, f);
!
! yy_current_buffer = 0;
yy_switch_to_buffer(mbuf);
- line_read = FALSE;
lexloc.lineno = 1;
normal_lexing();
--- 269,276 ----
void read_from_file(FILE *f, bool is_scheme)
{
! if (mbuf)
! yy_delete_buffer(mbuf);
! mbuf = yy_create_buffer(f, YY_BUF_SIZE);
yy_switch_to_buffer(mbuf);
lexloc.lineno = 1;
normal_lexing();
***************
*** 287,298 ****
void read_from_string(const char *str, bool is_scheme)
{
! if (!mbuf) mbuf = yy_create_buffer(stdin, YY_BUF_SIZE);
! else yy_init_buffer(mbuf, stdin);
!
! yy_current_buffer = 0;
! yy_switch_to_buffer(mbuf);
! line_read = TRUE;
! line = str;
! length = strlen(line);
lexloc.lineno = 0;
normal_lexing();
--- 280,287 ----
void read_from_string(const char *str, bool is_scheme)
{
! if (mbuf)
! yy_delete_buffer(mbuf);
! mbuf = yy_scan_string(str);
!
lexloc.lineno = 0;
normal_lexing();
More information about the Tinyos-commits
mailing list