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
12 ******************************************************************************/
17 // =================================
19 // =================================
21 Rule::Rule(const Rule
& p
)
27 Rule::Rule(Symbols
*p_rhs
)
31 FATAL_ERROR("Rule::Rule()");
39 void Rule::replace_aliases(Grammar
*grammar
)
41 rhs
->replace_aliases(grammar
);
44 // =================================
46 // =================================
48 Rules::Rules(const Rules
& p
)
51 for(size_t i
=0; i
<p
.rs
.size(); i
++)
52 add_r(p
.rs
[i
]->clone());
57 for(size_t i
=0; i
<rs
.size(); i
++)
62 void Rules::add_r(Rule
*p_r
)
65 FATAL_ERROR("NULL parameter: Rules::add_r()");
69 void Rules::steal_rules(Rules
*p_other
)
71 for(size_t i
=0; i
<p_other
->rs
.size(); i
++)
72 rs
.add(p_other
->rs
[i
]);
76 void Rules::replace_aliases(Grammar
*grammar
)
78 for(size_t i
=0; i
<rs
.size(); i
++)
79 rs
[i
]->replace_aliases(grammar
);
82 // =================================
84 // =================================
86 Grouping::Grouping(const Grouping
& p
)
93 Grouping::Grouping(Symbol
*p_lhs
, Rules
*p_rhss
)
94 : lhs(p_lhs
), rhss(p_rhss
)
97 FATAL_ERROR("Grouping::Grouping()");
100 Grouping::~Grouping()
105 void Grouping::steal_rules(Grouping
*p_other
)
107 rhss
->steal_rules(p_other
->rhss
);
110 void Grouping::replace_aliases(Grammar
*grammar
)
112 lhs
=grammar
->get_alias(lhs
);
113 rhss
->replace_aliases(grammar
);
This page took 0.036499 seconds and 5 git commands to generate.