#ifndef __SCANNERS_S_EXPRESSION_PARSER_H
#define __SCANNERS_S_EXPRESSION_PARSER_H
/*
5D programming language
Copyright (C) 2011 Danny Milosavljevic
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
*/
#include
#include "Scanners/Scanner"
#include "Values/Values"
namespace Scanners {
class SExpressionParser {
private:
Scanner* scanner;
Values::NodeT parse_S_list_body(void); // Cons
inline Values::NodeT parse_value(void) {
return(scanner->consume());
}
public:
SExpressionParser(void);
Values::NodeT parse(Values::NodeT /*symbol*/ terminator);
Values::NodeT parse_S_list(bool B_consume_closing_brace); // Cons
void parse_closing_brace(void);
Values::NodeT parse_S_Expression(void);
public:
void push(FILE* input_file, int line_number, const char* input_name);
void pop(void);
inline bool EOFP(void) const {
return(scanner->EOFP());
}
int getPosition(void) const;
};
bool macro_operator_P(Values::NodeT operator_);
}; /* end namespace */
#endif /* ndef __SCANNERS_S_EXPRESSION_PARSER_H */