~ubuntu-branches/ubuntu/hardy/ocaml-doc/hardy

« back to all changes in this revision

Viewing changes to examples/grep/fastrec.c

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2007-09-08 01:49:22 UTC
  • mfrom: (0.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070908014922-lvihyehz0ndq7suu
Tags: 3.10-1
* New upstream release.
* Removed camlp4 documentation since it is not up-to-date.
* Updated to standards version 3.7.2, no changes needed.
* Updated my email address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* La version C de la fonction determ__reconnait */
2
 
 
3
 
#include "mlvalues.h"
4
 
 
5
 
value reconnait(automate, chaine)
6
 
        value automate, chaine;
7
 
{
8
 
  value etat_courant, transition;
9
 
  int i, longueur;
10
 
 
11
 
  etat_courant = automate;
12
 
  longueur = string_length(chaine);
13
 
  for (i = 0; i < longueur; i++) {
14
 
    transition = Field(Field(etat_courant, 0), Byte_u(chaine, i));
15
 
    if (Tag_val(transition) == 1) return Val_false;
16
 
    etat_courant = Field(transition, 0);
17
 
  }
18
 
  return Field(etat_courant, 1);
19
 
}