Exemple #1
0
        public Statment SS(ref Statments ss)
        {
            Statment s1 = S();

            if (s1 != null)
            {
                ss.ADD(s1);
                if (Expect(TokenKind.EOF))
                {
                    return(null);
                }
                else
                {
                    lex.UngetToken();
                }
                if (Expect(TokenKind.ENDFOR, TokenKind.ENDIF, TokenKind.ELSE))
                {
                    lex.UngetToken();
                    return(s1);
                }
                else
                {
                    lex.UngetToken();
                    return(SS(ref ss));
                }
            }
            return(null);
        }
Exemple #2
0
 public bool ss()
 {
     if (s())
     {
         if (Expect(TokenKind.EOF))
         {
             return(true);
         }
         else
         {
             lex.UngetToken();//Looking forward to determine if the Sequence of statements is finished
             if (Expect(TokenKind.ENDFOR, TokenKind.ENDIF, TokenKind.ELSE))
             {
                 lex.UngetToken();
                 return(true);
             }
             lex.UngetToken();
             return(ss());
         }
     }
     else
     {
         return(false);
     }
 }