Changeset 4065 for proto


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

Updates to grep s2k.

Location:
proto/s2k/trunk/framework/input/test/s2k/proto/grep
Files:
3 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);
  • proto/s2k/trunk/framework/input/test/s2k/proto/grep/s2k_grep_test.bash

    r4058 r4065  
    11#!/bin/bash
    22#
    3 SRC_DIR=/home/ksherdy/Development/proto/s2k/trunk/demo/grep/src
     3SRC_DIR=/home/ken/Development/proto/s2k/trunk/demo/grep/src
    44cd ${SRC_DIR}
    55make clean
  • proto/s2k/trunk/framework/input/test/s2k/proto/grep/s2k_header_grep.s2k

    r4059 r4065  
    11/*
    2  * grep exact-string search C++ in \s2k{}.
     2 * grep exact-string search C++ in: s2k.
    33 *
    44 *
    5  * The \s2k{} grep exact-string search demo is organized into the following
     5 * The s2k grep exact-string search demo is organized into the following
    66 * pipeline stages.
    77 * 
     
    1313 * Stage 6 - Write
    1414 *
    15  * The \s2k{} program defines the following program elements.
     15 * The s2k program defines the following program elements.
    1616 *
    1717 * 1. Stream structures.
     
    7171};
    7272
    73 filter Read(out struct Input input) {
    74   //io.bind<char>(buffer, input.data, s2k::SEGMENT_SIZE);
    75   //io.bind<BitBlock>(starts, output.starts, s2k::SEGMENT_SIZE);
    76   //io.bind<BitBlock>(ends, output.ends, s2k::SEGMENT_SIZE);
    77   //io.bind<BitBlock>(markers, output.markers, s2k::SEGMENT_SIZE);
     73filter Read(out: struct Input input) {
     74  //io.bind<8>(buffer, input.data, s2k::SEGMENT_SIZE);
     75  //io.bind<1>(starts, output.starts, s2k::SEGMENT_SIZE);
     76  //io.bind<1>(ends, output.ends, s2k::SEGMENT_SIZE);
     77  //io.bind<1>(markers, output.markers, s2k::SEGMENT_SIZE);
    7878
    79   //io.read_buffer<char>(input.data);
     79  //io.read<8>(input.data);
    8080}
    8181
    82 //filter Transpose(in struct Input input, out struct Basis_bits basis_bits) {
     82//filter Transpose(in: struct Input input, out: struct Basis_bits basis_bits) {
    8383//
    8484//}
    8585
    8686/* ClassifyBytes defines s2k equations for each of the character
    87  * classes encountered in the fixed string `apple' and line feeds.
    88  * In this example, the generation of character class bit stream
     87 * classes encountered in: the fixed string `apple' and line feeds.
     88 * in: this example, the generation of character class bit stream
    8989 * equations is automated using the character class compiler tool.
    9090 */
    91 filter ClassifyBytes(in struct Basis_bits basis_bits, out struct Lex lex) {
     91filter ClassifyBytes(in: struct Basis_bits basis_bits, out: struct Lex lex) {
    9292  stream<1> temp1 = (basis_bits.bit_1 & (~ basis_bits.bit_0));
    9393  stream<1> temp2 = (basis_bits.bit_2 & (~ basis_bits.bit_3));
     
    117117}
    118118
    119 filter Match(in struct Lex lex, out struct Output output) {
     119filter Match(in: struct Lex lex, out: struct Output output) {
    120120  stream<1> cursor = flow.Advance(lex.a);
    121121  cursor = flow.Advance((cursor & lex.p));
     
    126126}
    127127
    128 filter MatchLines(in struct Lex lex, out struct Output output) {
     128filter MatchLines(in: struct Lex lex, out: struct Output output) {
    129129  stream<1> all_line_starts = (flow.ScanToFirst((~ lex.LF))
    130130                            | (flow.Advance(lex.LF) & (~ lex.LF)));
     
    148148}
    149149
    150 filter Write(in struct Output output) {
    151   //io.write<BitBlock>(output.line_starts);
    152   //io.write<BitBlock>(output.line_ends);
    153   //io.write<BitBlock>(output.match_follows);
     150filter Write(in: struct Output output) {
     151  //io.write<1>(output.line_starts);
     152  //io.write<1>(output.line_ends);
     153  //io.write<1>(output.match_follows);
    154154}
    155155
Note: See TracChangeset for help on using the changeset viewer.