Bug 14193 fixed: Problem with matrix defined in a matrix of structs
[scilab.git] / scilab / modules / ast / src / cpp / parse / scanscilab.cpp
index d6cd6d1..4c09545 100644 (file)
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 37
+#define YY_FLEX_SUBMINOR_VERSION 39
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -141,7 +141,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -167,6 +175,7 @@ extern FILE *yyin, *yyout;
 #define EOB_ACT_LAST_MATCH 2
 
 #define YY_LESS_LINENO(n)
+#define YY_LINENO_REWIND_TO(ptr)
 
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -1790,6 +1799,9 @@ char *yytext;
  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
+
+#include <stack>
+
 #include "isatty.hxx"
 #include "parse.hxx"
 #include "parser_private.hxx"
@@ -1802,9 +1814,12 @@ extern "C"
 #include "sci_malloc.h"
 }
 
+static std::stack<int> paren_levels;
+
 static int comment_level = 0;
-static int paren_level = 0;
 static int last_token = 0;
+static int exit_status = PARSE_ERROR;
+static int str_opener_column = 0;
 static std::string current_file;
 static std::string program_name;
 
@@ -1813,7 +1828,7 @@ static std::string pstBuffer;
 extern void yyerror(std::string);
 
 #define YY_USER_ACTION                          \
- yylloc.first_column = yylloc.last_column;yylloc.last_column += yyleng;
+    yylloc.first_column = yylloc.last_column; yylloc.last_column += yyleng;
 //yylloc.last_column += yyleng;
 
 /* -*- Verbose Special Debug -*- */
@@ -1915,7 +1930,12 @@ static int yy_top_state (void );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -1959,7 +1979,7 @@ static int yy_top_state (void );
                        } \
                }\
 \
-
 #endif
 
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -2062,1253 +2082,1070 @@ YY_DECL
         yy_load_buffer_state( );
     }
 
-    while ( 1 )                /* loops until end-of-file is reached */
     {
-        yy_cp = (yy_c_buf_p);
 
-        /* Support of yytext. */
-        *yy_cp = (yy_hold_char);
+        while ( 1 )            /* loops until end-of-file is reached */
+        {
+            yy_cp = (yy_c_buf_p);
+
+            /* Support of yytext. */
+            *yy_cp = (yy_hold_char);
 
-        /* yy_bp points to the position in yy_ch_buf of the start of
-         * the current run.
-         */
-        yy_bp = yy_cp;
+            /* yy_bp points to the position in yy_ch_buf of the start of
+             * the current run.
+             */
+            yy_bp = yy_cp;
 
-        yy_current_state = (yy_start);
-        yy_current_state += YY_AT_BOL();
+            yy_current_state = (yy_start);
+            yy_current_state += YY_AT_BOL();
 
-        (yy_state_ptr) = (yy_state_buf);
-        *(yy_state_ptr)++ = yy_current_state;
+            (yy_state_ptr) = (yy_state_buf);
+            *(yy_state_ptr)++ = yy_current_state;
 
 yy_match:
-        do
-        {
-            register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-            while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+            do
             {
-                yy_current_state = (int) yy_def[yy_current_state];
-                if ( yy_current_state >= 809 )
+                register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                 {
-                    yy_c = yy_meta[(unsigned int) yy_c];
+                    yy_current_state = (int) yy_def[yy_current_state];
+                    if ( yy_current_state >= 809 )
+                    {
+                        yy_c = yy_meta[(unsigned int) yy_c];
+                    }
                 }
+                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+                *(yy_state_ptr)++ = yy_current_state;
+                ++yy_cp;
             }
-            yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-            *(yy_state_ptr)++ = yy_current_state;
-            ++yy_cp;
-        }
-        while ( yy_base[yy_current_state] != 4153 );
+            while ( yy_base[yy_current_state] != 4153 );
 
 yy_find_action:
-        yy_current_state = *--(yy_state_ptr);
-        (yy_lp) = yy_accept[yy_current_state];
+            yy_current_state = *--(yy_state_ptr);
+            (yy_lp) = yy_accept[yy_current_state];
 find_rule: /* we branch to this label when backing up */
-        for ( ; ; ) /* until we find what rule we matched */
-        {
-            if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
+            for ( ; ; ) /* until we find what rule we matched */
             {
-                yy_act = yy_acclist[(yy_lp)];
-                if ( yy_act & YY_TRAILING_HEAD_MASK ||
-                        (yy_looking_for_trail_begin) )
+                if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
                 {
-                    if ( yy_act == (yy_looking_for_trail_begin) )
+                    yy_act = yy_acclist[(yy_lp)];
+                    if ( yy_act & YY_TRAILING_HEAD_MASK ||
+                            (yy_looking_for_trail_begin) )
+                    {
+                        if ( yy_act == (yy_looking_for_trail_begin) )
+                        {
+                            (yy_looking_for_trail_begin) = 0;
+                            yy_act &= ~YY_TRAILING_HEAD_MASK;
+                            break;
+                        }
+                    }
+                    else if ( yy_act & YY_TRAILING_MASK )
+                    {
+                        (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
+                        (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
+                    }
+                    else
                     {
-                        (yy_looking_for_trail_begin) = 0;
-                        yy_act &= ~YY_TRAILING_HEAD_MASK;
+                        (yy_full_match) = yy_cp;
+                        (yy_full_state) = (yy_state_ptr);
+                        (yy_full_lp) = (yy_lp);
                         break;
                     }
+                    ++(yy_lp);
+                    goto find_rule;
                 }
-                else if ( yy_act & YY_TRAILING_MASK )
-                {
-                    (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
-                    (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
-                }
-                else
-                {
-                    (yy_full_match) = yy_cp;
-                    (yy_full_state) = (yy_state_ptr);
-                    (yy_full_lp) = (yy_lp);
-                    break;
-                }
-                ++(yy_lp);
-                goto find_rule;
+                --yy_cp;
+                yy_current_state = *--(yy_state_ptr);
+                (yy_lp) = yy_accept[yy_current_state];
             }
-            --yy_cp;
-            yy_current_state = *--(yy_state_ptr);
-            (yy_lp) = yy_accept[yy_current_state];
-        }
 
-        YY_DO_BEFORE_ACTION;
+            YY_DO_BEFORE_ACTION;
 
 do_action:     /* This label is used only to access EOF actions. */
 
-        switch ( yy_act )
-        {
-            /* beginning of action switch */
-            case 1:
-                *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
-                (yy_c_buf_p) = yy_cp = yy_bp + 3;
-                YY_DO_BEFORE_ACTION; /* set up yytext again */
-                YY_RULE_SETUP
-                {
-                    // BOM found ==> ignored
-                }
-                YY_BREAK
-            case 2:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(BOOLTRUE);
-                }
-                YY_BREAK
-            case 3:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(BOOLFALSE);
-                }
-                YY_BREAK
-            case 4:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+            switch ( yy_act )
+            {
+                /* beginning of action switch */
+                case 1:
+                    *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
+                    (yy_c_buf_p) = yy_cp = yy_bp + 3;
+                    YY_DO_BEFORE_ACTION; /* set up yytext again */
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinIf);
+                        // BOM found ==> ignored
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(IF);
-                }
-                YY_BREAK
-            case 5:
-                YY_RULE_SETUP
-                {
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(THEN);
-                }
-                YY_BREAK
-            case 6:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 2:
+                    YY_RULE_SETUP
                     {
-                        // Pop to step out IF
-                        ParserSingleInstance::popControlStatus();
-                        ParserSingleInstance::pushControlStatus(Parser::WithinElse);
+                        BEGIN(INITIAL);
+                        return scan_throw(BOOLTRUE);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(ELSE);
-                }
-                YY_BREAK
-            case 7:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 3:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::popControlStatus();
-                        ParserSingleInstance::pushControlStatus(Parser::WithinElseIf);
+                        BEGIN(INITIAL);
+                        return scan_throw(BOOLFALSE);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(ELSEIF);
-                }
-                YY_BREAK
-            case 8:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 4:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::popControlStatus();
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinIf);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(IF);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(END);
-                }
-                YY_BREAK
-            case 9:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 5:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinSelect);
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(THEN);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(SELECT);
-                }
-                YY_BREAK
-            case 10:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 6:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinSwitch);
+                        if (last_token != DOT)
+                        {
+                            // Pop to step out IF
+                            ParserSingleInstance::popControlStatus();
+                            ParserSingleInstance::pushControlStatus(Parser::WithinElse);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(ELSE);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(SWITCH);
-                }
-                YY_BREAK
-            case 11:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 7:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::popControlStatus();
-                        ParserSingleInstance::pushControlStatus(Parser::WithinOtherwise);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                            ParserSingleInstance::pushControlStatus(Parser::WithinElseIf);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(ELSEIF);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(OTHERWISE);
-                }
-                YY_BREAK
-            case 12:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 8:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::popControlStatus();
-                        ParserSingleInstance::pushControlStatus(Parser::WithinCase);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(END);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(CASE);
-                }
-                YY_BREAK
-            case 13:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 9:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinFunction);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinSelect);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(SELECT);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(FUNCTION);
-                }
-                YY_BREAK
-            case 14:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 10:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::popControlStatus();
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinSwitch);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(SWITCH);
                     }
