1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 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 ///////////////////////////////////////////////////////////////////////////////
12 // =================================
14 // =================================
16 Rule::Rule(const Rule
& p
)
22 Rule::Rule(Symbols
*p_rhs
)
26 FATAL_ERROR("Rule::Rule()");
34 void Rule::replace_aliases(Grammar
*grammar
)
36 rhs
->replace_aliases(grammar
);
39 // =================================
41 // =================================
43 Rules::Rules(const Rules
& p
)
46 for(size_t i
=0; i
<p
.rs
.size(); i
++)
47 add_r(p
.rs
[i
]->clone());
52 for(size_t i
=0; i
<rs
.size(); i
++)
57 void Rules::add_r(Rule
*p_r
)
60 FATAL_ERROR("NULL parameter: Rules::add_r()");
64 void Rules::steal_rules(Rules
*p_other
)
66 for(size_t i
=0; i
<p_other
->rs
.size(); i
++)
67 rs
.add(p_other
->rs
[i
]);
71 void Rules::replace_aliases(Grammar
*grammar
)
73 for(size_t i
=0; i
<rs
.size(); i
++)
74 rs
[i
]->replace_aliases(grammar
);
77 // =================================
79 // =================================
81 Grouping::Grouping(const Grouping
& p
)
88 Grouping::Grouping(Symbol
*p_lhs
, Rules
*p_rhss
)
89 : lhs(p_lhs
), rhss(p_rhss
)
92 FATAL_ERROR("Grouping::Grouping()");
100 void Grouping::steal_rules(Grouping
*p_other
)
102 rhss
->steal_rules(p_other
->rhss
);
105 void Grouping::replace_aliases(Grammar
*grammar
)
107 lhs
=grammar
->get_alias(lhs
);
108 rhss
->replace_aliases(grammar
);
This page took 0.033216 seconds and 5 git commands to generate.