7
|
1 " Vim syntax file
|
|
2 " Language: SNNS pattern file
|
|
3 " Maintainer: Davide Alberani <alberanid@bigfoot.com>
|
|
4 " Last Change: 28 Apr 2001
|
|
5 " Version: 0.2
|
|
6 " URL: http://digilander.iol.it/alberanid/vim/syntax/snnspat.vim
|
|
7 "
|
|
8 " SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/
|
|
9 " is a simulator for neural networks.
|
|
10
|
|
11 if version < 600
|
|
12 syntax clear
|
|
13 elseif exists("b:current_syntax")
|
|
14 finish
|
|
15 endif
|
|
16
|
|
17
|
|
18 " anything that isn't part of the header, a comment or a number
|
|
19 " is wrong
|
|
20 syn match snnspatError ".*"
|
|
21 " hoping that matches any kind of notation...
|
|
22 syn match snnspatAccepted "\([-+]\=\(\d\+\.\|\.\)\=\d\+\([Ee][-+]\=\d\+\)\=\)"
|
|
23 syn match snnspatAccepted "\s"
|
|
24 syn match snnspatBrac "\[\s*\d\+\(\s\|\d\)*\]" contains=snnspatNumbers
|
|
25
|
|
26 " the accepted fields in the header
|
|
27 syn match snnspatNoHeader "No\. of patterns\s*:\s*" contained
|
|
28 syn match snnspatNoHeader "No\. of input units\s*:\s*" contained
|
|
29 syn match snnspatNoHeader "No\. of output units\s*:\s*" contained
|
|
30 syn match snnspatNoHeader "No\. of variable input dimensions\s*:\s*" contained
|
|
31 syn match snnspatNoHeader "No\. of variable output dimensions\s*:\s*" contained
|
|
32 syn match snnspatNoHeader "Maximum input dimensions\s*:\s*" contained
|
|
33 syn match snnspatNoHeader "Maximum output dimensions\s*:\s*" contained
|
|
34 syn match snnspatGen "generated at.*" contained contains=snnspatNumbers
|
|
35 syn match snnspatGen "SNNS pattern definition file [Vv]\d\.\d" contained contains=snnspatNumbers
|
|
36
|
|
37 " the header, what is not an accepted field, is an error
|
|
38 syn region snnspatHeader start="^SNNS" end="^\s*[-+\.]\=[0-9#]"me=e-2 contains=snnspatNoHeader,snnspatNumbers,snnspatGen,snnspatBrac
|
|
39
|
|
40 " numbers inside the header
|
|
41 syn match snnspatNumbers "\d" contained
|
|
42 syn match snnspatComment "#.*$" contains=snnspatTodo
|
|
43 syn keyword snnspatTodo TODO XXX FIXME contained
|
|
44
|
|
45 if version >= 508 || !exists("did_snnspat_syn_inits")
|
|
46 if version < 508
|
|
47 let did_snnspat_syn_inits = 1
|
|
48 command -nargs=+ HiLink hi link <args>
|
|
49 else
|
|
50 command -nargs=+ HiLink hi def link <args>
|
|
51 endif
|
|
52
|
|
53 HiLink snnspatGen Statement
|
|
54 HiLink snnspatHeader Error
|
|
55 HiLink snnspatNoHeader Define
|
|
56 HiLink snnspatNumbers Number
|
|
57 HiLink snnspatComment Comment
|
|
58 HiLink snnspatError Error
|
|
59 HiLink snnspatTodo Todo
|
|
60 HiLink snnspatAccepted NONE
|
|
61 HiLink snnspatBrac NONE
|
|
62
|
|
63 delcommand HiLink
|
|
64 endif
|
|
65
|
|
66 let b:current_syntax = "snnspat"
|
|
67
|
|
68 " vim: ts=8 sw=2
|