-                    DEBUG("BEGIN(INITIAL)");
-                    BEGIN(INITIAL);
-                    return scan_throw(ENDFUNCTION);
-                }
-                YY_BREAK
-            case 15:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 11:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinFor);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                            ParserSingleInstance::pushControlStatus(Parser::WithinOtherwise);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(OTHERWISE);
                     }
-                    BEGIN(INITIAL);
-                    return scan_throw(FOR);
-                }
-                YY_BREAK
-            case 16:
-                YY_RULE_SETUP
-                {
-                    if (last_token != DOT)
+                    YY_BREAK
+                case 12:
+                    YY_RULE_SETUP
                     {
-                        ParserSingleInstance::pushControlStatus(Parser::WithinWhile);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                            ParserSingleInstance::pushControlStatus(Parser::WithinCase);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(CASE);
                     }
-                    BEGIN(INITIAL);
-                    return scan_throw(WHILE);
-                }
-                YY_BREAK
-            case 17:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(DO);
-                }
-                YY_BREAK
-            case 18:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(BREAK);
-                }
-                YY_BREAK
-            case 19:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(CONTINUE);
-                }
-                YY_BREAK
-            case 20:
-                YY_RULE_SETUP
-                {
-                    ParserSingleInstance::pushControlStatus(Parser::WithinTry);
-                    BEGIN(INITIAL);
-                    return scan_throw(TRY);
-                }
-                YY_BREAK
-            case 21:
-                YY_RULE_SETUP
-                {
-                    // Pop to step out TRY
-                    ParserSingleInstance::popControlStatus();
-                    ParserSingleInstance::pushControlStatus(Parser::WithinCatch);
-                    BEGIN(INITIAL);
-                    return scan_throw(CATCH);
-                }
-                YY_BREAK
-            case 22:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(RETURN);
-                }
-                YY_BREAK
-            case 23:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    return scan_throw(RETURN);
-                }
-                YY_BREAK
-            case 24:
-                /* rule 24 can match eol */
-                YY_RULE_SETUP
-                {
-                    BEGIN(BEGINID);
-                }
-                YY_BREAK
-
-            case 25:
-                YY_RULE_SETUP
-                {
-                    wchar_t *pwText = to_wide_string(yytext);
-                    if (yytext != NULL && pwText == NULL)
+                    YY_BREAK
+                case 13:
+                    YY_RULE_SETUP
                     {
-                        std::string str = "Can\'t convert \'";
-                        str += yytext;
-                        str += "\' to UTF-8";
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinFunction);
+                        }
+                        DEBUG("BEGIN(INITIAL)");
                         BEGIN(INITIAL);
-                        yyerror(str);
-                        return scan_throw(FLEX_ERROR);
+                        return scan_throw(FUNCTION);
+                    }
+                    YY_BREAK
+                case 14:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                        }
+                        DEBUG("BEGIN(INITIAL)");
+                        BEGIN(INITIAL);
+                        return scan_throw(ENDFUNCTION);
                     }
-                    yylval.str = new std::wstring(pwText);
-                    FREE(pwText);
-                    types::InternalType * pIT = symbol::Context::getInstance()->get(symbol::Symbol(*yylval.str));
-                    if (pIT && pIT->isCallable())
+                    YY_BREAK
+                case 15:
+                    YY_RULE_SETUP
                     {
-                        scan_throw(ID);
-                        BEGIN(SHELLMODE);
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinFor);
+                        }
+                        BEGIN(INITIAL);
+                        return scan_throw(FOR);
                     }
-                    else
+                    YY_BREAK
+                case 16:
+                    YY_RULE_SETUP
                     {
+                        if (last_token != DOT)
+                        {
+                            ParserSingleInstance::pushControlStatus(Parser::WithinWhile);
+                        }
                         BEGIN(INITIAL);
-                        return scan_throw(ID);
+                        return scan_throw(WHILE);
                     }
