~ubuntu-branches/ubuntu/lucid/structure-synth/lucid

« back to all changes in this revision

Viewing changes to StructureSynth/Parser/EisenParser.h

  • Committer: Bazaar Package Importer
  • Author(s): Miriam Ruiz
  • Date: 2009-04-13 13:28:45 UTC
  • Revision ID: james.westby@ubuntu.com-20090413132845-d7d42t4llxjxq0ez
Tags: upstream-0.9
ImportĀ upstreamĀ versionĀ 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
#include "Tokenizer.h"
 
4
#include "../Model/Transformation.h"
 
5
#include "../Model/Rule.h"
 
6
#include "../Model/CustomRule.h"
 
7
#include "../Model/RuleSet.h"
 
8
#include "../Model/Action.h"
 
9
 
 
10
namespace StructureSynth {
 
11
        namespace Parser {      
 
12
 
 
13
 
 
14
                /// The' Eisenstein Engine' is a simple recursive descent parser,
 
15
                /// for parsing 'EisenScript'.
 
16
                class EisenParser {
 
17
 
 
18
                public:
 
19
                        /// Constructor. 
 
20
                        EisenParser(Tokenizer* tokenizer);
 
21
 
 
22
                        /// Destructor, The tokenizer is not deleted.
 
23
                        ~EisenParser();
 
24
 
 
25
                        /// Parses the input, and returns the corresponding ruleset.
 
26
                        /// Throws a ParseError if any errors are encountered
 
27
                        Model::RuleSet* parseRuleset();
 
28
 
 
29
                private:
 
30
                        void getSymbol();
 
31
                        Model::Rule* rule();
 
32
                        Model::RuleSet* ruleset();
 
33
                        Model::Action action();
 
34
                        Model::Action setAction();
 
35
                        Model::Transformation transformationList();
 
36
                        Model::Transformation transformation();
 
37
                        void ruleModifierList(Model::CustomRule* customRule);
 
38
                
 
39
                        bool accept(Symbol::SymbolType st);
 
40
                        bool expect(Symbol::SymbolType st);
 
41
                        Symbol symbol;
 
42
 
 
43
                        Tokenizer* tokenizer;
 
44
                };
 
45
 
 
46
        }
 
47
}
 
48