Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
9405df9b
Commit
9405df9b
authored
May 05, 2014
by
yoogx
Browse files
* Renamed Namet to Ocarina.Namet, Output to Ocarina.Output to
avoid collision with external packages
parent
f4b3e4ea
Changes
213
Show whitespace changes
Inline
Side-by-side
src/main/ocarina-scripts.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--
Copyright (C) 2013 ESA & ISAE.
--
-- Copyright (C) 2013
-2014
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -32,8 +32,8 @@
------------------------------------------------------------------------------
with
Errors
;
use
Errors
;
with
Namet
;
use
Namet
;
with
Output
;
use
Output
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
use
Ocarina
.
Output
;
with
Types
;
use
Types
;
with
Ada
.
Unchecked_Deallocation
;
...
...
src/main/ocarina_cmd.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2009 Telecom ParisTech, 2010-201
3
ESA & ISAE. --
-- Copyright (C) 2004-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -36,8 +36,8 @@
with
Errors
;
use
Errors
;
with
Locations
;
use
Locations
;
with
Namet
;
use
Namet
;
with
Output
;
use
Output
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
use
Ocarina
.
Output
;
with
Types
;
use
Types
;
with
Utils
;
use
Utils
;
...
...
src/python/ocarina-utils.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--
Copyright (C) 2013 ESA & ISAE.
--
-- Copyright (C) 2013
-2014
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -37,8 +37,8 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
with
Errors
;
use
Errors
;
with
Locations
;
use
Locations
;
with
Namet
;
use
Namet
;
with
Output
;
use
Output
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
use
Ocarina
.
Output
;
with
Types
;
use
Types
;
with
Utils
;
use
Utils
;
...
...
src/transfo/ocarina-transfo-fusions-scheduler.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -35,7 +35,7 @@ with Ocarina.ME_AADL;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
with
Errors
;
with
Namet
;
with
Ocarina
.
Namet
;
with
GNAT
.
Dynamic_Tables
;
with
Ada
.
Text_IO
;
with
Ocarina
.
Transfo
.
Fusions
;
...
...
@@ -45,7 +45,7 @@ package body Ocarina.Transfo.Fusions.Scheduler is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Errors
;
use
Namet
;
use
Ocarina
.
Namet
;
package
ATN
renames
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
package
OTF
renames
Ocarina
.
Transfo
.
Fusions
;
...
...
src/transfo/ocarina-transfo-fusions.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -42,7 +42,7 @@ with Ocarina.ME_AADl.AADL_Instances.Nodes;
with
Ocarina
.
ME_AADl
.
AADL_Instances
.
Nutils
;
with
Ocarina
.
Transfo
.
Fusions
.
Scheduler
;
with
Errors
;
with
Namet
;
with
Ocarina
.
Namet
;
with
GNAT
.
OS_Lib
;
use
GNAT
.
OS_Lib
;
with
GNAT
.
Dynamic_Tables
;
with
Ocarina
.
Builder
.
AADL
.
Components
;
...
...
@@ -75,7 +75,7 @@ package body Ocarina.Transfo.Fusions is
use
Ocarina
.
Backends
.
Messages
;
use
Errors
;
use
Namet
;
use
Ocarina
.
Namet
;
use
Locations
;
package
AIN
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
...
...
src/transfo/ocarina-transfo-move.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -43,7 +43,7 @@ with Ocarina.Builder.AADL.Components.Subcomponents;
with
Ocarina
.
Builder
.
AADL
.
Components
.
Connections
;
with
Ocarina
.
Builder
.
AADL
.
Components
.
Features
;
with
Ocarina
.
Transfo
;
with
Namet
;
with
Ocarina
.
Namet
;
with
Locations
;
package
body
Ocarina
.
Transfo
.
Move
is
...
...
@@ -52,7 +52,7 @@ package body Ocarina.Transfo.Move is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Debug
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Namet
;
use
Ocarina
.
Namet
;
use
Locations
;
package
AIN
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
...
...
src/transfo/ocarina-transfo-optim-eval.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -35,13 +35,13 @@ with Ocarina.ME_REAL.REAL_Tree.Nutils;
with
Ocarina
.
REAL_Values
;
with
Ocarina
.
Backends
.
REAL
;
with
Ocarina
.
Analyzer
.
REAL
;
with
Output
;
with
Namet
;
with
Ocarina
.
Output
;
with
Ocarina
.
Namet
;
package
body
Ocarina
.
Transfo
.
Optim
.
Eval
is
use
Ocarina
.
REAL_Values
;
use
Namet
;
use
Output
;
use
Ocarina
.
Namet
;
use
Ocarina
.
Output
;
package
BR
renames
Ocarina
.
Backends
.
REAL
;
...
...
src/transfo/ocarina-transfo-optim.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -50,7 +50,7 @@ with Ocarina.Backends;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Debug
;
use
Ocarina
.
ME_AADL
.
AADL_Instances
.
Debug
;
with
Namet
;
use
Namet
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
package
body
Ocarina
.
Transfo
.
Optim
is
use
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
...
...
src/transfo/ocarina-transfo.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -38,7 +38,7 @@ with Ocarina.ME_AADL.AADL_Tree.Debug;
with
Ocarina
.
ME_AADl
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Entities
;
with
Utils
;
with
Namet
;
with
Ocarina
.
Namet
;
package
body
Ocarina
.
Transfo
is
use
Ocarina
.
ME_AADL
;
...
...
@@ -46,7 +46,7 @@ package body Ocarina.Transfo is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Debug
;
use
Utils
;
use
Namet
;
use
Ocarina
.
Namet
;
package
AIN
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
package
ATN
renames
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
...
...
tests/python/test_ocarina.py
View file @
9405df9b
...
...
@@ -14,9 +14,14 @@ def main ():
instantiate
(
"rma.erc32"
);
# instantiate
generate
(
Backends
.
polyorb_hi_ada
);
reset
();
load
(
"rma.aadl"
);
# load a file
load
(
"deployment.aadl"
);
# load a file
analyze
();
# analyze models
instantiate
(
"rma.erc32"
);
# instantiate
generate
(
Backends
.
polyorb_hi_ada
);
if
__name__
==
"__main__"
:
main
()
sys
.
exit
(
0
);
# exit
################################################################################
tools/mknodes/lexer.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -33,8 +33,8 @@
with
Charset
;
with
Errors
;
with
Namet
;
with
Output
;
with
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
use
Ocarina
.
Output
;
with
Types
;
use
type
Types
.
Text_Buffer_Ptr
,
Types
.
Text_Ptr
;
use
type
Types
.
Int
,
Types
.
Byte
;
...
...
@@ -56,7 +56,7 @@ package body Lexer is
function
Image
(
T
:
Token_Type
)
return
String
is
begin
return
Namet
.
Get_Name_String
(
Token_Image
(
T
));
return
Ocarina
.
Namet
.
Get_Name_String
(
Token_Image
(
T
));
end
Image
;
---------------
...
...
@@ -117,16 +117,16 @@ package body Lexer is
(
Token
:
Token_Type
;
Image
:
String
)
is
begin
Namet
.
Set_Str_To_Name_Buffer
(
Image
);
Token_Image
(
Token
)
:=
Namet
.
Name_Find
;
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
Image
);
Token_Image
(
Token
)
:=
Ocarina
.
Namet
.
Name_Find
;
if
Token
in
Keyword_Type
then
for
I
in
Natural
range
1
..
Namet
.
Name_Len
loop
Namet
.
Name_Buffer
(
I
)
:=
Charset
.
To_Lower
(
Namet
.
Name_Buffer
(
I
));
for
I
in
Natural
range
1
..
Ocarina
.
Namet
.
Name_Len
loop
Ocarina
.
Namet
.
Name_Buffer
(
I
)
:=
Charset
.
To_Lower
(
Ocarina
.
Namet
.
Name_Buffer
(
I
));
end
loop
;
Namet
.
Set_Name_Table_Byte
(
Namet
.
Name_Find
,
Types
.
Byte
(
Token_Type
'
Pos
(
Token
)));
Ocarina
.
Namet
.
Set_Name_Table_Byte
(
Ocarina
.
Namet
.
Name_Find
,
Types
.
Byte
(
Token_Type
'
Pos
(
Token
)));
end
if
;
end
New_Token
;
...
...
@@ -210,13 +210,13 @@ package body Lexer is
function
Quoted_Image
(
T
:
Token_Type
)
return
String
is
begin
if
T
in
T_Interface
..
T_Octet
then
Namet
.
Set_Char_To_Name_Buffer
(
'"'
);
Namet
.
Add_Str_To_Name_Buffer
(
Namet
.
Get_Name_String
(
Token_Image
(
T
)));
Namet
.
Add_Char_To_Name_Buffer
(
'"'
);
return
Namet
.
Get_Name_String
(
Namet
.
Name_Find
);
Ocarina
.
Namet
.
Set_Char_To_Name_Buffer
(
'"'
);
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Ocarina
.
Namet
.
Get_Name_String
(
Token_Image
(
T
)));
Ocarina
.
Namet
.
Add_Char_To_Name_Buffer
(
'"'
);
return
Ocarina
.
Namet
.
Get_Name_String
(
Ocarina
.
Namet
.
Name_Find
);
end
if
;
return
Namet
.
Get_Name_String
(
Token_Image
(
T
));
return
Ocarina
.
Namet
.
Get_Name_String
(
Token_Image
(
T
));
end
Quoted_Image
;
-------------------
...
...
@@ -254,23 +254,23 @@ package body Lexer is
-- Read identifier
Namet
.
Name_Len
:=
0
;
Ocarina
.
Namet
.
Name_Len
:=
0
;
while
Charset
.
Is_Identifier_Character
(
Buffer
(
Token_Location
.
Scan
))
loop
Namet
.
Name_Len
:=
Namet
.
Name_Len
+
1
;
Namet
.
Name_Buffer
(
Namet
.
Name_Len
)
:=
Buffer
(
Token_Location
.
Scan
);
Ocarina
.
Namet
.
Name_Len
:=
Ocarina
.
Namet
.
Name_Len
+
1
;
Ocarina
.
Namet
.
Name_Buffer
(
Ocarina
.
Namet
.
Name_Len
)
:=
Buffer
(
Token_Location
.
Scan
);
Token_Location
.
Scan
:=
Token_Location
.
Scan
+
1
;
end
loop
;
if
Namet
.
Name_Len
=
0
then
if
Ocarina
.
Namet
.
Name_Len
=
0
then
if
Fatal
then
Errors
.
Error_Loc
(
1
)
:=
Token_Location
;
Errors
.
DE
(
"identifier must start with alphabetic character"
);
end
if
;
Namet
.
Name_Buffer
(
1
)
:=
' '
;
Namet
.
Name_Len
:=
1
;
Ocarina
.
Namet
.
Name_Buffer
(
1
)
:=
' '
;
Ocarina
.
Namet
.
Name_Len
:=
1
;
else
Token_Name
:=
Namet
.
Name_Find
;
Token_Name
:=
Ocarina
.
Namet
.
Name_Find
;
Token
:=
T_Identifier
;
-- Check whether it is a keyword or a pragma
...
...
@@ -285,7 +285,7 @@ package body Lexer is
-- Check that identifier is well-formed
if
Token
=
T_Identifier
then
if
not
Charset
.
Is_Alphabetic_Character
(
Namet
.
Name_Buffer
(
1
))
then
if
not
Charset
.
Is_Alphabetic_Character
(
Ocarina
.
Namet
.
Name_Buffer
(
1
))
then
if
Escaped
then
if
Fatal
then
Errors
.
Error_Loc
(
1
)
:=
Token_Location
;
...
...
@@ -349,19 +349,19 @@ package body Lexer is
end
loop
;
if
not
Found
then
Namet
.
Set_Str_To_Name_Buffer
(
"expected token"
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
"expected token"
);
if
L
'
Length
>
1
then
Namet
.
Add_Char_To_Name_Buffer
(
's'
);
Ocarina
.
Namet
.
Add_Char_To_Name_Buffer
(
's'
);
end
if
;
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Namet
.
Add_Str_To_Name_Buffer
(
Quoted_Image
(
L
(
L
'
First
)));
Ocarina
.
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Quoted_Image
(
L
(
L
'
First
)));
for
Index
in
Natural
range
L
'
First
+
1
..
L
'
Last
loop
Namet
.
Add_Str_To_Name_Buffer
(
" or "
);
Namet
.
Add_Str_To_Name_Buffer
(
Quoted_Image
(
L
(
Index
)));
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
" or "
);
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Quoted_Image
(
L
(
Index
)));
end
loop
;
Errors
.
Error_Loc
(
1
)
:=
Token_Location
;
Errors
.
DE
(
Namet
.
Get_Name_String
(
Namet
.
Name_Find
));
Errors
.
DE
(
Ocarina
.
Namet
.
Get_Name_String
(
Ocarina
.
Namet
.
Name_Find
));
Token
:=
T_Error
;
end
if
;
...
...
@@ -578,11 +578,12 @@ package body Lexer is
function
To_Token
(
Name
:
Types
.
Name_Id
)
return
Token_Type
is
B
:
Types
.
Byte
;
begin
Namet
.
Get_Name_String
(
Name
);
for
I
in
Natural
range
1
..
Namet
.
Name_Len
loop
Namet
.
Name_Buffer
(
I
)
:=
Charset
.
To_Lower
(
Namet
.
Name_Buffer
(
I
));
Ocarina
.
Namet
.
Get_Name_String
(
Name
);
for
I
in
Natural
range
1
..
Ocarina
.
Namet
.
Name_Len
loop
Ocarina
.
Namet
.
Name_Buffer
(
I
)
:=
Charset
.
To_Lower
(
Ocarina
.
Namet
.
Name_Buffer
(
I
));
end
loop
;
B
:=
Namet
.
Get_Name_Table_Byte
(
Namet
.
Name_Find
);
B
:=
Ocarina
.
Namet
.
Get_Name_Table_Byte
(
Ocarina
.
Namet
.
Name_Find
);
if
B
<=
Last_Token_Pos
then
return
Token_Type
'
Val
(
B
);
end
if
;
...
...
@@ -595,7 +596,7 @@ package body Lexer is
procedure
Write
(
T
:
Token_Type
)
is
begin
Output
.
Write_Str
(
Image
(
T
));
Write_Str
(
Image
(
T
));
end
Write
;
end
Lexer
;
tools/mknodes/mknodes.gpr
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- P r o j e c t --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -32,9 +32,10 @@
------------------------------------------------------------------------------
with
"ocarina"
;
with
"ocarina-main"
;
project
Mknodes
is
for
Source_Dirs
use
(
"."
,
"../../src/core/common_files"
);
for
Object_Dir
use
Ocarina
.
Top_Build_Dir
&
"/../tools/mknodes/objects"
;
for
Exec_Dir
use
Ocarina
.
Top_Build_Dir
&
"/../tools/mknodes"
;
for
Main
use
(
"mknodes"
);
...
...
tools/mknodes/parser.adb
View file @
9405df9b
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -36,8 +36,9 @@ with GNAT.OS_Lib; use type GNAT.OS_Lib.File_Descriptor;
with
Errors
;
with
Lexer
;
use
type
Lexer
.
Token_Type
;
with
Namet
;
with
Output
;
with
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
use
Ocarina
.
Output
;
with
Types
;
use
type
Types
.
Byte
,
Types
.
Name_Id
,
Types
.
Node_Id
,
Types
.
Int
;
package
body
Parser
is
...
...
@@ -110,12 +111,12 @@ package body Parser is
is
Str_Len
:
constant
Natural
:=
Str
'
Length
;
begin
Namet
.
Get_Name_String
(
Name
);
Ocarina
.
Namet
.
Get_Name_String
(
Name
);
for
I
in
Natural
range
0
..
Str_Len
-
1
loop
Namet
.
Name_Buffer
(
Namet
.
Name_Len
-
Str_Len
+
I
+
1
)
Ocarina
.
Namet
.
Name_Buffer
(
Ocarina
.
Namet
.
Name_Len
-
Str_Len
+
I
+
1
)
:=
Str
(
Str
'
First
+
I
);
end
loop
;
return
Namet
.
Get_Name_String
(
Namet
.
Name_Find
);
return
Ocarina
.
Namet
.
Get_Name_String
(
Ocarina
.
Namet
.
Name_Find
);
end
Copy_Str_At_End_Of_Name
;
------------------
...
...
@@ -296,10 +297,11 @@ package body Parser is
function
Resolve_Type
(
N
:
Types
.
Name_Id
)
return
Types
.
Node_Id
is
Result
:
Types
.
Node_Id
;
begin
Namet
.
Set_Str_To_Name_Buffer
(
Type_Prefix
);
Namet
.
Get_Name_String_And_Append
(
N
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
Type_Prefix
);
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
N
);
Result
:=
Types
.
Node_Id
(
Namet
.
Get_Name_Table_Info
(
Namet
.
Name_Find
));
Result
:=
Types
.
Node_Id
(
Ocarina
.
Namet
.
Get_Name_Table_Info
(
Ocarina
.
Namet
.
Name_Find
));
if
Result
=
Types
.
No_Node
or
else
Kind
(
Result
)
=
K_Attribute
then
return
Types
.
No_Node
;
...
...
@@ -314,7 +316,7 @@ package body Parser is
function
GNS
(
N
:
Types
.
Name_Id
)
return
String
is
begin
return
Namet
.
Get_Name_String
(
N
);
return
Ocarina
.
Namet
.
Get_Name_String
(
N
);
end
GNS
;
-------------------
...
...
@@ -341,11 +343,11 @@ package body Parser is
Y
:=
A
;
end
if
;
Namet
.
Set_Str_To_Name_Buffer
(
Attr_Prefix
);
Namet
.
Get_Name_String_And_Append
(
Identifier
(
X
));
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Namet
.
Get_Name_String_And_Append
(
Identifier
(
Y
));
Namet
.
Set_Name_Table_Byte
(
Namet
.
Name_Find
,
1
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
Attr_Prefix
);
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
Identifier
(
X
));
Ocarina
.
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
Identifier
(
Y
));
Ocarina
.
Namet
.
Set_Name_Table_Byte
(
Ocarina
.
Namet
.
Name_Find
,
1
);
end
Mark_As_Adjacent
;
-----------
...
...
@@ -354,7 +356,7 @@ package body Parser is
function
Color
(
N
:
Types
.
Node_Id
)
return
Color_Type
is
begin
return
Color_Type
(
Namet
.
Get_Name_Table_Info
(
Identifier
(
N
)));
return
Color_Type
(
Ocarina
.
Namet
.
Get_Name_Table_Info
(
Identifier
(
N
)));
end
Color
;
-----------------------
...
...
@@ -404,30 +406,32 @@ package body Parser is
procedure
Declare_Type
(
N
:
Types
.
Node_Id
)
is
begin
Namet
.
Set_Str_To_Name_Buffer
(
Type_Prefix
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
Type_Prefix
);
case
Kind
(
N
)
is
when
K_Boolean
=>
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Boolean
));
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Boolean
));
when
K_Octet
=>
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Octet
));
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Octet
));
when
K_Long
=>
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Long
));
Ocarina
.
Namet
.
Add_Str_To_Name_Buffer
(
Lexer
.
Image
(
Lexer
.
T_Long
));
when
others
=>
Namet
.
Get_Name_String_And_Append
(
Identifier
(
N
));
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
Identifier
(
N
));
end
case
;
Namet
.
Set_Name_Table_Info
(
Namet
.
Name_Find
,
Types
.
Int
(
N
));
Ocarina
.
Namet
.
Set_Name_Table_Info
(
Ocarina
.
Namet
.
Name_Find
,
Types
.
Int
(
N
));
case
Kind
(
N
)
is
when
K_Boolean
=>
Namet
.
Set_Str_To_Name_Buffer
(
"Boolean"
);
Set_Identifier
(
N
,
Namet
.
Name_Find
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
"Boolean"
);
Set_Identifier
(
N
,
Ocarina
.
Namet
.
Name_Find
);
when
K_Octet
=>
Namet
.
Set_Str_To_Name_Buffer
(
"Byte"
);
Set_Identifier
(
N
,
Namet
.
Name_Find
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
"Byte"
);
Set_Identifier
(
N
,
Ocarina
.
Namet
.
Name_Find
);
when
K_Long
=>
Namet
.
Set_Str_To_Name_Buffer
(
"Int"
);
Set_Identifier
(
N
,
Namet
.
Name_Find
);
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
"Int"
);
Set_Identifier
(
N
,
Ocarina
.
Namet
.
Name_Find
);
when
others
=>
null
;
end
case
;
...
...
@@ -439,7 +443,7 @@ package body Parser is
function
Generated
(
N
:
Types
.
Node_Id
)
return
Boolean
is
begin
return
Namet
.
Get_Name_Table_Byte
(
Identifier
(
N
))
=
1
;
return
Ocarina
.
Namet
.
Get_Name_Table_Byte
(
Identifier
(
N
))
=
1
;
end
Generated
;
----------------------
...
...
@@ -793,7 +797,7 @@ package body Parser is
procedure
Set_Color
(
N
:
Types
.
Node_Id
;
V
:
Color_Type
)
is
begin
Namet
.
Set_Name_Table_Info
(
Identifier
(
N
),
Types
.
Int
(
V
));
Ocarina
.
Namet
.
Set_Name_Table_Info
(
Identifier
(
N
),
Types
.
Int
(
V
));
end
Set_Color
;
-------------------
...
...
@@ -803,9 +807,9 @@ package body Parser is
procedure
Set_Generated
(
N
:
Types
.
Node_Id
;
B
:
Boolean
)
is
begin
if
B
then
Namet
.
Set_Name_Table_Byte
(
Identifier
(
N
),
Types
.
Byte
(
1
));
Ocarina
.
Namet
.
Set_Name_Table_Byte
(
Identifier
(
N
),
Types
.
Byte
(
1
));
else
Namet
.
Set_Name_Table_Byte
(
Identifier
(
N
),
Types
.
Byte
(
0
));
Ocarina
.
Namet
.
Set_Name_Table_Byte
(
Identifier
(
N
),
Types
.
Byte
(
0
));
end
if
;
end
Set_Generated
;
...
...
@@ -815,16 +819,16 @@ package body Parser is
procedure
Usage
is
begin
Output
.
Set_Standard_Error
;
Output
.
Write_Line
(
"Usage: "
);
Output
.
Write_Line
(
" mknodes [options] filename"
);
Output
.
Write_Eol
;
Output
.
Write_Line
(
" General purpose options:"
);
Output
.
Write_Line
(
" -D ARG Generate files in given directory"
);
Output
.
Write_Line
(
" -d Output debugging info"
);
Output
.
Write_Line
(
" -O Exclude code to dump tree"
);
Output
.
Write_Line
(
" -p Output files on stdout"
);
Output
.
Write_Eol
;
Set_Standard_Error
;
Write_Line
(
"Usage: "
);
Write_Line
(
" mknodes [options] filename"
);
Write_Eol
;
Write_Line
(
" General purpose options:"
);
Write_Line
(
" -D ARG Generate files in given directory"
);
Write_Line
(
" -d Output debugging info"
);
Write_Line
(
" -O Exclude code to dump tree"
);
Write_Line
(
" -p Output files on stdout"
);
Write_Eol
;
end
Usage
;
------------------
...
...
@@ -840,12 +844,12 @@ package body Parser is
Y
:=
A
;
end
if
;
Namet
.
Set_Str_To_Name_Buffer
(
Attr_Prefix
);
Namet
.
Get_Name_String_And_Append
(
Identifier
(
X
));
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Namet
.
Get_Name_String_And_Append
(
Identifier
(
Y
));
Ocarina
.
Namet
.
Set_Str_To_Name_Buffer
(
Attr_Prefix
);
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
Identifier
(
X
));
Ocarina
.
Namet
.
Add_Char_To_Name_Buffer
(
' '
);
Ocarina
.
Namet
.
Get_Name_String_And_Append
(
Identifier
(
Y
));