-                }
-                YY_BREAK
+                    YY_BREAK
+                case 17:
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(INITIAL);
+                        return scan_throw(DO);
+                    }
+                    YY_BREAK
+                case 18:
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(INITIAL);
+                        return scan_throw(BREAK);
+                    }
+                    YY_BREAK
+                case 19:
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(INITIAL);
+                        return scan_throw(CONTINUE);
+                    }
+                    YY_BREAK
+                case 20:
+                    YY_RULE_SETUP
+                    {
+                        ParserSingleInstance::pushControlStatus(Parser::WithinTry);
+                        BEGIN(INITIAL);
+                        return scan_throw(TRY);
+                    }
+                    YY_BREAK
+                case 21:
+                    YY_RULE_SETUP
+                    {
+                        // Pop to step out TRY
+                        ParserSingleInstance::popControlStatus();
+                        ParserSingleInstance::pushControlStatus(Parser::WithinCatch);
+                        BEGIN(INITIAL);
+                        return scan_throw(CATCH);
+                    }
+                    YY_BREAK
+                case 22:
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(INITIAL);
+                        return scan_throw(RETURN);
+                    }
+                    YY_BREAK
+                case 23:
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(INITIAL);
+                        return scan_throw(RETURN);
+                    }
+                    YY_BREAK
+                case 24:
+                    /* rule 24 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        BEGIN(BEGINID);
+                    }
+                    YY_BREAK
 
-            case 26:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(NOT);
-                }
-                YY_BREAK
-            case 27:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOLLAR);
-                }
-                YY_BREAK
-            case 28:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(BOOLTRUE);
-                }
-                YY_BREAK
-            case 29:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(BOOLFALSE);
-                }
-                YY_BREAK
-            case 30:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(AND);
-                }
-                YY_BREAK
-            case 31:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(ANDAND);
-                }
-                YY_BREAK
-            case 32:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(OR);
-                }
-                YY_BREAK
-            case 33:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(OROR);
-                }
-                YY_BREAK
-            case 34:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(LPAREN);
-                }
-                YY_BREAK
-            case 35:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(RPAREN);
-                }
-                YY_BREAK
-            case 36:
-                YY_RULE_SETUP
-                {
-                    scan_step();
-                    return scan_throw(SEMI);
-                }
-                YY_BREAK
-            case 37:
-                YY_RULE_SETUP
-                {
-                    scan_step();
-                    return scan_throw(COMMA);
-                }
-                YY_BREAK
-            case 38:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(COLON);
-                }
-                YY_BREAK
-            case 39:
-                YY_RULE_SETUP
-                {
-                    yy_push_state(MATRIX);
-                    ParserSingleInstance::pushControlStatus(Parser::WithinCell);
-                    return scan_throw(LBRACE);
-                }
-                YY_BREAK
-            case 40:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(RBRACE);
-                }
-                YY_BREAK
-            case 41:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOTQUOTE);
-                }
-                YY_BREAK
-            case 42:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOTTIMES);
-                }
-                YY_BREAK
-            case 43:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOTRDIVIDE);
-                }
-                YY_BREAK
-            case 44:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOTLDIVIDE);
-                }
-                YY_BREAK
-            case 45:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOTPOWER);
-                }
-                YY_BREAK
-            case 46:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(MINUS);
-                }
-                YY_BREAK
-            case 47:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(PLUS);
-                }
-                YY_BREAK
-            case 48:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(TIMES);
-                }
-                YY_BREAK
-            case 49:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(RDIVIDE);
-                }
-                YY_BREAK
-            case 50:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(LDIVIDE);
-                }
-                YY_BREAK
-            case 51:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(POWER);
-                }
-                YY_BREAK
-            case 52:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(KRONTIMES);
-                }
-                YY_BREAK
-            case 53:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(KRONRDIVIDE);
-                }
-                YY_BREAK
-            case 54:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(KRONLDIVIDE);
-                }
-                YY_BREAK
-            case 55:
-                /* rule 55 can match eol */
-                YY_RULE_SETUP
-                {
-                    unput(yytext[yyleng - 1]);
-                    return scan_throw(CONTROLTIMES);
-                }
-                YY_BREAK
-            case 56:
-                /* rule 56 can match eol */
-                YY_RULE_SETUP
-                {
-                    unput(yytext[yyleng - 1]);
-                    return scan_throw(CONTROLRDIVIDE);
-                }
-                YY_BREAK
-            case 57:
-                /* rule 57 can match eol */
-                YY_RULE_SETUP
-                {
-                    unput(yytext[yyleng - 1]);
-                    return scan_throw(CONTROLLDIVIDE);
-                }
-                YY_BREAK
-            case 58:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(EQ);
-                }
-                YY_BREAK
-            case 59:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(NE);
-                }
-                YY_BREAK
-            case 60:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(LT);
-                }
-                YY_BREAK
-            case 61:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(GT);
-                }
-                YY_BREAK
-            case 62:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(LE);
-                }
-                YY_BREAK
-            case 63:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(GE);
-                }
-                YY_BREAK
-            case 64:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(ASSIGN);
-                }
-                YY_BREAK
-            case 65:
-                YY_RULE_SETUP
-                {
-                    DEBUG("yy_push_state(MATRIX)");
-                    yy_push_state(MATRIX);
-                    ParserSingleInstance::pushControlStatus(Parser::WithinMatrix);
-                    return scan_throw(LBRACK);
-                }
-                YY_BREAK
-            case 66:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(RBRACK);
-                }
-                YY_BREAK
-            case 67:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(DOT);
-                }
-                YY_BREAK
-            case 68:
-                YY_RULE_SETUP
-                {
-                    ParserSingleInstance::pushControlStatus(Parser::WithinDots);
-                    yy_push_state(LINEBREAK);
-                }
-                YY_BREAK
-            case 69:
-                YY_RULE_SETUP
-                {
-                    yylval.number = atof(yytext);
+                case 25:
+                    YY_RULE_SETUP
+                    {
+                        wchar_t *pwText = to_wide_string(yytext);
+                        if (yytext != NULL && pwText == NULL)
+                        {
+                            std::string str = "Can\'t convert \'";
+                            str += yytext;
+                            str += "\' to UTF-8";
+                            BEGIN(INITIAL);
+                            yyerror(str);
+                            return scan_throw(FLEX_ERROR);
+                        }
+                        yylval.str = new std::wstring(pwText);
+                        FREE(pwText);
+                        types::InternalType * pIT = symbol::Context::getInstance()->get(symbol::Symbol(*yylval.str));
+                        if (pIT && pIT->isCallable())
+                        {
+                            scan_throw(ID);
+                            BEGIN(SHELLMODE);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(ID);
+                        }
+                    }
+                    YY_BREAK
+
+                case 26:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(NOT);
+                    }
+                    YY_BREAK
+                case 27:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOLLAR);
+                    }
+                    YY_BREAK
+                case 28:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(BOOLTRUE);
+                    }
+                    YY_BREAK
+                case 29:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(BOOLFALSE);
+                    }
+                    YY_BREAK
+                case 30:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(AND);
+                    }
+                    YY_BREAK
+                case 31:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(ANDAND);
+                    }
+                    YY_BREAK
+                case 32:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(OR);
+                    }
+                    YY_BREAK
+                case 33:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(OROR);
+                    }
+                    YY_BREAK
+                case 34:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(LPAREN);
+                    }
+                    YY_BREAK
+                case 35:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(RPAREN);
+                    }
+                    YY_BREAK
+                case 36:
+                    YY_RULE_SETUP
+                    {
+                        scan_step();
+                        return scan_throw(SEMI);
+                    }
+                    YY_BREAK
+                case 37:
+                    YY_RULE_SETUP
+                    {
+                        scan_step();
+                        return scan_throw(COMMA);
+                    }
+                    YY_BREAK
+                case 38:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(COLON);
+                    }
+                    YY_BREAK
+                case 39:
+                    YY_RULE_SETUP
+                    {
+                        yy_push_state(MATRIX);
+                        paren_levels.push(0);
+                        ParserSingleInstance::pushControlStatus(Parser::WithinCell);
+                        return scan_throw(LBRACE);
+                    }
+                    YY_BREAK
+                case 40:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(RBRACE);
+                    }
+                    YY_BREAK
+                case 41:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOTQUOTE);
+                    }
+                    YY_BREAK
+                case 42:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOTTIMES);
+                    }
+                    YY_BREAK
+                case 43:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOTRDIVIDE);
+                    }
+                    YY_BREAK
+                case 44:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOTLDIVIDE);
+                    }
+                    YY_BREAK
+                case 45:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOTPOWER);
+                    }
+                    YY_BREAK
+                case 46:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(MINUS);
+                    }
+                    YY_BREAK
+                case 47:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(PLUS);
+                    }
+                    YY_BREAK
+                case 48:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(TIMES);
+                    }
+                    YY_BREAK
+                case 49:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(RDIVIDE);
+                    }
+                    YY_BREAK
+                case 50:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(LDIVIDE);
+                    }
+                    YY_BREAK
+                case 51:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(POWER);
+                    }
+                    YY_BREAK
+                case 52:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(KRONTIMES);
+                    }
+                    YY_BREAK
+                case 53:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(KRONRDIVIDE);
+                    }
+                    YY_BREAK
+                case 54:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(KRONLDIVIDE);
+                    }
+                    YY_BREAK
+                case 55:
+                    /* rule 55 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        unput(yytext[yyleng - 1]);
+                        return scan_throw(CONTROLTIMES);
+                    }
+                    YY_BREAK
+                case 56:
+                    /* rule 56 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        unput(yytext[yyleng - 1]);
+                        return scan_throw(CONTROLRDIVIDE);
+                    }
+                    YY_BREAK
+                case 57:
+                    /* rule 57 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        unput(yytext[yyleng - 1]);
+                        return scan_throw(CONTROLLDIVIDE);
+                    }
+                    YY_BREAK
+                case 58:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(EQ);
+                    }
+                    YY_BREAK
+                case 59:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(NE);
+                    }
+                    YY_BREAK
+                case 60:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(LT);
+                    }
+                    YY_BREAK
+                case 61:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(GT);
+                    }
+                    YY_BREAK
+                case 62:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(LE);
+                    }
+                    YY_BREAK
+                case 63:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(GE);
+                    }
+                    YY_BREAK
+                case 64:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(ASSIGN);
+                    }
+                    YY_BREAK
+                case 65:
+                    YY_RULE_SETUP
+                    {
+                        DEBUG("yy_push_state(MATRIX)");
+                        yy_push_state(MATRIX);
+                        paren_levels.push(0);
+                        ParserSingleInstance::pushControlStatus(Parser::WithinMatrix);
+                        return scan_throw(LBRACK);
+                    }
+                    YY_BREAK
+                case 66:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(RBRACK);
+                    }
+                    YY_BREAK
+                case 67:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(DOT);
+                    }
+                    YY_BREAK
+                case 68:
+                    YY_RULE_SETUP
+                    {
+                        ParserSingleInstance::pushControlStatus(Parser::WithinDots);
+                        yy_push_state(LINEBREAK);
+                    }
+                    YY_BREAK
+                case 69:
+                    YY_RULE_SETUP
+                    {
+                        yylval.number = atof(yytext);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] INTEGER : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] INTEGER : " << yytext << std::endl;
 #endif
-                    //  scan_step();
-                    return scan_throw(VARINT);
-                }
-                YY_BREAK
-            case 70:
-                YY_RULE_SETUP
-                {
-                    scan_exponent_convert(yytext);
-                    yylval.number = atof(yytext);
+                        //  scan_step();
+                        return scan_throw(VARINT);
+                    }
+                    YY_BREAK
+                case 70:
+                    YY_RULE_SETUP
+                    {
+                        scan_exponent_convert(yytext);
+                        yylval.number = atof(yytext);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] FLOATING : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] FLOATING : " << yytext << std::endl;
 #endif
-                    scan_step();
-                    return scan_throw(VARFLOAT);
-                }
-                YY_BREAK
-            case 71:
-                YY_RULE_SETUP
-                {
-                    yylval.number = atof(yytext);
+                        //scan_step();
+                        return scan_throw(VARFLOAT);
+                    }
+                    YY_BREAK
+                case 71:
+                    YY_RULE_SETUP
+                    {
+                        yylval.number = atof(yytext);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] FLOATING : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] FLOATING : " << yytext << std::endl;
 #endif
-                    scan_step();
-                    return scan_throw(VARFLOAT);
-                }
-                YY_BREAK
-            case 72:
-                YY_RULE_SETUP
-                {
-                    yylval.number = atof(yytext);
+                        //scan_step();
+                        return scan_throw(VARFLOAT);
+                    }
+                    YY_BREAK
+                case 72:
+                    YY_RULE_SETUP
+                    {
+                        yylval.number = atof(yytext);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] NUMBER : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] NUMBER : " << yytext << std::endl;
 #endif
-                    //  scan_step();
-                    return scan_throw(NUM);
-                }
-                YY_BREAK
-            case 73:
-                YY_RULE_SETUP
-                {
-                    yylval.number = atof(yytext);
+                        //  scan_step();
+                        return scan_throw(NUM);
+                    }
+                    YY_BREAK
+                case 73:
+                    YY_RULE_SETUP
+                    {
+                        yylval.number = atof(yytext);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] LITTLE : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] LITTLE : " << yytext << std::endl;
 #endif
-                    scan_step();
-                    return scan_throw(NUM);
-                }
-                YY_BREAK
-            case 74:
-                YY_RULE_SETUP
-                {
-                    wchar_t *pwText = to_wide_string(yytext);
-                    if (yytext != NULL && pwText == NULL)
-                    {
-                        std::string str = "Can\'t convert \'";
-                        str += yytext;
-                        str += "\' to UTF-8";
-                        BEGIN(INITIAL);
-                        yyerror(str);
-                        return scan_throw(FLEX_ERROR);
+                        //  scan_step();
+                        return scan_throw(NUM);
                     }
-                    yylval.str = new std::wstring(pwText);
-                    FREE(pwText);
+                    YY_BREAK
+                case 74:
+                    YY_RULE_SETUP
+                    {
+                        wchar_t *pwText = to_wide_string(yytext);
+                        if (yytext != NULL && pwText == NULL)
+                        {
+                            std::string str = "Can\'t convert \'";
+                            str += yytext;
+                            str += "\' to UTF-8";
+                            BEGIN(INITIAL);
+                            yyerror(str);
+                            return scan_throw(FLEX_ERROR);
+                        }
+                        yylval.str = new std::wstring(pwText);
+                        FREE(pwText);
 #ifdef TOKENDEV
-                    std::cout << "--> [DEBUG] ID : " << yytext << std::endl;
+                        std::cout << "--> [DEBUG] ID : " << yytext << std::endl;
 #endif
-                    //  scan_step();
-                    return scan_throw(ID);
-                }
-                YY_BREAK
-            case 75:
-                YY_RULE_SETUP
-                {
-                    yylval.comment = new std::wstring();
-                    comment_level = 1;
-                    ParserSingleInstance::pushControlStatus(Parser::WithinBlockComment);
-                    yy_push_state(REGIONCOMMENT);
-                }
-                YY_BREAK
-            case 76:
-                YY_RULE_SETUP
-                {
-                    pstBuffer.clear();
-                    yy_push_state(LINECOMMENT);
-                }
-                YY_BREAK
-            case 77:
-                YY_RULE_SETUP
-                {
-                    pstBuffer.clear();
-                    yy_push_state(DOUBLESTRING);
-                }
-                YY_BREAK
-            case 78:
-                YY_RULE_SETUP
-                {
-                    /*
-                    ** Matrix Transposition special behaviour
-                    ** ID' []' toto()' are transposition call
-                    */
-                    if (last_token == ID
-                    || last_token == RBRACK
-                    || last_token == RPAREN
-                    || last_token == RBRACE
-                    || last_token == VARINT
-                    || last_token == VARFLOAT
-                    || last_token == NUM
-                    || last_token == BOOLTRUE
-                    || last_token == BOOLFALSE)
-                    {
-                        return scan_throw(QUOTE);
+                        //  scan_step();
+                        return scan_throw(ID);
                     }
