title: 'unrecognized rule' and 'fatal parse error' on FLEX
body: <p>i have to make a parser for a simplified Python 3 using flex and bison and im getting these 2 errors.terminal says they are on the 79th line out of the 78 i've written. i have other '.l' examples from class with this sort of format and they work fine</p>
  
  <p>this is what i've written</p>
  
  <pre><code>    %option noyywrap
  
  %{ 
  #define YYSTYPE double
  #include "scanner.tab.h"
  #include &lt;stdlib.h&gt;
  #include &lt;string&gt;
  
  extern int flag;
  extern int line;
  %}
  
  DELIMITER    [ ]+|[/t]+
  
  KEYWORD      False|class|finally|is|return|None|continue|for|lambda|try|True|def|from|nonlocal|while|and|del|global|not|with|as|elif|if|or|yield|assert|else|import|pass|break|except|in|raise
  
  OPERATOR     ([+\-$@&amp;|^~])|(\*{1,2})|(\/{1,2})|(&lt;[=&lt;]?)|(&gt;[=&gt;]?)|(==)|!
  
  COMMENT      #.+
  
  IDENTIFIER   [a-zA-Z_][a-zA-Z0-9_]*
  ID_ERR       [0-9]{IDENTIFIER}
  
  STRINGESCAPESEQ  [\\].  
  SHORTSTRINGCHAR1 [^\\'\n]*
  SHORTSTRINGCHAR2 [^\\"\n]*
  SHORTSTRINGITEM1 {SHORTSTRINGCHAR1}|{STRINGESCAPESEQ}
  SHORTSTRINGITEM2 {SHORTSTRINGCHAR2}|{STRINGESCAPESEQ}
  STRING       [']{SHORTSTRINGITEM1}*[']|(["]{SHORTSTRINGITEM2}*["])
  STRING_ERR   ['].[^'\n\t]*|["].[^"\n\t]* 
  
  BINDIGIT     [01]
  BININTEGER   0[bB]{BINDIGIT}+
  BIN_ERR1     0[Bb]+{BINDIGIT}+
  
  DIGIT        [0-9]
  NONZERODIGIT     [1-9]
  INTEGER      {NONZERODIGIT}{DIGIT}*|[0]+
  INT_ERR1     {INTEGER}[a-zA-Z]{DIGIT}
  INT_ERR2     [-+]{INTEGER}
  INT_ERR3     [0+]{INTEGER}
  
  INTPART      {DIGIT}+
  EXPONENT     [eE][+-]*{INTPART}
  FRACTION     [\.]{INTPART}
  EXPONENTFLOAT    ({INTPART}|{POINTFLOAT}){EXPONENT}
  POINTFLOAT   {INTPART}*{FRACTION}|{INTPART}[\.]
  FLOATNUMBER  {POINTFLOAT}|{EXPONENTFLOAT}
  FLOAT_ERR_POINT  {INTPART}*[\.]+{DIGIT}+[\.]*{DIGIT}*|{INTPART}[\.]+
  FLOAT_ERR_SIGN   ([-+]{FLOATNUMBER})
  FLOAT_ERR_LETTER {FLOATNUMBER}[A-Za-z]+
  
  IMAGINARYNUMBER  ({FLOATNUMBER}|{INTPART})[jJ]
  
  %%
  
  {DELIMITER}     { }
  {KEYWORD}       { return KEYWORD; }
  {OPERATOR}      { }
  {COMMENT}       { printf("Line %d: Found COMMENT\n", line); }   
  {IDENTIFIER}        { printf("Line %d: Found IDENTIFIER %s\n", line, yytext);                    return IDENTIFIER; }
  {ID_ERR}        { printf("Line %d: !!ERROR!!\tWrong IDENTIFIER statement %s\n", line, yytext);           return ID_ERR;}  
  {STRING}        { printf("Line %d: Found STRING %s\n", line, yytext);                        return STRING; }
  {STRING_ERR}        { printf("Line %d: !!ERROR!!\tWrong STRING statement %s\n", line, yytext);           return STRING_ERR;}
  {BININTEGER}        { printf("Line %d: Found BINARY INTEGER NUMBER %s\n", line, yytext);                 return BININTEGER; }
  {BIN_ERR1}      { printf("Line %d: !!ERROR!!\tWrong BINARY NUMBER statement, too many 'Bb's%s\n", line, yytext); return BIN_ERR1;}
  {INTEGER}       { printf("Line %d: Found INTEGER NUMBER %s\n", line, yytext);                    return INTEGER; }
  {INT_ERR1}      { printf("Line %d: !!ERROR!!\tWrong INT statement %s\n", line, yytext);              return INT_ERR1;}
  {INT_ERR2}      { printf("Line %d: !!ERROR!!\tWrong INT statement, '+/-' found %s\n", line, yytext);         return INT_ERR2;}
  {INT_ERR3}      { printf("Line %d: !!ERROR!!\tWrong INT statement, first digit(s) zeros %s\n", line, yytext);    return INT_ERR3;}
  {FLOATNUMBER}       { printf("Line %d: Found FLOAT NUMBER %s\n", line, yytext);                  return FLOATNUMBER; }
  {FLOAT_ERR_POINT}   { printf("Line %d: !!ERROR!!\tWrong FLOAT statement, too many '.' %s\n", line, yytext);      return FLOAT_ERR_POINT;}
  {FLOAT_ERR_POINT}   { printf("Line %d: !!ERROR!!\tWrong FLOAT statement, '+/-' FOUND %s\n", line, yytext);       return FLOAT_ERR_SIGN;}
  {FLOAT_ERR_LETTER   { printf("Line %d: !!ERROR!!\tWrong FLOAT statement, letter FOUND %s\n", line, yytext);      return FLOAT_ERR_LETTER;}
  {IMAGINARYNUMBER}   { printf("Line %d: Found IMAGINARY NUMBER %s\n", line, yytext);                  return IMAGINARYNUMBER; }
  .           { printf("Line %d: UNKNOWN TOKEN:%s", line, yytext);    BEGIN(error);}
  \n                  { line++; }
  &lt;&lt;EOF&gt;&gt;         { printf("#END OF FILE\n"); exit(0); }
  </code></pre>
  
  <p>the full error output :</p>
  
  <pre><code> flex scanner.l
   scanner.l:79: unrecognized rule
   scanner.l:79: fatal parse error
  </code></pre>