public void Expr() { if (l.LexKind == Tok.ID || l.LexKind == Tok.INUM) { l.NextLexem(); } else { SyntaxError("expression expected"); } }
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"); } }
public void A() { if (l.LexKind == Tok.PLUS || l.LexKind == Tok.MINUS) { l.NextLexem(); T(); A(); } }
public void Assign() { l.NextLexem(); // пропуск id if (l.LexKind == Tok.ASSIGN) { l.NextLexem(); } else { SyntaxError(":= expected"); } E(); }