Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
c97c8a20
Commit
c97c8a20
authored
May 13, 2013
by
yoogx
Browse files
* Remove mode files
parent
16615ed9
Changes
4
Hide whitespace changes
Inline
Side-by-side
resources/Makefile.am
View file @
c97c8a20
...
...
@@ -34,16 +34,10 @@ AADL_V2_COMPONENTS = $(srcdir)/AADLv2/components/*.aadl \
$(srcdir)
/AADLv2/components/devices/
*
.aadl
\
$(srcdir)
/AADLv2/components/processors/
*
.aadl
MODE_FILES
=
$(srcdir)
/emacs/aadl-mode.el
\
$(srcdir)
/vim/indent/aadl.vim
\
$(srcdir)
/vim/syntax/aadl.vim
EXTRA_DIST
=
$(AADL_COMMON_PROPERTIES)
\
$(AADL_V1_PROPERTIES)
\
$(AADL_V2_PROPERTIES)
\
$(AADL_V2_COMPONENTS)
\
$(MODE_FILES)
$(AADL_V2_COMPONENTS)
install-data-local
:
$(INSTALL)
-d
$(DESTDIR)$(datadir)
/ocarina
...
...
@@ -72,9 +66,6 @@ install-data-local:
echo
"s/OCARINA_INCLUDE_PATH/"
$(
shell
echo
$(DESTDIR)$(includedir)
|
$(SED)
-e
's/\//\\\\\//g'
)
"/g"
>
sedscript
$(SED)
-f
sedscript
$(DESTDIR)$(datadir)
/ocarina/AADLv2/ocarina_components.aadl
>
tmp.aadl
mv
-f
tmp.aadl
$(DESTDIR)$(datadir)
/ocarina/AADLv2/ocarina_components.aadl
for
file
in
$(MODE_FILES)
;
do
\
$(INSTALL_DATA)
$$
file
$(DESTDIR)$(datadir)
/ocarina
||
exit
1
;
\
done
uninstall-local
:
rm
-rf
$(DESTDIR)$(datadir)
/ocarina
resources/emacs/aadl-mode.el
deleted
100644 → 0
View file @
16615ed9
;; aadl-mode
;; Copyright 2004-2006 Ecole nationale superieure des telecommunications
;; Laurent.Pautet@enst.fr, Thomas.Vergnaud@enst.fr, Bechir.Zalila@enst.fr
;; To load this file, just add the following line to your .emacs :
;; (load "/path/to/this/file.el")
(
defvar
aadl-mode-hook
nil
)
; Add support for compilation of AADL files directly from emacs
(
require
'compile
)
(
add-hook
'aadl-mode-hook
(
lambda
()
(
set
(
make-local-variable
'compile-command
)
(
concat
"ocarina -aadlv2 -f -p "
buffer-file-name
))))
(
defvar
aadl-mode-map
(
let
((
aadl-mode-map
(
make-keymap
)))
(
define-key
aadl-mode-map
"\C-j"
'new-line-and-indent
)
(
define-key
aadl-mode-map
"\C-c;"
'comment-region
)
(
define-key
aadl-mode-map
"\C-c:"
'uncomment-region
)
aadl-mode-map
)
"keymap for AADL major mode"
)
; We declare that the aadl mode should be used with .aadl files
(
add-to-list
'auto-mode-alist
'
(
"\\.aadl\\'"
.
aadl-mode
))
; The AADL syntax table
(
defvar
aadl-mode-syntax-table
nil
"syntax table for aadl-mode"
)
(
setq
aadl-mode-syntax-table
(
make-syntax-table
))
(
set-syntax-table
aadl-mode-syntax-table
)
; Modify the syntax table to be conformant with the AADL syntax
; The '_' character may belong to an AADL word
(
modify-syntax-entry
?_
"w"
aadl-mode-syntax-table
)
; The '.' and the ':' characters are word separators
(
modify-syntax-entry
?.
"."
aadl-mode-syntax-table
)
(
modify-syntax-entry
?:
"."
aadl-mode-syntax-table
)
; There is only one comment style in AADL beginning with the "--" string
; and ending with a new line or a new page
(
modify-syntax-entry
?-
". 12"
aadl-mode-syntax-table
)
(
modify-syntax-entry
?\n
">"
aadl-mode-syntax-table
)
(
modify-syntax-entry
?\f
">"
aadl-mode-syntax-table
)
; AADL syntactic coloration. Th order of the elements in the global list
; is important. The first element rules override the second element rules
; which override the third...
(
defconst
aadl-font-lock-keywords
(
list
;; Keywords
(
list
(
concat
"\\<"
(
regexp-opt
'
(
"abstract"
"access"
"and"
"applies"
"binding"
"calls"
"classifier"
"connections"
"constant"
"delta"
"data"
"enumeration"
"event"
"feature"
"features"
"flow"
"flows"
"group"
"in"
"inherit"
"initial"
"inverse"
"is"
"list"
"mode"
"modes"
"not"
"out"
"parameter"
"path"
"port"
"private"
"process"
"processor"
"prototypes"
"properties"
"with"
"renames"
"property"
"provides"
"public"
"range"
"reference"
"refined"
"refines"
"requires"
"server"
"set"
"sink"
"source"
"subcomponents"
"system"
"thread"
"to"
"type"
"units"
"value"
"virtual"
)
t
)
"\\>"
)
'
(
1
font-lock-keyword-face
))
;; Three keywords followed by an identifier or a scoped name
(
list
(
concat
;; 1st kw
(
regexp-opt
'
(
"event"
"port"
"provides"
"requires"
"thread"
)
t
)
"[ \t]+"
;; 2nd kw
(
regexp-opt
'
(
"group"
"data"
)
t
)
"[ \t]+"
;; 3rd kw
(
regexp-opt
'
(
"access"
"implementation"
"port"
)
t
)
"\\>[ \t]*"
"\\(\\sw+\\(\\(\\.\\|::\\)\\sw*\\)*\\)?"
)
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-keyword-face
)
'
(
3
font-lock-keyword-face
)
'
(
4
font-lock-function-name-face
nil
t
))
;; Couple of keywords followed by an identifier or a scoped name
(
list
(
concat
;; 1st kw
(
regexp-opt
'
(
"bus"
"data"
"device"
"end"
"event"
"memory"
"port"
"process"
"processor"
"property"
"thread"
"port"
"subprogram"
"system"
)
t
)
"[ \t]+"
;; 2nd kw
(
regexp-opt
'
(
"group"
"implementation"
"port"
"set"
)
t
)
"\\>[ \t]*"
"\\(\\sw+\\(\\(\\.\\|::\\)\\sw*\\)*\\)?"
)
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-keyword-face
)
'
(
3
font-lock-function-name-face
nil
t
))
;; One single keyword followed by an identifier or a scoped name
(
list
(
concat
"\\<"
(
regexp-opt
'
(
"annex"
"bus"
"data"
"device"
"end"
"extends"
"memory"
"package"
"parameter"
"process"
"processor"
"property"
"port"
"subprogram"
"system"
"thread"
"with"
)
t
)
"\\>[ \t]*"
"\\(\\sw+\\(\\(\\.\\|::\\)\\sw*\\)*\\)?"
)
'
(
1
font-lock-keyword-face
)
'
(
2
font-lock-function-name-face
nil
t
))
;; Identifier followed by a single colon ':'
(
list
(
concat
"^[ \t]*\\<\\("
"\\sw+"
"\\)\\>[ \t]*:[^:]"
)
'
(
1
font-lock-variable-name-face
)
'
(
2
font-lock-text-face
nil
t
))
;; Constants
(
list
(
concat
"\\<"
(
regexp-opt
'
(
"true"
"false"
"none"
"all"
)
t
)
"\\>"
)
'
(
1
font-lock-constant-face
))
;; Types
(
list
(
concat
"\\<"
(
regexp-opt
'
(
"aadlboolean"
"aadlinteger"
"aadlreal"
"aadlstring"
)
t
)
"\\>"
)
'
(
1
font-lock-type-face
))
"AADL Colors"
))
;; specialized indentation functions
(
defun
aadl-indent-end-statement
()
(
forward-line
-1
)
(
cond
((
looking-at
"^[ \t]*end"
)
0
)
((
looking-at
"^[ \t]*\\<\\(package\\|property[ \t]+set\\)\\> +\\sw+"
)
0
)
((
looking-at
"^[ \t]*\\<\\(bus\\|data\\|port\\)\\>[ \t]+\\<\\(access\\|port\\|group\\)\\>"
)
(
aadl-indent-end-statement
))
((
looking-at
"^[ \t]*\\<\\(data\\|thread\\|subprogram\\|process\\|bus\\|processor\\|device\\|memory\\|system\\|port[ \t]+group\\)\\([ \t]+implementation\\)?\\>[ \t]+\\sw+"
)
(
current-indentation
))
((
bobp
)
0
)
(
t
(
aadl-indent-end-statement
))
)
)
(
defun
aadl-indent-component-statement
()
(
forward-line
-1
)
(
cond
((
looking-at
"^[ \t]*end"
)
(
current-indentation
))
((
looking-at
"^[ \t]*\\<\\(private\\|public\\|is\\|package\\|property[ \t]+set\\)\\>"
)
2
)
((
bobp
)
0
)
(
t
(
aadl-indent-component-statement
))
)
)
(
defun
aadl-indent-subclause-statement
()
(
forward-line
-1
)
(
cond
((
bobp
)
10
)
; this should not happen
((
looking-at
"^[ \t]*\\<\\(bus\\|data\\|port\\)\\>[ \t]+\\<\\(access\\|port\\|group\\)\\>"
)
(
aadl-indent-subclause-statement
))
((
looking-at
"^[ \t]*\\<\\(data\\|thread\\|subprogram\\|process\\|bus\\|processor\\|device\\|memory\\|system\\|port +group\\)\\([ \t]+implementation\\)?\\>"
)
(
current-indentation
))
(
t
(
aadl-indent-subclause-statement
))
)
)
(
defun
aadl-indent-statement
()
(
forward-line
-1
)
(
cond
((
bobp
)
0
)
((
looking-at
"^[ \t]*\\<\\(package\\|property[ \t]+set\\)\\>[^;]*$"
)
2
)
((
looking-at
"^[ \t]*\\<\\(public\\|private\\|is\\)\\>[^;]*$"
)
2
)
((
looking-at
"^[ \t]*end"
)
(
current-indentation
))
((
looking-at
"^[ \t]*\\<\\(bus\\|data\\|port\\)\\>[ \t]+\\<\\(access\\|port\\|group\\)\\>"
)
(
aadl-indent-statement
))
((
looking-at
"^[ \t]*\\<\\(data\\|thread\\|subprogram\\|process\\|bus\\|processor\\|device\\|memory\\|port +group\\|features\\|subcomponents\\|properties\\|flows\\|connections\\|modes\\|calls\\)\\>[^;]*$"
)
(
+
(
current-indentation
)
2
))
((
looking-at
"^[ \t]*$"
)
(
aadl-indent-statement
))
(
t
(
current-indentation
))
)
)
;; the main indentation function
(
defun
aadl-indent-line
()
"indent current line"
(
interactive
)
;; save the current point position and declare the indentation value variable
(
let
((
aadl-current-column
(
max
0
(
-
(
current-column
)
(
current-indentation
))))
aadl-indent-value
)
(
beginning-of-line
)
(
setq
aadl-indent-value
(
max
0
(
save-excursion
(
cond
((
bobp
)
0
)
((
looking-at
"^[ \t]*\\<\\(package\\|property +set\\|private\\|public\\|is\\)\\>"
)
0
)
((
looking-at
"^[ \t]*end"
)
(
aadl-indent-end-statement
))
((
looking-at
"^[ \t]*\\<\\(data\\|thread\\|subprogram\\|process\\|bus\\|processor\\|device\\|memory\\|system\\|port +group\\)[ \t]+\\(implementation\\)?\\>"
)
(
aadl-indent-component-statement
))
((
looking-at
"^[ \t]*\\<\\(features\\|modes\\|subcomponents\\|properties\\|flows\\|connections\\|calls\\)\\>"
)
(
aadl-indent-subclause-statement
))
(
t
(
aadl-indent-statement
))
))))
(
indent-line-to
aadl-indent-value
)
;; calculate the new point position
(
setq
aadl-current-column
(
+
aadl-current-column
aadl-indent-value
))
(
move-to-column
aadl-current-column
)))
(
defun
aadl-fill-paragraph
(
ARG
)
(
back-to-indentation
)
(
cond
((
looking-at
comment-start
)
(
re-search-forward
"---*[ \t]*"
)
(
set-fill-prefix
)
(
fill-paragraph
ARG
))
(
t
(
error
"not in comment"
)))
)
(
defun
aadl-mode
()
"Major mode for editing AADL descriptions"
(
interactive
)
(
kill-all-local-variables
)
(
use-local-map
aadl-mode-map
)
;; register the syntax table
(
set-syntax-table
aadl-mode-syntax-table
)
;; register the keywords for syntax highlighting
(
set
(
make-local-variable
'font-lock-defaults
)
'
((
aadl-font-lock-keywords
)
nil
t
))
;; register the indenting function
(
set
(
make-local-variable
'indent-line-function
)
'aadl-indent-line
)
;; a few definitions necessary for aadl-fill-paragraph
(
set
(
make-local-variable
'comment-line-break-function
)
(
lambda
(
&optional
soft
)
(
indent-new-comment-line
)))
(
set
(
make-local-variable
'comment-start
)
"--"
)
(
set
(
make-local-variable
'comment-indent-function
)
'aadl-indent-statement
)
;; Support for ispell : Check only comments
(
set
(
make-local-variable
'ispell-check-comments
)
'exclusive
)
;; Support for indent-new-comment-line (Especially for XEmacs)
(
setq
comment-multi-line
nil
)
(
set
(
make-local-variable
'use-hard-newlines
)
t
)
(
set
(
make-local-variable
'fill-paragraph-function
)
'aadl-fill-paragraph
)
(
setq
major-mode
'aadl-mode
)
(
setq
mode-name
"AADL"
)
(
run-hooks
'aadl-mode-hook
))
(
provide
'aadl-mode
)
resources/vim/indent/aadl.vim
deleted
100644 → 0
View file @
16615ed9
" Vim indent file
" Language: AADL
" Maintainer: Thomas Vergnaud <thomas.vergnaud@aist.enst.fr>
" Last Change: 2007-03-05
if
exists
(
"b:did_indent"
)
finish
endif
let
b:did_indent
=
1
setlocal
indentexpr
=
GetAadlIndent
()
setlocal
indentkeys
-=
0
{,
0
}
setlocal
indentkeys
+=
0
=~
public
,
0
=~
private
,
0
=~
property
,
0
=~
features
,
0
=~
flows
,
0
=~
modes
,
0
=~
subcomponents
,
0
=~
calls
,
0
=~
properties
,
0
=~
connections
,
0
=~
annexes
" Only define the functions once.
if
exists
(
"*GetAadlIndent"
)
finish
endif
let
s:aadlDeclarationStart
=
'^\s*\(data\>\|device\>\|memory\>\|system\>\|process\>\|processor\>\|subprogram\>\|thread group\>\|thread\>\|bus\>\|port group\>\)'
let
s:aadlSubclauseStart
=
'^\s*\(features\>\|subcomponents\>\|modes\>\|calls\>\|flows\>\|annexes\>\|properties\>\|connections\>\)'
let
s:aadlNamespaceStart
=
'^\s*\(property set\>\|package\>\|public\>\|private\>\)'
let
s:aadlComment
=
"\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
" Find the indentation value of block and return it. Return default_indent if
" block is not found. Research is performed backward from line number
" current_lnum
function
s:aadlFindIndent
(
current_lnum
,
block
,
default_indent
)
let
lnum
=
a:current_lnum
-
1
while
lnum
>=
0
let
line
=
getline
(
lnum
)
if
line
=~
a:block
return
indent
(
lnum
)
endif
let
lnum
=
lnum
-
1
endwhile
return
a:default_indent
endfunction
" Return 1 if the line at ref_lnum seems to contain an AADL declaration;
" else return 0
function
s:isDeclaration
(
prev_lnum
)
let
lnum
=
a:prev_lnum
while
lnum
>
0
let
prev_lnum
=
lnum
let
lnum
=
prevnonblank
(
lnum
-
1
)
" Get previous non-blank/non-comment-only line
while
1
let
line
=
substitute
(
getline
(
lnum
),
s:aadlComment
,
''
,
''
)
if
line
!~
'^\s*$'
break
endif
let
lnum
=
prevnonblank
(
lnum
-
1
)
if
lnum
<=
0
" if we did not find any relevant statement, then we are dealing
" with a declaration
return
1
endif
endwhile
" Leave indent alone if our ';' line is part of a ';'-delineated
" aggregate (e.g., procedure args.) or first line after a block start.
if
line
=~
'^\s*end\>'
" if we find a statement 'end', then we are dealing with a
" declaration
return
1
elseif
line
=~
s:aadlDeclarationStart
" if we find a declaration, then we are dealing with a subclause
" statement; probably a connection
return
0
endif
endwhile
endfunction
function
s:getParentIndent
(
prev_lnum
)
let
parenDepth
=
0
let
lnum
=
a:prev_lnum
while
lnum
>
0
let
prev_lnum
=
lnum
let
lnum
=
prevnonblank
(
lnum
-
1
)
" Get previous non-blank/non-comment-only line
while
1
let
line
=
substitute
(
getline
(
lnum
),
s:aadlComment
,
''
,
''
)
if
line
!~
'^\s*$'
break
endif
let
lnum
=
prevnonblank
(
lnum
-
1
)
if
lnum
<=
0
" if we did not find any relevant statement, then we are dealing
" with a declaration
return
1
endif
endwhile
let
line
=
getline
(
lnum
)
if
line
=~
'{'
let
parenDepth
=
parenDepth
+
1
endif
if
line
=~
'}'
let
parenDepth
=
parenDepth
-
1
endif
if
parenDepth
>
0
if
line
=~
'^\s*{'
return
indent
(
lnum
)
-
&
sw
+
1
else
return
indent
(
lnum
)
endif
elseif
line
=~
s:aadlNamespaceStart
return
indent
(
lnum
)
elseif
line
=~
s:aadlDeclarationStart
&&
s:isDeclaration
(
line
)
return
indent
(
lnum
)
elseif
line
=~
s:aadlSubclauseStart
return
indent
(
lnum
)
endif
endwhile
return
0
endfunction
" Main indentation function
function
GetAadlIndent
()
" Check current line; search for simplistic matching start-of-block
let
line
=
getline
(
v
:
lnum
)
let
ind
=
0
;
" Check for potential argument list on next line
let
continuation
=
(
line
=~
'[A-Za-z0-9_]\s*$'
)
if
line
=~
s:aadlNamespaceStart
let
ind
=
0
elseif
line
=~
s:aadlSubclauseStart
let
ind
=
s:aadlFindIndent
(
v
:
lnum
,
s:aadlDeclarationStart
,
0
)
elseif
line
=~
s:aadlDeclarationStart
&&
s:isDeclaration
(
v
:
lnum
)
let
ind
=
s:aadlFindIndent
(
v
:
lnum
,
s:aadlNamespaceStart
,
-
&
sw
)
+
&
sw
elseif
line
=~
'^\s*end\>'
let
lnum
=
v
:
lnum
let
ind
=
0
while
lnum
>
-1
let
line
=
getline
(
lnum
)
if
line
=~
s:aadlDeclarationStart
||
line
=~
s:aadlNamespaceStart
let
ind
=
indent
(
lnum
)
break
endif
let
lnum
=
lnum
-
1
endwhile
elseif
continuation &&
line
=~
'^\s*('
let
ind
=
ind
+
&
sw
else
" Find a non-blank line above the current line.
let
lnum
=
prevnonblank
(
v
:
lnum
-
1
)
let
ind
=
indent
(
lnum
)
" Get previous non-blank/non-comment-only
while
1
let
line
=
substitute
(
getline
(
lnum
),
s:aadlComment
,
''
,
''
)
if
line
!~
'^\s*$'
break
endif
let
lnum
=
prevnonblank
(
lnum
-
1
)
if
lnum
<=
0
return
0
endif
endwhile
" Get default indent (from parent block)
let
ind
=
s:getParentIndent
(
v
:
lnum
)
+
&
sw
endif
endif
return
ind
endfunction
resources/vim/syntax/aadl.vim
deleted
100644 → 0
View file @
16615ed9
" Vim syntax file
" Language: AADL
" Maintainer: Thomas Vergnaud <thomas.vergnaud@aist.enst.fr>
" Last Change: 2007-03-05
if
version
<
600
syntax
clear
elseif
exists
(
"b:current_syntax"
)
finish
endif
" AADL is case-insensitive
syntax
case ignore
syntax
keyword aadlKeyword
is
features subcomponents extends modes properties connections flows annexes calls applies
to
in
out event initial
mode
flow sink
source
annex inherit constant requires provides server
syntax
match
aadlEntity
/\(bus\|virtual\s\+processor\|virtual\s\+bus\|data\s\+access\|data\|device\|memory\|process\|processor\|subprogram\|system\|thread\s\+group\|thread\|port\s\+group\|end\|property\s\+set\|package\|parameter\)\(\s\+implementation\)\=\>/
nextgroup
=
aadlDefinition skipwhite
syntax
match
aadlDefinition
/\(\w\+::\)*\w\+\(\.\w\+\)\=/
contained
syntax
keyword aadlType aadlstring aadlboolean aadlinteger aadlfloat
syntax
keyword aadlStruct enum reference classifier
syntax
keyword aadlOperator
and
or
not
syntax
region aadlString start
=
/"/
skip
=
/\\"/
end
=
/"/
syntax
region aadlBlock matchgroup
=
aadlBrace start
=
/{/
end
=
/}/
transparent
fold
syntax
region aadlAnnex matchgroup
=
aadlAnnexmark start
=
/{\*\*/
end
=
/\*\*}/
transparent
fold
syntax
keyword aadlTodo TODO XXX FixMe contained
syntax
match
aadlComment
/--.*/
contains
=
aadlTodo
if
version
>=
508
||
!
exists
(
"did_aadl_syn_inits"
)
if
version
<
508
let
did_aadl_syn_inits
=
1
command
-
nargs
=+
HiLink
hi
link
<
args
>
else
command
-
nargs
=+
HiLink
hi
def
link
<
args
>
endif
HiLink aadlKeyword Keyword
HiLink aadlEntity Keyword
HiLink aadlComment Comment
HiLink aadlTodo Todo
HiLink aadlString String
HiLink aadlOperator Operator
HiLink aadlStruct Structure
HiLink aadlType Type
HiLink aadlDefinition Type
HiLink aadlBrace Delimiter
HiLink aadlAnnexmark Delimiter
delcommand
HiLink
endif
let
b:current_syntax
=
"aadl"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment