Ignore:
Timestamp:
Aug 20, 2014, 10:58:28 PM (5 years ago)
Author:
ksherdy
Message:

Updates to grep s2k.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/input/test/s2k/proto/grep/grep_flow.s2k

    r4049 r4065  
    11/*
    2  * grep exact-string search C++ in \s2k{}.
     2 * grep exact-string search C++ in: \s2k{}.
    33 *
    44 * Description:
     
    1414 * Stage 6 - Write`
    1515 *
    16  * Trailing tildes characters `~' indicate pipeline stages written in \s2k{}.
     16 * Trailing tildes characters `~' indicate pipeline stages written in: \s2k{}.
    1717 * Trailing back ticks `'', indicate stages defined within the
    1818 * \s2k{} C++ templates file, 'grep.template'.
     
    2424 * 2. Stream functions ClassifyBytes, Match, and MatchLines.
    2525 * ClassifyBytes defines \s2k{} equations for each of the character
    26  * classes encountered in the fixed string `apple' and line feeds.
    27  * In this example, the generation of character class bit stream
     26 * classes encountered in: the fixed string `apple' and line feeds.
     27 * in: this example, the generation of character class bit stream
    2828 * equations is automated using the character class compiler tool.
    2929 * Match defines \s2k{} equations to match the fixed string `apple'
     
    103103}
    104104
    105 filter ClassifyBytes(in struct Basis_bits basis_bits, out struct Lex lex) {
     105filter ClassifyBytes(in: struct Basis_bits basis_bits, out: struct Lex lex) {
    106106  stream temp1 = (basis_bits.bit_1 & (~ basis_bits.bit_0));
    107107  stream temp2 = (basis_bits.bit_2 & (~ basis_bits.bit_3));
     
    131131}
    132132
    133 filter Match(in struct Lex lex, out struct Output output) {
     133filter Match(in: struct Lex lex, out: struct Output output) {
    134134  stream cursor = flow.Advance(lex.a);
    135135  cursor = flow.Advance((cursor & lex.p));
     
    140140}
    141141
    142 filter MatchLines(in struct Lex lex, out struct Output output) {
     142filter MatchLines(in: struct Lex lex, out: struct Output output) {
    143143  stream all_line_starts = (flow.ScanToFirst((~ lex.LF)) | (flow.Advance(lex.LF) & (~ lex.LF)));
    144144  stream all_line_ends = lex.LF;
     
    158158  output.line_ends = flow.ScanTo(output.line_starts, (output.lines & all_line_ends));
    159159}
    160 filter Read(out struct Output output) {
     160filter Read(out: struct Output output) {
    161161  //io.bind<char>(buffer, s76543210, 1024);
    162162  //io.bind<BitBlock>(starts, output.starts, 1024/BITBLOCK_SIZE);
     
    168168
    169169// post-processing
    170 filter Write(out struct Output output) {
     170filter Write(out: struct Output output) {
    171171  //io.write<BitBlock>(output.line_starts);
    172172  //io.write<BitBlock>(output.line_ends);
Note: See TracChangeset for help on using the changeset viewer.