-                    else
+                    YY_BREAK
+                case 75:
+                    YY_RULE_SETUP
                     {
-                        pstBuffer.clear();
-                        yy_push_state(SIMPLESTRING);
+                        yylval.comment = new std::wstring();
+                        comment_level = 1;
+                        ParserSingleInstance::pushControlStatus(Parser::WithinBlockComment);
+                        yy_push_state(REGIONCOMMENT);
                     }
-                }
-                YY_BREAK
-            case 79:
-                YY_RULE_SETUP
-                {
-                    scan_step();
-                    scan_throw(SPACES);
-                }
-                YY_BREAK
-            case 80:
-                /* rule 80 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    if (last_token != EOL)
+                    YY_BREAK
+                case 76:
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(EOL);
+                        pstBuffer.clear();
+                        yy_push_state(LINECOMMENT);
                     }
-
-                }
-                YY_BREAK
-            case 81:
-                /* rule 81 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    if (last_token != EOL)
+                    YY_BREAK
+                case 77:
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(EOL);
+                        pstBuffer.clear();
+                        str_opener_column = yylloc.first_column;
+                        yy_push_state(DOUBLESTRING);
                     }
-                    scan_throw(EOL);
-                }
-                YY_BREAK
-            case 82:
-                /* rule 82 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 2;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    if (last_token != EOL)
+                    YY_BREAK
+                case 78:
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(EOL);
+                        /*
+                        ** Matrix Transposition special behaviour
+                        ** ID' []' toto()' are transposition call
+                        */
+                        if (last_token == ID
+                        || last_token == RBRACK
+                        || last_token == RPAREN
+                        || last_token == RBRACE
+                        || last_token == VARINT
+                        || last_token == VARFLOAT
+                        || last_token == NUM
+                        || last_token == BOOLTRUE
+                        || last_token == BOOLFALSE)
+                        {
+                            return scan_throw(QUOTE);
+                        }
+                        else
+                        {
+                            pstBuffer.clear();
+                            str_opener_column = yylloc.first_column;
+                            yy_push_state(SIMPLESTRING);
+                        }
                     }
-                    scan_throw(EOL);
-                }
-                YY_BREAK
-            case 83:
-                YY_RULE_SETUP
-                {
-                    std::string str = "Unexpected token \'";
-                    str += yytext;
-                    str += "\'";
-                    BEGIN(INITIAL);
-                    yyerror(str);
-                    return scan_throw(FLEX_ERROR);
-                }
-                YY_BREAK
-
-            case 84:
-                YY_RULE_SETUP
-                {
-                    paren_level++;
-                    return scan_throw(LPAREN);
-                }
-                YY_BREAK
-            case 85:
-                YY_RULE_SETUP
-                {
-                    paren_level--;
-                    return scan_throw(RPAREN);
-                }
-                YY_BREAK
-            case 86:
-                YY_RULE_SETUP
-                {
-                    unput(yytext[yyleng - 1]);
-                    if (last_token == ID
-                    || last_token == RPAREN
-                    || last_token == QUOTE
-                    || last_token == VARINT
-                    || last_token == VARFLOAT
-                    || last_token == NUM)
+                    YY_BREAK
+                case 79:
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(COMMA);
+                        scan_step();
+                        scan_throw(SPACES);
                     }
-                }
-                YY_BREAK
-            case 87:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(COLON);
-                }
-                YY_BREAK
-            case 88:
-                /* rule 88 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    if (last_token != DOTS && last_token != EOL)
+                    YY_BREAK
+                case 80:
+                    /* rule 80 can match eol */
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(EOL);
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        if (last_token != EOL)
+                        {
+                            return scan_throw(EOL);
+                        }
+
                     }
-                    scan_throw(EOL);
-                }
-                YY_BREAK
-            case 89:
-                YY_RULE_SETUP
-                {
-                    DEBUG("yy_pop_state()");
-                    yy_pop_state();
-                    ParserSingleInstance::popControlStatus();
-                    return scan_throw(RBRACK);
-                }
-                YY_BREAK
-            case 90:
-                YY_RULE_SETUP
-                {
-                    yy_pop_state();
-                    ParserSingleInstance::popControlStatus();
-                    return scan_throw(RBRACE);
-                }
-                YY_BREAK
-            case 91:
-            case 92:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(PLUS);
-                }
-                YY_BREAK
-            case 93:
-            case 94:
-                YY_RULE_SETUP
-                {
-                    return scan_throw(MINUS);
-                }
-                YY_BREAK
-            case 95:
-                YY_RULE_SETUP
-                {
-                    // no need to unput the '+'
-                    if (last_token != LBRACK
-                    && last_token != EOL
-                    && last_token != SEMI
-                    && last_token != COMMA
-                    && paren_level == 0)
+                    YY_BREAK
+                case 81:
+                    /* rule 81 can match eol */
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(COMMA);
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        if (last_token != EOL)
+                        {
+                            return scan_throw(EOL);
+                        }
+                        scan_throw(EOL);
                     }
-                    else
+                    YY_BREAK
+                case 82:
+                    /* rule 82 can match eol */
+                    YY_RULE_SETUP
                     {
-                        unput('+');
+                        yylloc.last_line += 2;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        if (last_token != EOL)
+                        {
+                            return scan_throw(EOL);
+                        }
+                        scan_throw(EOL);
                     }
