changeset 16120:4b68eb9b98b0

move octave_read lexer helper function to lexical_feedback class * lex.h, lex.ll (octave_read): Declare as member of lexical_feedback class. Change all callers.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Feb 2013 12:24:54 -0500
parents b31eb56f4d84
children bdf365c5c9bf
files libinterp/parse-tree/lex.h libinterp/parse-tree/lex.ll
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h	Tue Feb 26 12:01:54 2013 -0500
+++ b/libinterp/parse-tree/lex.h	Tue Feb 26 12:24:54 2013 -0500
@@ -205,6 +205,8 @@
     looking_at_object_index.push_front (false);
   }
 
+  int octave_read (char *buf, unsigned int max_size);
+
   void do_comma_insert_check (void);
 
   int text_yyinput (void);
--- a/libinterp/parse-tree/lex.ll	Tue Feb 26 12:01:54 2013 -0500
+++ b/libinterp/parse-tree/lex.ll	Tue Feb 26 12:24:54 2013 -0500
@@ -103,7 +103,7 @@
 #undef YY_INPUT
 #endif
 #define YY_INPUT(buf, result, max_size) \
-  result = octave_read (buf, max_size)
+  result = curr_lexer->octave_read (buf, max_size)
 
 // Try to avoid crashing out completely on fatal scanner errors.
 // The call to yy_fatal_error should never happen, but it avoids a
@@ -225,7 +225,6 @@
 // file that are needed inside the lexer actions.
 
 static std::string strip_trailing_whitespace (char *s);
-static int octave_read (char *buf, unsigned int max_size);
 
 %}
 
@@ -1359,8 +1358,8 @@
   return retval;
 }
 
-static int
-octave_read (char *buf, unsigned max_size)
+int
+lexical_feedback::octave_read (char *buf, unsigned max_size)
 {
   static const char * const eol = "\n";
   static std::string input_buf;