#ifndef ASTXI_H #define ASTXI_H /* astxi.h Script Language Development Kit Execute from Abstract Syntax Tree Copyright (c) 1996-2002 Parsifal Software. All Rights Reserved. For further information about this program or the AnaGram parser generator, please contact: Parsifal Software http://www.parsifalsoft.com info@parsifalsoft.com +1-800-879-2577, Voice/Fax +1-508-358-2564 P.O. Box 219 Wayland, MA 01778 USA */ #include "astdefs.h" class Interpreter { AbstractSyntaxTree tree; Dataset &dataset; Value returnValue; // Enumeration to specify outcome of the execute function enum Outcome { normal, // execution terminated normally breakEncountered, // a break statement was encountered continueEncountered, // a continue statement was encountered returnEncountered // a return statement was encountered }; Value evaluate(const AstNode *node); Outcome execute(const AstNode *node); void updateDictionary(const AstNode *node); public: Interpreter(const char *text, Dataset &d) : tree(buildTree(text)), dataset(d), returnValue() {} ~Interpreter() {} Value execute(); }; #endif