7
|
1 " Vim syntax file
|
|
2 " Language: SNNS pattern file
|
|
3 " Maintainer: Davide Alberani <alberanid@bigfoot.com>
|
3312
|
4 " Last Change: 2012 Feb 03 by Thilo Six
|
7
|
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
|
3312
|
17 let s:cpo_save = &cpo
|
|
18 set cpo&vim
|
7
|
19
|
|
20 " anything that isn't part of the header, a comment or a number
|
|
21 " is wrong
|
|
22 syn match snnspatError ".*"
|
|
23 " hoping that matches any kind of notation...
|
|
24 syn match snnspatAccepted "\([-+]\=\(\d\+\.\|\.\)\=\d\+\([Ee][-+]\=\d\+\)\=\)"
|
|
25 syn match snnspatAccepted "\s"
|
|
26 syn match snnspatBrac "\[\s*\d\+\(\s\|\d\)*\]" contains=snnspatNumbers
|
|
27
|
|
28 " the accepted fields in the header
|
|
29 syn match snnspatNoHeader "No\. of patterns\s*:\s*" contained
|
|
30 syn match snnspatNoHeader "No\. of input units\s*:\s*" contained
|
|
31 syn match snnspatNoHeader "No\. of output units\s*:\s*" contained
|
|
32 syn match snnspatNoHeader "No\. of variable input dimensions\s*:\s*" contained
|
|
33 syn match snnspatNoHeader "No\. of variable output dimensions\s*:\s*" contained
|
|
34 syn match snnspatNoHeader "Maximum input dimensions\s*:\s*" contained
|
|
35 syn match snnspatNoHeader "Maximum output dimensions\s*:\s*" contained
|
|
36 syn match snnspatGen "generated at.*" contained contains=snnspatNumbers
|
|
37 syn match snnspatGen "SNNS pattern definition file [Vv]\d\.\d" contained contains=snnspatNumbers
|
|
38
|
|
39 " the header, what is not an accepted field, is an error
|
|
40 syn region snnspatHeader start="^SNNS" end="^\s*[-+\.]\=[0-9#]"me=e-2 contains=snnspatNoHeader,snnspatNumbers,snnspatGen,snnspatBrac
|
|
41
|
|
42 " numbers inside the header
|
|
43 syn match snnspatNumbers "\d" contained
|
|
44 syn match snnspatComment "#.*$" contains=snnspatTodo
|
|
45 syn keyword snnspatTodo TODO XXX FIXME contained
|
|
46
|
|
47 if version >= 508 || !exists("did_snnspat_syn_inits")
|
|
48 if version < 508
|
|
49 let did_snnspat_syn_inits = 1
|
|
50 command -nargs=+ HiLink hi link <args>
|
|
51 else
|
|
52 command -nargs=+ HiLink hi def link <args>
|
|
53 endif
|
|
54
|
|
55 HiLink snnspatGen Statement
|
|
56 HiLink snnspatHeader Error
|
|
57 HiLink snnspatNoHeader Define
|
|
58 HiLink snnspatNumbers Number
|
|
59 HiLink snnspatComment Comment
|
|
60 HiLink snnspatError Error
|
|
61 HiLink snnspatTodo Todo
|
|
62 HiLink snnspatAccepted NONE
|
|
63 HiLink snnspatBrac NONE
|
|
64
|
|
65 delcommand HiLink
|
|
66 endif
|
|
67
|
|
68 let b:current_syntax = "snnspat"
|
|
69
|
3312
|
70 let &cpo = s:cpo_save
|
|
71 unlet s:cpo_save
|
7
|
72 " vim: ts=8 sw=2
|