Esempio n. 1
0
 public void Expr()
 {
     if (l.LexKind == Tok.ID || l.LexKind == Tok.INUM)
     {
         l.NextLexem();
     }
     else
     {
         SyntaxError("expression expected");
     }
 }
Esempio n. 2
0
 public void Expr()
 {
     if (l.LexKind == Tok.ID || l.LexKind == Tok.INUM)
     {
         l.NextLexem();
     }
     else if (l.LexKind == Tok.LEFTPAR)
     {
         l.NextLexem();
         E();
         if (l.LexKind == Tok.RIGHTPAR)
         {
             l.NextLexem();
         }
         else
         {
             SyntaxError("right parentheses expected");
         }
     }
     else
     {
         SyntaxError("expression expected");
     }
 }
Esempio n. 3
0
 public void A()
 {
     if (l.LexKind == Tok.PLUS || l.LexKind == Tok.MINUS)
     {
         l.NextLexem();
         T();
         A();
     }
 }
Esempio n. 4
0
 public void Assign()
 {
     l.NextLexem();  // пропуск id
     if (l.LexKind == Tok.ASSIGN)
     {
         l.NextLexem();
     }
     else
     {
         SyntaxError(":= expected");
     }
     E();
 }