-                }
-                YY_BREAK
-            case 96:
-                YY_RULE_SETUP
-                {
-                    unput('-');
-                    if (last_token != LBRACK
-                    && last_token != EOL
-                    && last_token != SEMI
-                    && last_token != COMMA
-                    && paren_level == 0)
+                    YY_BREAK
+                case 83:
+                    YY_RULE_SETUP
                     {
-                        return scan_throw(COMMA);
+                        std::string str = "Unexpected token \'";
+                        str += yytext;
+                        str += "\'";
+                        BEGIN(INITIAL);
+                        yyerror(str);
+                        return scan_throw(FLEX_ERROR);
                     }
-                }
-                YY_BREAK
-            case 97:
-                YY_RULE_SETUP
-                {
-                    std::string str = "Unexpected token \'";
-                    str += yytext;
-                    str += "\' within a matrix.";
-                    BEGIN(INITIAL);
-                    yyerror(str);
-                    return scan_throw(FLEX_ERROR);
-                }
-                YY_BREAK
-            case 98:
-                /* rule 98 can match eol */
-                YY_RULE_SETUP
-                {
-                    /* Just do nothing */
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    scan_throw(EOL);
-                }
-                YY_BREAK
-            case 99:
-                YY_RULE_SETUP
-                {
-                    /* Just do nothing */
-                    pstBuffer.clear();
-                    yy_push_state(LINECOMMENT);
-                    scan_throw(DOTS);
-                }
-                YY_BREAK
-            case YY_STATE_EOF(MATRIX):
-            {
-                yy_pop_state();
-            }
-            YY_BREAK
-
-            case 100:
-                /* rule 100 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    yy_pop_state();
-                    ParserSingleInstance::popControlStatus();
-                }
-                YY_BREAK
-            case 101:
-                YY_RULE_SETUP
-                {
-                    ++comment_level;
-                    yy_push_state(REGIONCOMMENT);
-                }
-                YY_BREAK
-            case 102:
-                YY_RULE_SETUP
-                {
-                    scan_throw(DOTS);
-                    pstBuffer.clear();
-                    yy_push_state(LINECOMMENT);
-                }
-                YY_BREAK
-            case 103:
-                YY_RULE_SETUP
-                {
-                    /* Do nothing... */
-                }
-                YY_BREAK
-            case YY_STATE_EOF(LINEBREAK):
-            {
-                yy_pop_state();
-            }
-            YY_BREAK
-            case 104:
-                YY_RULE_SETUP
-                {
-                    std::string str = "Unexpected token \'";
-                    str += yytext;
-                    str += "\' after line break with .. or ...";
-                    BEGIN(INITIAL);
-                    yyerror(str);
-                    return scan_throw(FLEX_ERROR);
-                }
-                YY_BREAK
+                    YY_BREAK
 
-            case 105:
-                /* rule 105 can match eol */
-                YY_RULE_SETUP
-                {
-                    //yylloc.last_line += 1;
-                    //yylloc.last_column = 1;
-                    //scan_step();
-                    yy_pop_state();
-                    for (int i = yyleng - 1 ; i >= 0 ; --i)
+                case 84:
+                    YY_RULE_SETUP
                     {
-                        //std::cerr << "Unputting i = {" << i << "}" << std::endl;
-                        //std::cerr << "Unputting {" << yytext[i] << "}" << std::endl;
-                        unput(yytext[i]);
-                        yylloc.last_column--;
+                        ++paren_levels.top();
+                        return scan_throw(LPAREN);
                     }
-                    /*
-                    ** To forgot comments after lines break
-                    */
-                    if (last_token != DOTS)
+                    YY_BREAK
+                case 85:
+                    YY_RULE_SETUP
                     {
-                        //std::cerr << "pstBuffer = {" << *pstBuffer << "}" << std::endl;
-                        //std::cerr << "pstBuffer->c_str() = {" << pstBuffer->c_str() << "}" << std::endl;
-                        wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
-                        //std::wcerr << L"pwstBuffer = W{" << pwstBuffer << L"}" << std::endl;
-                        if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
+                        --paren_levels.top();
+                        return scan_throw(RPAREN);
+                    }
+                    YY_BREAK
+                case 86:
+                    YY_RULE_SETUP
+                    {
+                        unput(yytext[yyleng - 1]);
+                        if (last_token == ID
+                        || last_token == RPAREN
+                        || last_token == QUOTE
+                        || last_token == VARINT
+                        || last_token == VARFLOAT
+                        || last_token == NUM)
                         {
-                            pstBuffer.clear();
-                            std::string str = "Can\'t convert \'";
-                            str += pstBuffer.c_str();
-                            str += "\' to UTF-8";
-                            BEGIN(INITIAL);
-                            yyerror(str);
-                            return scan_throw(FLEX_ERROR);
+                            return scan_throw(COMMA);
                         }
-                        yylval.comment = new std::wstring(pwstBuffer);
-                        pstBuffer.clear();
-                        FREE (pwstBuffer);
-                        return scan_throw(COMMENT);
                     }
-                    else
+                    YY_BREAK
+                case 87:
+                    YY_RULE_SETUP
                     {
-                        pstBuffer.clear();
+                        return scan_throw(COLON);
                     }
-                }
-                YY_BREAK
-            case YY_STATE_EOF(LINECOMMENT):
-            {
-                yy_pop_state();
-                wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
-                if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
-                {
-                    pstBuffer.clear();
-                    std::string str = "Can\'t convert \'";
-                    str += pstBuffer.c_str();
-                    str += "\' to UTF-8";
-                    BEGIN(INITIAL);
-                    yyerror(str);
-                    return scan_throw(FLEX_ERROR);
-                }
-                yylval.comment = new std::wstring(pwstBuffer);
-                pstBuffer.clear();
-                FREE (pwstBuffer);
-                return scan_throw(COMMENT);
-            }
-            YY_BREAK
-            case 106:
-                YY_RULE_SETUP
-                {
-                    // Put the char in a temporary CHAR buffer to go through UTF-8 trouble
-                    // only translate to WCHAR_T when popping state.
-                    pstBuffer += yytext;
-                }
-                YY_BREAK
-
-            case 107:
-                YY_RULE_SETUP
-                {
-                    --comment_level;
-                    if (comment_level == 0)
+                    YY_BREAK
+                case 88:
+                    /* rule 88 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        if (last_token != DOTS && last_token != EOL)
+                        {
+                            return scan_throw(EOL);
+                        }
+                        scan_throw(EOL);
+                    }
+                    YY_BREAK
+                case 89:
+                    YY_RULE_SETUP
                     {
+                        DEBUG("yy_pop_state()");
+                        yy_pop_state();
+                        paren_levels.pop();
                         ParserSingleInstance::popControlStatus();
+                        return scan_throw(RBRACK);
+                    }
+                    YY_BREAK
+                case 90:
+                    YY_RULE_SETUP
+                    {
                         yy_pop_state();
-                        //return scan_throw(BLOCKCOMMENT);
+                        paren_levels.pop();
+                        ParserSingleInstance::popControlStatus();
+                        return scan_throw(RBRACE);
                     }
-                }
-                YY_BREAK
-            case 108:
-                YY_RULE_SETUP
-                {
-                    ++comment_level;
-                    yy_push_state(REGIONCOMMENT);
-                }
-                YY_BREAK
-            case 109:
-                /* rule 109 can match eol */
-                YY_RULE_SETUP
-                {
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    *yylval.comment += L"\n//";
-                }
-                YY_BREAK
-            case 110:
-            case 111:
-                YY_RULE_SETUP
-                {
-                    wchar_t *pwText = to_wide_string(yytext);
-                    *yylval.comment += std::wstring(pwText);
-                    FREE(pwText);
-                }
-                YY_BREAK
-            case YY_STATE_EOF(REGIONCOMMENT):
-            {
-                yy_pop_state();
-                //    std::string str = "unexpected end of file in a comment";
-                //    scan_error(str);
-            }
-            YY_BREAK
-
-            case 112:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "\"";
-                }
-                YY_BREAK
-            case 113:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "'";
-                }
-                YY_BREAK
-            case 114:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "\"";
-                }
-                YY_BREAK
-            case 115:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "'";
-                }
-                YY_BREAK
-            case 116:
-                YY_RULE_SETUP
-                {
-                    yy_pop_state();
-                    scan_step();
-                    wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
-                    if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
+                    YY_BREAK
+                case 91:
+                case 92:
+                    YY_RULE_SETUP
                     {
-                        pstBuffer.clear();
-                        std::string str = "Can\'t convert \'";
-                        str += pstBuffer.c_str();
-                        str += "\' to UTF-8";
+                        return scan_throw(PLUS);
+                    }
+                    YY_BREAK
+                case 93:
+                case 94:
+                    YY_RULE_SETUP
+                    {
+                        return scan_throw(MINUS);
+                    }
+                    YY_BREAK
+                case 95:
+                    YY_RULE_SETUP
+                    {
+                        // no need to unput the '+'
+                        if (last_token != LBRACK
+                        && last_token != EOL
+                        && last_token != SEMI
+                        && last_token != COMMA
+                        && paren_levels.top() == 0)
+                        {
+                            return scan_throw(COMMA);
+                        }
+                        else
+                        {
+                            unput('+');
+                        }
+                    }
+                    YY_BREAK
+                case 96:
+                    YY_RULE_SETUP
+                    {
+                        unput('-');
+                        if (last_token != LBRACK
+                        && last_token != EOL
+                        && last_token != SEMI
+                        && last_token != COMMA
+                        && paren_levels.top() == 0)
+                        {
+                            return scan_throw(COMMA);
+                        }
+                    }
+                    YY_BREAK
+                case 97:
+                    YY_RULE_SETUP
+                    {
+                        std::string str = "Unexpected token \'";
+                        str += yytext;
+                        str += "\' within a matrix.";
                         BEGIN(INITIAL);
                         yyerror(str);
                         return scan_throw(FLEX_ERROR);
                     }
-                    yylval.str = new std::wstring(pwstBuffer);
-                    pstBuffer.clear();
-                    FREE(pwstBuffer);
-                    return scan_throw(STR);
-                }
-                YY_BREAK
-            case 117:
-                YY_RULE_SETUP
-                {
-                    pstBuffer.clear();
-                    BEGIN(INITIAL);
-                    yyerror("Heterogeneous string detected, starting with \' and ending with \".");
-                    return scan_throw(FLEX_ERROR);
-                }
-                YY_BREAK
-            case 118:
-                /* rule 118 can match eol */
-                YY_RULE_SETUP
-                {
-                    /* Do nothing... Just skip */
-                }
-                YY_BREAK
-            case 119:
-                /* rule 119 can match eol */
-                YY_RULE_SETUP
-                {
-                    pstBuffer.clear();
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    BEGIN(INITIAL);
-                    yyerror("Unexpected end of line in a string.");
-                    return scan_throw(FLEX_ERROR);
-                }
-                YY_BREAK
-            case YY_STATE_EOF(SIMPLESTRING):
-            {
-                pstBuffer.clear();
-                BEGIN(INITIAL);
-                yyerror("Unexpected end of file in a string.");
-                return scan_throw(FLEX_ERROR);
-            }
-            YY_BREAK
-            case 120:
-            case 121:
-                YY_RULE_SETUP
+                    YY_BREAK
+                case 98:
+                    /* rule 98 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        /* Just do nothing */
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        scan_throw(EOL);
+                    }
+                    YY_BREAK
+                case 99:
+                    YY_RULE_SETUP
+                    {
+                        /* Just do nothing */
+                        pstBuffer.clear();
+                        yy_push_state(LINECOMMENT);
+                        scan_throw(DOTS);
+                    }
+                    YY_BREAK
+                case YY_STATE_EOF(MATRIX):
                 {
-                    scan_step();
-                    pstBuffer += yytext;
+                    yy_pop_state();
+                    paren_levels.pop();
                 }
                 YY_BREAK
 
