summaryrefslogtreecommitdiffstats
path: root/fickle/examples/verbs.fcl
blob: c9317ae0b78c3f0abbdb8616cb4122e7b9b33a16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# $Id: verbs.fcl,v 1.1.1.1 2004/07/23 19:22:41 tang Exp $

# Recognizes various English verbs in sentences.

# This is based upon example 'ch1-02.l' from "lex & yacc" by John
# R. Levine, Tony Mason, and Doug Brown (by O'Reilly & Associates, ISBN
# 1-56592-000-7).  For more information on using lex and yacc, see
# http://www.oreilly.com/catalog/lex/.

%{
#!/usr/bin/tclsh
%}

%%
[\t ]+        # ignore whitespace
is |
am |
are |
were |
was |
be |
being |
been |
do |
does |
did |
will          puts "$yytext: is a verb"
[a-zA-Z]+     puts "$yytext: is not a verb"

.|\n          ECHO  ;# normal default anyway

%%

yylex