More small changes to
[haskell-report.git] / report / syntax-lexical.verb
1 %
2 % $Header: /home/cvs/root/haskell-report/report/syntax-lexical.verb,v 1.10 2003/01/13 13:08:56 simonpj Exp $
3
4
5 @@@
6
7 program         -> \{ lexeme | whitespace \}
8 lexeme          -> qvarid | qconid | qvarsym | qconsym 
9                 | literal | special | reservedop | reservedid
10 literal         -> integer | float | char | string
11 special         -> @(@ | @)@ | @,@ | @;@ | @[@ | @]@ | \bkq | @{@ | @}@
12
13 whitespace      -> whitestuff \{whitestuff\}
14 whitestuff      -> whitechar | comment | ncomment
15 whitechar       -> newline | vertab | space | tab | uniWhite
16 newline         -> return linefeed | return | linefeed | formfeed
17 return          -> \tr{a carriage return}
18 linefeed        -> \tr{a line feed}
19 vertab          -> \tr{a vertical tab}
20 formfeed        -> \tr{a form feed}
21 space           -> \tr{a space}
22 tab             -> \tr{a horizontal tab}
23 uniWhite        -> \tr{any Unicode character defined as whitespace}
24
25 comment         -> dashes [ any_{\langle{}symbol\rangle}  \{any\} ] newline
26 dashes          -> @--@ \{@-@\}
27 opencom         -> @{-@
28 closecom        -> @-}@
29 ncomment        -> opencom ANYseq \{ncomment ANYseq\} closecom
30 ANYseq          -> \{ANY\}_{\langle{}\{ANY\} ( opencom | closecom ) \{ANY\}\rangle{}}
31 ANY             -> graphic | whitechar
32 any             -> graphic | space | tab
33 graphic         -> small | large | symbol | digit | special | @:@ | @"@ | @'@
34
35 small           -> ascSmall | uniSmall | @_@
36 ascSmall      -> @a@ | @b@ | ... | @z@
37 uniSmall        -> \tr{any Unicode lowercase letter}
38
39 large           -> ascLarge | uniLarge
40 ascLarge      -> @A@ | @B@ | ... | @Z@
41 uniLarge        -> \tr{any uppercase or titlecase Unicode letter}
42 symbol          -> ascSymbol | uniSymbol_{\langle{}special | @_@ | @:@ | @"@ | @'@\rangle{}}
43
44 ascSymbol     -> @!@ | @#@ | @$@ | @%@ | @&@ | @*@ | @+@ | @.@ | @/@ | @<@ | @=@ | @>@ | @?@ | @@
45                 |  @\@ | @^@ | @|@ | @-@ | @~@
46 uniSymbol       -> \tr{any Unicode symbol or punctuation}
47 digit          -> ascDigit | uniDigit
48 ascDigit        -> @0@ | @1@ | ... | @9@
49 uniDigit        -> \tr{any Unicode decimal digit}
50 octit   -> @0@ | @1@ | ... | @7@
51 hexit   -> digit | @A@ | ... | @F@ | @a@ | ... | @f@
52
53 @@@
54
55 \indexsyn{program}%
56 \indexsyn{lexeme}%
57 \indexsyn{literal}%
58 \indexsyn{special}%
59 \indexsyn{whitespace}%
60 \indexsyn{whitestuff}%
61 \indexsyn{whitechar}%
62 \indexsyn{uniWhite}%
63 \indexsyn{newline}%
64 \indexsyn{space}%
65 \indexsyn{tab}%
66 \indexsyn{vertab}%
67 \indexsyn{formfeed}%
68 \indexsyn{comment}%
69 \indexsyn{dashes}%
70 \indexsyn{ncomment}%
71 \indexsyn{opencom}%
72 \indexsyn{closecom}%
73 \indexsyn{ANYseq}%
74 \indexsyn{ANY}%
75 \indexsyn{any}%
76 \indexsyn{graphic}%
77 \indexsyn{small}%
78 \indexsyn{ascSmall}%
79 \indexsyn{uniSmall}%
80 \indexsyn{uniDigit}%
81 \indexsyn{large}%
82 \indexsyn{ascLarge}%
83 \indexsyn{uniLarge}%
84 \indexsyn{symbol}%
85 \indexsyn{ascSymbol}%
86 \indexsyn{uniSymbol}%
87 \indexsyn{digit}%
88 \indexsyn{ascDigit}%
89 \indexsyn{uniDigit}%
90 \indexsyn{octit}%
91 \indexsyn{hexit}%