File: add.cc

package info (click to toggle)
flexc%2B%2B 2.17.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,180 kB
  • sloc: cpp: 6,467; makefile: 148; sh: 130; ansic: 18
file content (18 lines) | stat: -rw-r--r-- 567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "rules.ih"

void Rules::add(bool bol, FPattern const &pattern, Block const &block,
                RuleType type) 
{
    size_t ruleIdx = d_rules.size();        // the index of the rule to add

                                            // now add the rule
    d_rules.push_back( { d_states, bol, pattern, block, type } );

    Pair const &pair = d_rules.back().pair();   // the rule's begin/end states

    d_finalToRule[pair.second] = ruleIdx;   // associate end-state to rule

    setRule(pair.first, ruleIdx);

    d_startConditions.add(ruleIdx);
}