recursivedescent.h (3242B)
1 /* -*- Mode: c++; -*- */ 2 /* -------------------------------------------------------------------- 3 * Filename: 4 * src/parsers/imap/recursivedescent/recursivedescent.h 5 * 6 * Description: 7 * Declaration of a recursive descent IMAP command 8 * parser. 9 * 10 * Authors: 11 * Andreas Aardal Hanssen <andreas-binc curly bincimap spot org> 12 * 13 * Bugs: 14 * 15 * ChangeLog: 16 * 17 * -------------------------------------------------------------------- 18 * Copyright 2002-2005 Andreas Aardal Hanssen 19 * 20 * This program is free software; you can redistribute it and/or modify 21 * it under the terms of the GNU General Public License as published by 22 * the Free Software Foundation; either version 2 of the License, or 23 * (at your option) any later version. 24 * 25 * This program is distributed in the hope that it will be useful, 26 * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 * GNU General Public License for more details. 29 * 30 * You should have received a copy of the GNU General Public License 31 * along with this program; if not, write to the Free Software 32 * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. 33 * -------------------------------------------------------------------- 34 */ 35 #ifdef HAVE_CONFIG_H 36 #include <config.h> 37 #endif 38 39 #ifndef expectcommand_h_inluded 40 #define expectcommand_h_inluded 41 #include <stack> 42 #include <string> 43 44 #include "imapparser.h" 45 #include "operators.h" 46 47 namespace Binc { 48 49 extern std::stack<int> inputBuffer; 50 extern int charnr; 51 52 int readChar(void); 53 void unReadChar(int c_in); 54 void unReadChar(const std::string &s_in); 55 56 Operator::ParseResult expectTag(std::string &s_in); 57 Operator::ParseResult expectTagChar(int &c_in); 58 Operator::ParseResult expectSPACE(void); 59 60 Operator::ParseResult expectFlag(std::vector<std::string> &v_in); 61 62 Operator::ParseResult expectListMailbox(std::string &s_in); 63 Operator::ParseResult expectListWildcards(int &c_in); 64 65 Operator::ParseResult expectDateTime(std::string &s_in); 66 Operator::ParseResult expectTime(std::string &s_in); 67 Operator::ParseResult expectZone(std::string &s_in); 68 69 Operator::ParseResult expectMailbox(std::string &s_in); 70 Operator::ParseResult expectAstring(std::string &s_in); 71 Operator::ParseResult expectAtom(std::string &s_in); 72 Operator::ParseResult expectAtomChar(int &i_in); 73 Operator::ParseResult expectString(std::string &s_in); 74 75 Operator::ParseResult expectDate(std::string &s_in); 76 77 Operator::ParseResult expectNumber(unsigned int &i_in); 78 Operator::ParseResult expectDigit(unsigned int &i_in); 79 Operator::ParseResult expectDigitNZ(unsigned int &i_in); 80 81 Operator::ParseResult expectLiteral(std::string &s_in); 82 Operator::ParseResult expectQuoted(std::string &s_in); 83 Operator::ParseResult expectQuotedChar(int &c_in); 84 85 Operator::ParseResult expectSet(SequenceSet &s_in); 86 Operator::ParseResult expectSequenceNum(unsigned int &i_in); 87 Operator::ParseResult expectNZNumber(unsigned int &i_in); 88 89 Operator::ParseResult expectCRLF(void); 90 Operator::ParseResult expectCR(void); 91 Operator::ParseResult expectLF(void); 92 93 Operator::ParseResult expectThisString(const std::string &s_in); 94 } 95 96 97 #endif