-            case 122:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "\"";
-                }
-                YY_BREAK
-            case 123:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "'";
-                }
-                YY_BREAK
-            case 124:
-                YY_RULE_SETUP
-                {
-                    pstBuffer += "\"";
-                }
-                YY_BREAK
-            case 125:
-                YY_RULE_SETUP
+                case 100:
+                    /* rule 100 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        yy_pop_state();
+                        ParserSingleInstance::popControlStatus();
+                    }
+                    YY_BREAK
+                case 101:
+                    YY_RULE_SETUP
+                    {
+                        ++comment_level;
+                        yy_push_state(REGIONCOMMENT);
+                    }
+                    YY_BREAK
+                case 102:
+                    YY_RULE_SETUP
+                    {
+                        scan_throw(DOTS);
+                        pstBuffer.clear();
+                        yy_push_state(LINECOMMENT);
+                    }
+                    YY_BREAK
+                case 103:
+                    YY_RULE_SETUP
+                    {
+                        /* Do nothing... */
+                    }
+                    YY_BREAK
+                case YY_STATE_EOF(LINEBREAK):
                 {
-                    pstBuffer += "'";
+                    yy_pop_state();
                 }
                 YY_BREAK
-            case 126:
-                YY_RULE_SETUP
+                case 104:
+                    YY_RULE_SETUP
+                    {
+                        std::string str = "Unexpected token \'";
+                        str += yytext;
+                        str += "\' after line break with .. or ...";
+                        BEGIN(INITIAL);
+                        yyerror(str);
+                        return scan_throw(FLEX_ERROR);
+                    }
+                    YY_BREAK
+
+                case 105:
+                    /* rule 105 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        //yylloc.last_line += 1;
+                        //yylloc.last_column = 1;
+                        //scan_step();
+                        yy_pop_state();
+                        for (int i = yyleng - 1 ; i >= 0 ; --i)
+                        {
+                            //std::cerr << "Unputting i = {" << i << "}" << std::endl;
+                            //std::cerr << "Unputting {" << yytext[i] << "}" << std::endl;
+                            unput(yytext[i]);
+                            yylloc.last_column--;
+                        }
+                        /*
+                        ** To forgot comments after lines break
+                        */
+                        if (last_token != DOTS)
+                        {
+                            //std::cerr << "pstBuffer = {" << *pstBuffer << "}" << std::endl;
+                            //std::cerr << "pstBuffer->c_str() = {" << pstBuffer->c_str() << "}" << std::endl;
+                            wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
+                            //std::wcerr << L"pwstBuffer = W{" << pwstBuffer << L"}" << std::endl;
+                            if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
+                            {
+                                pstBuffer.clear();
+                                std::string str = "Can\'t convert \'";
+                                str += pstBuffer.c_str();
+                                str += "\' to UTF-8";
+                                BEGIN(INITIAL);
+                                yyerror(str);
+                                return scan_throw(FLEX_ERROR);
+                            }
+                            yylval.comment = new std::wstring(pwstBuffer);
+                            pstBuffer.clear();
+                            FREE (pwstBuffer);
+                            return scan_throw(COMMENT);
+                        }
+                        else
+                        {
+                            pstBuffer.clear();
+                        }
+                    }
+                    YY_BREAK
+                case YY_STATE_EOF(LINECOMMENT):
                 {
                     yy_pop_state();
-                    scan_step();
                     wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
                     if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
                     {
@@ -3320,332 +3157,531 @@ do_action:    /* This label is used only to access EOF actions. */
                         yyerror(str);
                         return scan_throw(FLEX_ERROR);
                     }
-                    yylval.str = new std::wstring(pwstBuffer);
-                    pstBuffer.clear();
-                    FREE(pwstBuffer);
-                    return scan_throw(STR);
-                }
-                YY_BREAK
-            case 127:
-                YY_RULE_SETUP
-                {
+                    yylval.comment = new std::wstring(pwstBuffer);
                     pstBuffer.clear();
-                    BEGIN(INITIAL);
-                    yyerror("Heterogeneous string detected, starting with \" and ending with \'.");
-                    return scan_throw(FLEX_ERROR);
+                    FREE (pwstBuffer);
+                    return scan_throw(COMMENT);
                 }
                 YY_BREAK
-            case 128:
-                /* rule 128 can match eol */
-                YY_RULE_SETUP
+                case 106:
+                    YY_RULE_SETUP
+                    {
+                        // Put the char in a temporary CHAR buffer to go through UTF-8 trouble
+                        // only translate to WCHAR_T when popping state.
+                        pstBuffer += yytext;
+                    }
+                    YY_BREAK
+
+                case 107:
+                    YY_RULE_SETUP
+                    {
+                        --comment_level;
+                        if (comment_level == 0)
+                        {
+                            ParserSingleInstance::popControlStatus();
+                            yy_pop_state();
+                            //return scan_throw(BLOCKCOMMENT);
+                        }
+                    }
+                    YY_BREAK
+                case 108:
+                    YY_RULE_SETUP
+                    {
+                        ++comment_level;
+                        yy_push_state(REGIONCOMMENT);
+                    }
+                    YY_BREAK
+                case 109:
+                    /* rule 109 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        *yylval.comment += L"\n//";
+                    }
+                    YY_BREAK
+                case 110:
+                case 111:
+                    YY_RULE_SETUP
+                    {
+                        wchar_t *pwText = to_wide_string(yytext);
+                        *yylval.comment += std::wstring(pwText);
+                        FREE(pwText);
+                    }
+                    YY_BREAK
+                case YY_STATE_EOF(REGIONCOMMENT):
                 {
-                    /* Do nothing... Just skip */
+                    yy_pop_state();
+                    //    std::string str = "unexpected end of file in a comment";
+                    //    scan_error(str);
                 }
                 YY_BREAK
-            case 129:
-                /* rule 129 can match eol */
-                YY_RULE_SETUP
+
+                case 112:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "\"";
+                    }
+                    YY_BREAK
+                case 113:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "'";
+                    }
+                    YY_BREAK
+                case 114:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "\"";
+                    }
+                    YY_BREAK
+                case 115:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "'";
+                    }
+                    YY_BREAK
+                case 116:
+                    YY_RULE_SETUP
+                    {
+                        yy_pop_state();
+                        //scan_step();
+                        wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
+                        if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
+                        {
+                            pstBuffer.clear();
+                            std::string str = "Can\'t convert \'";
+                            str += pstBuffer.c_str();
+                            str += "\' to UTF-8";
+                            BEGIN(INITIAL);
+                            yyerror(str);
+                            return scan_throw(FLEX_ERROR);
+                        }
+                        yylval.str = new std::wstring(pwstBuffer);
+                        pstBuffer.clear();
+                        FREE(pwstBuffer);
+                        yylloc.first_column = str_opener_column;
+                        return scan_throw(STR);
+                    }
+                    YY_BREAK
+                case 117:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer.clear();
+                        BEGIN(INITIAL);
+                        yyerror("Heterogeneous string detected, starting with \' and ending with \".");
+                        return scan_throw(FLEX_ERROR);
+                    }
+                    YY_BREAK
+                case 118:
+                    /* rule 118 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        /* Do nothing... Just skip */
+                    }
+                    YY_BREAK
+                case 119:
+                    /* rule 119 can match eol */
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer.clear();
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        BEGIN(INITIAL);
+                        yyerror("Unexpected end of line in a string.");
+                        return scan_throw(FLEX_ERROR);
+                    }
+                    YY_BREAK
+                case YY_STATE_EOF(SIMPLESTRING):
                 {
                     pstBuffer.clear();
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
                     BEGIN(INITIAL);
-                    yyerror("Unexpected end of line in a string.");
+                    yyerror("Unexpected end of file in a string.");
                     return scan_throw(FLEX_ERROR);
                 }
                 YY_BREAK
