File: grammar

package info (click to toggle)
filtermail 1.06.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,688 kB
  • sloc: cpp: 2,487; fortran: 249; makefile: 106; ansic: 51; sh: 36
file content (57 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//%default-actions quiet

%filenames parser
%scanner ../scanner/scanner.h
%token-path ../tokens/tokens.h

//%print-tokens

%baseclass-preinclude  ../enums/enums.h

//    lowest precedence on top
%token
    IF
    ACTION
    DATE
    FILE
    HDR
    LETTER
    NOT
    NR
    REGEX
%left
    AND

%stype eTruth
    
%%

grammar:
    grammar ifStmnt
|
    // no rules ok: by default accept all input
;

%include "inc/opt"
%include "inc/expression"
%include "inc/rules"
%include "inc/condition"

if:
    IF
    {
                                // members set d_expect and call the
        startIf();              // equally named Filter member
    }
;

ifStmnt:
    if condition ACTION
    {
        action();               // uses d_scanner.matched()
    }
|
    error ACTION
|
    '\n'
;