ada

Does anyone know of an Ada plugin for protocol buffers?

时光怂恿深爱的人放手 提交于 2019-12-05 18:58:52
I'm looking for an Ada plugin for protocol buffers. Looks like there is just about any language plugin available or in the works except for Ada. Well, the only thing I found is this thesis . Unfortunately, I did not find any source code for a translation tool, i.e. what you name a plugin . The only thing I can tell is that the tool was developed in C++. UPDATE There's finally an Ada implementation for Protocol Buffers. It has been developed by Per Sandberg and is available on GitHub . I didn't check if this is a full Ada implementation or if it relies on C/C++ version as a thin binding Please

Loading Ada shared objects in Perl with DynaLoader.pm

 ̄綄美尐妖づ 提交于 2019-12-05 15:55:31
问题 Long time listener, first time caller. I'm aware this is a somewhat obscure question, and don't expect too much. :-) I have the following Ada files: greeter.ads package Greeter is procedure Hello; end Greeter; greeter.adb with Ada.Text_IO; use Ada.Text_IO; package body Greeter is procedure Hello is begin Put_Line ("Hello, world!"); end Hello; end Greeter; And compile them into a shared object like this: gnatmake -z -fPIC greeter.adb gcc -shared -o libgreeter.so greeter.o This compiles fine.

How do I compile and link using gnatmake with an Ada shared library?

狂风中的少年 提交于 2019-12-05 15:18:49
I am having trouble compile an applicant again the Florist library. Turns out I have a larger issue with florist (same error results from both newest 2010 Adacore GPL download and 2009 version in Debian's archive). Florist has some low-level issues but when I look through the generated files it seems to be including errno.h correctly. Here is what happens when I build florist: gcc-4.4 -c -I/usr/share/ada/adainclude/florist demo.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr/share/ada/adainclude/florist/posix.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr

In/Out vs Out in Ada

白昼怎懂夜的黑 提交于 2019-12-05 10:50:56
I have a quick Ada question. If I have a procedure where I may write out to a variable, or I might leave it alone, should it be an Out parameter or an In Out parameter? I guess this boils down to the question: What does the caller see if it calls a procedure with a parameter as Out but the procedure doesn't touch the parameter. Does it see the same value? Undefined behavior? The compiler doesn't complain because it sees an assignment to the Out variable...it just happens to be in a conditional, where it may not be reached, and the compiler doesn't bother to check all paths. I suspect the safe

Best practice for implementing in Ada (2005 or 2012) an equivalent of the java finalize block

北战南征 提交于 2019-12-05 08:01:20
Java has the finalize block which allows to execute some statements after a block is left (executed even if an exception is raised). Example: try { ... } catch (Exception e) { ... } finally { ... // any code here } Ada has the controlled objects which allows to implement a Finalize operation but there is no finalize block equivalent as in java. This is useful for logging, closing files, transactions and so on (without having to create a specific tagged type for each possible block). How would you implement such finalize block in Ada 2005 (while keeping the code readable)? Are there plans in

Use Ada code in Android

半城伤御伤魂 提交于 2019-12-05 06:17:29
Is there any possibility to use old Ada code in Android? I have an old script written in Ada and it would be great if I could just use that code in Android directly (via NDK or JNI etc). Is this possible? Or should I rather port the code? Here are some links I found but I don't really understand in what extend they answer my question: http://en.wikibooks.org/wiki/Ada_Programming/Platform/VM/Java http://code.google.com/p/javada/ http://code.google.com/p/jgnat/ http://en.wikipedia.org/wiki/GNAT Added: http://groups.google.com/group/comp.lang.ada/browse_thread/thread/4cb1f8d1c17d39a8?pli=1 I

Get Ada (compiled with GNAT) to import files from outside current directory?

六月ゝ 毕业季﹏ 提交于 2019-12-05 02:35:11
I'm doing an intro to programming course at university, and the language of choice is Ada. I'm coding in Kate and compiling with GNAT 4.6.3. We have to use teacher-provided libraries for our programs, like so: with foo; use foo; Of course, then the file foo.adb has to be contained in the same directory as my source file. Since multiple projects depend on this one library, and I like to keep each project in its own subdirectory, I have to copy the library files into each new project. Not to mention have my library code and source code all in the same directory. So is there any way to sort of go

How can you check if an element belongs to one subtype or another?

喜你入骨 提交于 2019-12-05 02:08:53
I just learnt about Enums and Types in Ada and decided to write a small program to practice: with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Day is type Day_Of_The_Week is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Weekday is Day_Of_The_Week range Monday..Friday; subtype Weekend is Day_Of_The_Week range Saturday..Sunday; function is_Weekday ( dayOfTheWeek: in Day_Of_The_Week) return Boolean is begin if(--?--) end is_Weekday; selected_day_value : Integer; selected_day : Day_Of_The_Week; begin Put_Line("Enter the

Why has Ada no garbage collector?

◇◆丶佛笑我妖孽 提交于 2019-12-05 00:34:09
I know GC wasn't popular in the days when Ada was developed and for the main use case of embedded programming it is still not a good choice. But considering that Ada is a general purpose programming language why wasn't a partial and optional (traces only explicitly tagged memory objects) garbage collector introduced in later revisions of the language and the compiler implementations. I simply can't think of developing a normal desktop application without a garbage collector anymore. Ada was designed with military applications in mind. One of the big priorities in its design was determinism. i

Modern Ada to C/C++ translator [closed]

此生再无相见时 提交于 2019-12-04 11:42:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Is there any source-to-source converter (translator) from Ada (95, 2005) to C? How full they are (can they convert every feature of Ada into gnu c99 + pthreads + POSIX)? Is it possible to use such ada-to-c translator in critical applications? PS: Translators to C++ (up to 2003 with gnu extensions) are welcome