kolibrios-fun/contrib/media/updf/include/lispparser.h
right-hearted 4f7ee97ec9 uPDF with buttons
git-svn-id: svn://kolibrios.org@4680 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-03-22 21:00:40 +00:00

52 lines
1.2 KiB
C++

/** \file lispparser.h
* parsing and printing in the old-fashioned lisp style
*
*/
#ifndef __lispparser_h__
#define __lispparser_h__
#include "yacasbase.h"
#include "lispobject.h"
#include "tokenizer.h"
#include "lispio.h"
#include "lisphash.h"
#include "evalfunc.h"
class LispParser : public YacasBase
{
public:
LispParser(LispTokenizer& aTokenizer, LispInput& aInput,
LispEnvironment& aEnvironment);
virtual ~LispParser();
virtual void Parse(LispPtr& aResult );
protected:
void ParseList(LispPtr& aResult);
void ParseAtom(LispPtr& aResult,LispString * aToken);
public:
LispTokenizer& iTokenizer;
LispInput& iInput;
LispEnvironment& iEnvironment;
LispInt iListed;
};
class LispPrinter : public YacasBase
{
public:
virtual ~LispPrinter();
virtual void Print(LispPtr& aExpression, LispOutput& aOutput, LispEnvironment& aEnvironment);
virtual void RememberLastChar(LispChar aChar);
private:
void PrintExpression(LispPtr& aExpression, LispOutput& aOutput,
LispEnvironment& aEnvironment,
LispInt aDepth=0);
void Indent(LispOutput& aOutput, LispInt aDepth);
};
#endif