File: intersection.cc

package info (click to toggle)
bisonc%2B%2B 4.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,412 kB
  • ctags: 2,871
  • sloc: cpp: 9,459; ansic: 1,434; makefile: 1,091; sh: 286; yacc: 84; lex: 60
file content (20 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "lookaheadset.ih"

LookaheadSet LookaheadSet::intersection(LookaheadSet const &other) const
{
    Element const *setResult[max(size(), other.size())];

    LookaheadSet ret(
                    setResult, 
                    set_intersection
                    (
                        begin(), end(), 
                        other.begin(), other.end(),
                        setResult
                    )
                );

    ret.d_EOF = hasEOF() && other.hasEOF() ? e_withEOF : e_withoutEOF;

    return ret;
}