--- a/src/parser/scanner.l
+++ b/src/parser/scanner.l
@@ -37,7 +37,9 @@
 #include <math.h>
 #include <string.h>
 #include "tparser.h"
+#include "tparserprivate.h"
 #include "parser.h"
+
 char strBuffer[PT_TOKEN_MAX_LEN+1];
 char *strBuffer_ptr;
 
@@ -47,7 +49,7 @@
 int inVariable = 0;
 
 #define YY_INPUT(buf,result,max_size)  {\
-    result = GetNextChar(buf, max_size); \
+    result = panoScriptScannerGetNextChar(buf, max_size); \
     if (  result <= 0  ) \
       result = YY_NULL; \
     }
@@ -66,14 +68,14 @@
 
 -?{DIGIT}+    {
               /*  printf( "An integer: %s (%d)\n", yytext, atoi( yytext ) );*/
-                panoScannerTokenBegin(yytext); 
+                panoScriptScannerTokenBegin(yytext); 
                 yylval.iVal = atoi( yytext );
                 return PT_TOKEN_INT;
                }
 
 -?{DIGIT}+"."{DIGIT}* {
                /*printf( "A float: %s (%g)\n", yytext, atof( yytext ) );*/
-                panoScannerTokenBegin(yytext); 
+                panoScriptScannerTokenBegin(yytext); 
                 yylval.fVal = atof( yytext );
                 return PT_TOKEN_FLOAT;
             }
@@ -85,12 +87,12 @@
 
 [ \t]*\n    { /* END OF LINE is an important marker */
             /*printf( "End of line: %s\n", yytext );*/
-            panoScannerTokenBegin(yytext); 
+            panoScriptScannerTokenBegin(yytext); 
             return PT_TOKEN_EOL;
             }
 
 <<EOF>>     {
-               panoScannerTokenBegin(yytext); 
+               panoScriptScannerTokenBegin(yytext); 
                return 0;
             }
 
@@ -107,34 +109,34 @@
 
    /* These are the types of lines supported */
 ^o  {
-             panoScannerTokenBegin(yytext); 
+             panoScriptScannerTokenBegin(yytext); 
              return PT_TOKEN_OUTPUT_LINE;
              }
 
 ^i           {
-             panoScannerTokenBegin(yytext); 
+             panoScriptScannerTokenBegin(yytext); 
              return PT_TOKEN_INPUT_LINE;
              }
 
 ^p  {
-             panoScannerTokenBegin(yytext); 
+             panoScriptScannerTokenBegin(yytext); 
              return PT_TOKEN_PANO_LINE;
              }
 
 ^m  {
-             panoScannerTokenBegin(yytext); 
+             panoScriptScannerTokenBegin(yytext); 
              return PT_TOKEN_OPTIMIZE_LINE;
              }
 
 ^C  {
-             panoScannerTokenBegin(yytext); 
+             panoScriptScannerTokenBegin(yytext); 
              return PT_TOKEN_CONTROL_PTS_LINE;
              }
 
   /*********************************/
 
 ","           { 
-              panoScannerTokenBegin(yytext); 
+              panoScriptScannerTokenBegin(yytext); 
               return PT_TOKEN_COMMA; }
 
 
@@ -142,7 +144,7 @@
                /*printf( "An identifier: %s\n", yytext );*/
                 if (!inVariable) {
                    inVariable = 1;
-                   panoScannerTokenBegin(yytext); 
+                   panoScriptScannerTokenBegin(yytext); 
                    strncpy(yylval.strVal, yytext, PT_TOKEN_MAX_LEN);
                    return PT_TOKEN_KEYWORD;
                 } else {
@@ -164,14 +166,14 @@
 
 
 [ \t]+        {  /*printf("skypping separator\n");  */
-                panoScannerTokenBegin(yytext); 
+                panoScriptScannerTokenBegin(yytext); 
                 inVariable = 0;
                 return PT_TOKEN_SEPARATOR;
               }
 
 
 =            { 
-                panoScannerTokenBegin(yytext); 
+                panoScriptScannerTokenBegin(yytext); 
                 return PT_TOKEN_REFERENCE; }
 
 "#".+\n        /* eat up comments */
@@ -180,7 +182,7 @@
               }
 
 \"             {
-                 panoScannerTokenBegin(yytext); 
+                 panoScriptScannerTokenBegin(yytext); 
                  strBuffer_ptr = strBuffer; BEGIN(str);
                  //printf("Beginning of string\n");
                }
@@ -199,7 +201,7 @@
 <str>\n        {
                  /* error - unterminated string constant */
                  /* generate error message */
-                 panoParserError( "non-terminated string: %s\n", yytext ); 
+                 panoScriptParserError( "non-terminated string: %s\n", yytext ); 
                  return -0;
                }
 
@@ -219,7 +221,7 @@
                    }
 
 .           { 
-              panoParserError( "Unrecognized character: %s\n", yytext );
+              panoScriptParserError( "Unrecognized character: %s\n", yytext );
               return 0;
             }