#ifndef _LINEPARSER_
#define _LINEPARSER_

#include <stdio.h>

struct Cmd;

struct LineParser
{
	char *line; // parsed line
	char *p; // actual position on it
	size_t line_size;

	LineParser ();
	~LineParser ();

	virtual int error (const char *, ...);
	int cmd (Cmd *&cmd);
	int eol ();
	int null ();
	int get_char (char &);
	int space ();
	int digit ();
	int inc ();
	int inc (char);
	virtual int reset_line ();
	int jmp (char);
	int skip (const char *);
	int skip_space ();
	int match (const char *);
	int match_space (const char *);
	int num (int &);
	int num (double &);
	int geom (int &, int &, int &, int &);
	int pos (int &, int &, int, int);
	int token (char *&);
	int stripcpy (char *&);
	int stripcpy2 (char *&);
};

extern LineParser *lps;

#endif // _LINEPARSER_
