Demo entry 6349630

parser

   

Submitted by anonymous on Feb 24, 2017 at 09:55
Language: C++. Code size: 389 Bytes.

class Parser {
public:
	Parser(int, const Lexer&);
	Parser(const Parser&);
	Parser& operator=(const Parser&);
	void consume();
	void match(int);
	Token LT(int) const;
	int LA(int) const;
	void read(const std::string&);
	virtual void parse() = 0;
	virtual ~Parser() { delete[] lookahead; }
protected:
	std::shared_ptr<Lexer> input;
	int k;
	Token* lookahead;
	int p = 0;
};

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).