-            case YY_STATE_EOF(DOUBLESTRING):
-            {
-                pstBuffer.clear();
-                BEGIN(INITIAL);
-                yyerror("Unexpected end of file in a string.");
-                return scan_throw(FLEX_ERROR);
-            }
-            YY_BREAK
-            case 130:
-            case 131:
-                YY_RULE_SETUP
-                {
-                    scan_step();
-                    pstBuffer += yytext;
-                }
-                YY_BREAK
+                case 120:
+                case 121:
+                    YY_RULE_SETUP
+                    {
+                        //scan_step();
+                        pstBuffer += yytext;
+                    }
+                    YY_BREAK
 
-            case 132:
-                YY_RULE_SETUP
-                {
-                    if (last_token == ID)
+                case 122:
+                    YY_RULE_SETUP
                     {
-                        scan_throw(SPACES);
-                        return ID;
+                        pstBuffer += "\"";
                     }
-                }
-                YY_BREAK
-            case 133:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    scan_step();
-                    return scan_throw(SEMI);
-                }
-                YY_BREAK
-            case 134:
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    scan_step();
-                    return scan_throw(COMMA);
-                }
-                YY_BREAK
-            case 135:
-                /* rule 135 can match eol */
-                YY_RULE_SETUP
-                {
-                    BEGIN(INITIAL);
-                    yylloc.last_line += 1;
-                    yylloc.last_column = 1;
-                    scan_step();
-                    return scan_throw(EOL);
-                }
-                YY_BREAK
-            case 136:
-                YY_RULE_SETUP
-                {
-                    if (last_token == STR || last_token == SPACES)
+                    YY_BREAK
+                case 123:
+                    YY_RULE_SETUP
                     {
-                        wchar_t *pwText = to_wide_string(yytext);
-                        yylval.str = new std::wstring(pwText);
-                        FREE(pwText);
+                        pstBuffer += "'";
+                    }
+                    YY_BREAK
+                case 124:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "\"";
+                    }
+                    YY_BREAK
+                case 125:
+                    YY_RULE_SETUP
+                    {
+                        pstBuffer += "'";
+                    }
+                    YY_BREAK
+                case 126:
+                    YY_RULE_SETUP
+                    {
+                        yy_pop_state();
+                        //scan_step();
+                        wchar_t *pwstBuffer = to_wide_string(pstBuffer.c_str());
+                        if (pstBuffer.c_str() != NULL && pwstBuffer == NULL)
+                        {
+                            pstBuffer.clear();
+                            std::string str = "Can\'t convert \'";
+                            str += pstBuffer.c_str();
+                            str += "\' to UTF-8";
+                            BEGIN(INITIAL);
+                            yyerror(str);
+                            return scan_throw(FLEX_ERROR);
+                        }
+                        yylval.str = new std::wstring(pwstBuffer);
+                        pstBuffer.clear();
+                        FREE(pwstBuffer);
+                        yylloc.first_column = str_opener_column;
                         return scan_throw(STR);
                     }
-                    else
+                    YY_BREAK
+                case 127:
+                    YY_RULE_SETUP
                     {
+                        pstBuffer.clear();
                         BEGIN(INITIAL);
-                        return scan_throw(ASSIGN);
+                        yyerror("Heterogeneous string detected, starting with \" and ending with \'.");
+                        return scan_throw(FLEX_ERROR);
                     }
-                }
-                YY_BREAK
-            case 137:
-                YY_RULE_SETUP
-                {
-                    if (last_token == STR || last_token == SPACES)
+                    YY_BREAK
+                case 128:
+                    /* rule 128 can match eol */
+                    YY_RULE_SETUP
                     {
-                        wchar_t *pwText = to_wide_string(yytext);
-                        yylval.str = new std::wstring(pwText);
-                        FREE(pwText);
-                        return scan_throw(STR);
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        /* Do nothing... Just skip */
                     }
-                    else
+                    YY_BREAK
+                case 129:
+                    /* rule 129 can match eol */
+                    YY_RULE_SETUP
                     {
+                        pstBuffer.clear();
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
                         BEGIN(INITIAL);
-                        return scan_throw(LPAREN);
+                        yyerror("Unexpected end of line in a string.");
+                        return scan_throw(FLEX_ERROR);
                     }
+                    YY_BREAK
+                case YY_STATE_EOF(DOUBLESTRING):
+                {
+                    pstBuffer.clear();
+                    BEGIN(INITIAL);
+                    yyerror("Unexpected end of file in a string.");
+                    return scan_throw(FLEX_ERROR);
                 }
                 YY_BREAK
-            case 138:
-                YY_RULE_SETUP
-                {
-                    if (last_token == STR || last_token == SPACES)
+                case 130:
+                case 131:
+                    YY_RULE_SETUP
                     {
-                        wchar_t *pwText = to_wide_string(yytext);
-                        yylval.str = new std::wstring(pwText);
-                        FREE(pwText);
-                        return scan_throw(STR);
+                        //scan_step();
+                        pstBuffer += yytext;
                     }
-                    else
+                    YY_BREAK
+
+                case 132:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == ID)
+                        {
+                            scan_throw(SPACES);
+                            return ID;
+                        }
+                    }
+                    YY_BREAK
+                case 133:
+                    YY_RULE_SETUP
                     {
                         BEGIN(INITIAL);
-                        return scan_throw(LT);
+                        scan_step();
+                        return scan_throw(SEMI);
                     }
-                }
-                YY_BREAK
-            case 139:
-                YY_RULE_SETUP
-                {
-                    if (last_token == STR || last_token == SPACES)
+                    YY_BREAK
+                case 134:
+                    YY_RULE_SETUP
                     {
-                        wchar_t *pwText = to_wide_string(yytext);
-                        yylval.str = new std::wstring(pwText);
-                        FREE(pwText);
-                        return scan_throw(STR);
+                        BEGIN(INITIAL);
+                        scan_step();
+                        return scan_throw(COMMA);
                     }
-                    else
+                    YY_BREAK
+                case 135:
+                    /* rule 135 can match eol */
+                    YY_RULE_SETUP
                     {
                         BEGIN(INITIAL);
-                        return scan_throw(GT);
+                        yylloc.last_line += 1;
+                        yylloc.last_column = 1;
+                        scan_step();
+                        return scan_throw(EOL);
                     }
-                }
-                YY_BREAK
-            case 140:
-                YY_RULE_SETUP
-                {
-                    if (last_token == STR || last_token == SPACES)
+                    YY_BREAK
+                case 136:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == STR || last_token == SPACES)
+                        {
+                            wchar_t *pwText = to_wide_string(yytext);
+                            yylval.str = new std::wstring(pwText);
+                            FREE(pwText);
+                            return scan_throw(STR);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(ASSIGN);
+                        }
+                    }
+                    YY_BREAK
+                case 137:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == STR || last_token == SPACES)
+                        {
+                            wchar_t *pwText = to_wide_string(yytext);
+                            yylval.str = new std::wstring(pwText);
+                            FREE(pwText);
+                            return scan_throw(STR);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(LPAREN);
+                        }
+                    }
+                    YY_BREAK
+                case 138:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == STR || last_token == SPACES)
+                        {
+                            wchar_t *pwText = to_wide_string(yytext);
+                            yylval.str = new std::wstring(pwText);
+                            FREE(pwText);
+                            return scan_throw(STR);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(LT);
+                        }
+                    }
+                    YY_BREAK
+                case 139:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == STR || last_token == SPACES)
+                        {
+                            wchar_t *pwText = to_wide_string(yytext);
+                            yylval.str = new std::wstring(pwText);
+                            FREE(pwText);
+                            return scan_throw(STR);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(GT);
+                        }
+                    }
+                    YY_BREAK
+                case 140:
+                    YY_RULE_SETUP
+                    {
+                        if (last_token == STR || last_token == SPACES)
+                        {
+                            wchar_t *pwText = to_wide_string(yytext);
+                            yylval.str = new std::wstring(pwText);
+                            FREE(pwText);
+                            return scan_throw(STR);
+                        }
+                        else
+                        {
+                            BEGIN(INITIAL);
+                            return scan_throw(NOT);
+                        }
+                    }
+                    YY_BREAK
+                case 141:
+                    YY_RULE_SETUP
                     {
                         wchar_t *pwText = to_wide_string(yytext);
                         yylval.str = new std::wstring(pwText);
                         FREE(pwText);
                         return scan_throw(STR);
                     }
