Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

treeparser.h

Go to the documentation of this file.
00001 #ifndef _TREEPARSER_H_
00002 #define _TREEPARSER_H_
00003 
00004 #include "stree.h"
00005 #include "rtree.h"
00006 #include "rulesystem.h"
00007 
00008 enum ParseType {ParseRules, ParsePHP, ParseNormalizers };
00009 
00011 class XParser{
00012  protected:
00013   void* parse(const string &fileName, ParseType iparseRules, RuleSystem *ifactor, bool iyydebug);
00014 };
00016 class RuleParser : public XParser{
00017  public:
00018   NamedRuleList* parse(const string &fileName, 
00019                        RuleSystem *factor,
00020                        bool iyydebug = 0) { 
00021     return (NamedRuleList*)(XParser::parse(fileName,ParseRules,factor,iyydebug)); 
00022   };
00023 };
00025 class PHPParser : public XParser{
00026  public:
00027   StatementList* parse(const string &fileName, bool iyydebug = 0) { 
00028     return (StatementList*)(XParser::parse(fileName,ParsePHP,NULL,iyydebug)); 
00029   };
00030 };
00031 
00032 static RuleParser* ruleParser = new RuleParser();
00033 static PHPParser* phpParser = new PHPParser();
00034 
00035 #endif

Generated on Fri Nov 21 17:54:04 2003 for PHPX by doxygen 1.3.3