Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Balasko, Jeno | |
10 | * Forstner, Matyas | |
11 | * | |
12 | ******************************************************************************/ | |
970ed795 EL |
13 | #ifndef _langviz_Iterator_HH |
14 | #define _langviz_Iterator_HH | |
15 | ||
16 | class Grammar; | |
17 | class Grouping; | |
18 | class Rule; | |
19 | class Symbol; | |
20 | ||
21 | class Iterator { | |
22 | protected: | |
23 | Grammar *grammar; | |
24 | Grouping *grouping; | |
25 | Symbol *lhs; | |
26 | Rule *rule; | |
27 | Symbol *symbol; | |
28 | ||
29 | public: | |
30 | virtual ~Iterator() {} | |
31 | virtual void visitGrammar(Grammar *p_grammar); | |
32 | virtual void visitGrouping(Grouping *p_grouping); | |
33 | virtual void visitRule(Rule *p_rule); | |
34 | virtual void visitSymbol(Symbol *p_symbol); | |
35 | virtual void actionGrammar() {} | |
36 | virtual void actionGrouping() {} | |
37 | virtual void actionRule() {} | |
38 | virtual void actionSymbol() {} | |
39 | }; | |
40 | ||
41 | /** | |
42 | * Used to build the references/referenced by structure of symbols | |
43 | */ | |
44 | class ItRefBuild : public Iterator { | |
45 | virtual void actionSymbol(); | |
46 | }; | |
47 | ||
48 | #endif // _langviz_Iterator_HH |