-                    else
-                    {
-                        BEGIN(INITIAL);
-                        return scan_throw(NOT);
-                    }
-                }
-                YY_BREAK
-            case 141:
-                YY_RULE_SETUP
+                    YY_BREAK
+                case YY_STATE_EOF(SHELLMODE):
                 {
-                    wchar_t *pwText = to_wide_string(yytext);
-                    yylval.str = new std::wstring(pwText);
-                    FREE(pwText);
-                    return scan_throw(STR);
+                    BEGIN(INITIAL);
                 }
                 YY_BREAK
-            case YY_STATE_EOF(SHELLMODE):
-            {
-                BEGIN(INITIAL);
-            }
-            YY_BREAK
 
-            case 142:
-                YY_RULE_SETUP
-                ECHO;
-                YY_BREAK
-            case YY_STATE_EOF(INITIAL):
-            case YY_STATE_EOF(BEGINID):
-                yyterminate();
+                case 142:
+                    YY_RULE_SETUP
+                    ECHO;
+                    YY_BREAK
+                case YY_STATE_EOF(INITIAL):
+                case YY_STATE_EOF(BEGINID):
+                    yyterminate();
 
-            case YY_END_OF_BUFFER:
-            {
-                /* Amount of text matched not including the EOB char. */
-                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+                case YY_END_OF_BUFFER:
+                {
+                    /* Amount of text matched not including the EOB char. */
+                    int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
-                /* Undo the effects of YY_DO_BEFORE_ACTION. */
-                *yy_cp = (yy_hold_char);
-                YY_RESTORE_YY_MORE_OFFSET
+                    /* Undo the effects of YY_DO_BEFORE_ACTION. */
+                    *yy_cp = (yy_hold_char);
+                    YY_RESTORE_YY_MORE_OFFSET
 
-                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-                {
-                    /* We're scanning a new file or input source.  It's
-                     * possible that this happened because the user
-                     * just pointed yyin at a new source and called
-                     * yylex().  If so, then we have to assure
-                     * consistency between YY_CURRENT_BUFFER and our
-                     * globals.  Here is the right place to do so, because
-                     * this is the first action (other than possibly a
-                     * back-up) that will match for the new input source.
-                     */
-                    (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                    YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-                    YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                }
+                    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+                    {
+                        /* We're scanning a new file or input source.  It's
+                         * possible that this happened because the user
+                         * just pointed yyin at a new source and called
+                         * yylex().  If so, then we have to assure
+                         * consistency between YY_CURRENT_BUFFER and our
+                         * globals.  Here is the right place to do so, because
+                         * this is the first action (other than possibly a
+                         * back-up) that will match for the new input source.
+                         */
+                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+                    }
 
-                /* Note that here we test for yy_c_buf_p "<=" to the position
-                 * of the first EOB in the buffer, since yy_c_buf_p will
-                 * already have been incremented past the NUL character
-                 * (since all states make transitions on EOB to the
-                 * end-of-buffer state).  Contrast this with the test
-                 * in input().
-                 */
-                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-                {
-                    /* This was really a NUL. */
-                    yy_state_type yy_next_state;
+                    /* Note that here we test for yy_c_buf_p "<=" to the position
+                     * of the first EOB in the buffer, since yy_c_buf_p will
+                     * already have been incremented past the NUL character
+                     * (since all states make transitions on EOB to the
+                     * end-of-buffer state).  Contrast this with the test
+                     * in input().
+                     */
+                    if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                    {
+                        /* This was really a NUL. */
+                        yy_state_type yy_next_state;
 
-                    (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
-                    yy_current_state = yy_get_previous_state(  );
+                        yy_current_state = yy_get_previous_state(  );
 
-                    /* Okay, we're now positioned to make the NUL
-                     * transition.  We couldn't have
-                     * yy_get_previous_state() go ahead and do it
-                     * for us because it doesn't know how to deal
-                     * with the possibility of jamming (and we don't
-                     * want to build jamming into it because then it
-                     * will run more slowly).
-                     */
+                        /* Okay, we're now positioned to make the NUL
+                         * transition.  We couldn't have
+                         * yy_get_previous_state() go ahead and do it
+                         * for us because it doesn't know how to deal
+                         * with the possibility of jamming (and we don't
+                         * want to build jamming into it because then it
+                         * will run more slowly).
+                         */
 
-                    yy_next_state = yy_try_NUL_trans( yy_current_state );
+                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-                    yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
-                    if ( yy_next_state )
-                    {
-                        /* Consume the NUL. */
-                        yy_cp = ++(yy_c_buf_p);
-                        yy_current_state = yy_next_state;
-                        goto yy_match;
-                    }
+                        if ( yy_next_state )
+                        {
+                            /* Consume the NUL. */
+                            yy_cp = ++(yy_c_buf_p);
+                            yy_current_state = yy_next_state;
+                            goto yy_match;
+                        }
 
-                    else
-                    {
-                        yy_cp = (yy_c_buf_p);
-                        goto yy_find_action;
+                        else
+                        {
+                            yy_cp = (yy_c_buf_p);
+                            goto yy_find_action;
+                        }
                     }
-                }
 
-                else switch ( yy_get_next_buffer(  ) )
-                    {
-                        case EOB_ACT_END_OF_FILE:
+                    else switch ( yy_get_next_buffer(  ) )
                         {
-                            (yy_did_buffer_switch_on_eof) = 0;
-
-                            if ( yywrap( ) )
+                            case EOB_ACT_END_OF_FILE:
                             {
-                                /* Note: because we've taken care in
-                                 * yy_get_next_buffer() to have set up
-                                 * yytext, we can now set up
-                                 * yy_c_buf_p so that if some total
-                                 * hoser (like flex itself) wants to
-                                 * call the scanner after we return the
-                                 * YY_NULL, it'll still work - another
-                                 * YY_NULL will get returned.
-                                 */
-                                (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-                                yy_act = YY_STATE_EOF(YY_START);
-                                goto do_action;
-                            }
+                                (yy_did_buffer_switch_on_eof) = 0;
 
-                            else
-                            {
-                                if ( ! (yy_did_buffer_switch_on_eof) )
+                                if ( yywrap( ) )
+                                {
+                                    /* Note: because we've taken care in
+                                     * yy_get_next_buffer() to have set up
+                                     * yytext, we can now set up
+                                     * yy_c_buf_p so that if some total
+                                     * hoser (like flex itself) wants to
+                                     * call the scanner after we return the
+                                     * YY_NULL, it'll still work - another
+                                     * YY_NULL will get returned.
+                                     */
+                                    (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+                                    yy_act = YY_STATE_EOF(YY_START);
+                                    goto do_action;
+                                }
+
+                                else
                                 {
-                                    YY_NEW_FILE;
+                                    if ( ! (yy_did_buffer_switch_on_eof) )
+                                    {
+                                        YY_NEW_FILE;
+                                    }
                                 }
+                                break;
                             }
-                            break;
-                        }
 
-                        case EOB_ACT_CONTINUE_SCAN:
-                            (yy_c_buf_p) =
-                                (yytext_ptr) + yy_amount_of_matched_text;
+                            case EOB_ACT_CONTINUE_SCAN:
+                                (yy_c_buf_p) =
+                                    (yytext_ptr) + yy_amount_of_matched_text;
 
-                            yy_current_state = yy_get_previous_state(  );
+                                yy_current_state = yy_get_previous_state(  );
 
-                            yy_cp = (yy_c_buf_p);
-                            yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                            goto yy_match;
+                                yy_cp = (yy_c_buf_p);
+                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                                goto yy_match;
 
-                        case EOB_ACT_LAST_MATCH:
-                            (yy_c_buf_p) =
-                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+                            case EOB_ACT_LAST_MATCH:
+                                (yy_c_buf_p) =
+                                    &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
-                            yy_current_state = yy_get_previous_state(  );
+                                yy_current_state = yy_get_previous_state(  );
 
-                            yy_cp = (yy_c_buf_p);
-                            yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-                            goto yy_find_action;
-                    }
-                break;
-            }
+                                yy_cp = (yy_c_buf_p);
+                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                                goto yy_find_action;
+                        }
+                    break;
+                }
 
-            default:
-                YY_FATAL_ERROR(
-                    "fatal flex scanner internal error--no action found" );
-        } /* end of action switch */
-    } /* end of scanning one token */
+                default:
+                    YY_FATAL_ERROR(
+                        "fatal flex scanner internal error--no action found" );
+            } /* end of action switch */
+        } /* end of scanning one token */
+    } /* end of user's declarations */
 } /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer