~ubuntu-branches/ubuntu/karmic/asis/karmic

« back to all changes in this revision

Viewing changes to tutorial/using_asistant/README

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Quinot
  • Date: 2002-03-03 19:55:58 UTC
  • Revision ID: james.westby@ubuntu.com-20020303195558-g7dp4vaq1zdkf814
Tags: upstream-3.14p
ImportĀ upstreamĀ versionĀ 3.14p

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
For doing this part of the ASIS tutorial, you should have the
 
2
executable of the asistant tool built, and this execitanle should be
 
3
on your path. asistant is built as a part of the standard ASIS
 
4
installation procedure. (If you do not have asistant built, refer to
 
5
the ASIS-for-GNAT Installation Guide - the top-level README file -
 
6
how to built it yourself).
 
7
 
 
8
It would be nice if you would have read the asistant users' guide
 
9
before doing the exercises in this part of the tutorial, but this is
 
10
not really necessary. You can easily guess the meaning of the
 
11
constructions of the asistant command language (more then a half of
 
12
this language are ASIS queries), and the asistant scripts making up
 
13
this tutorial contain enough comments to explain what happens. See
 
14
also the quick asistant guide in the end of this readme file.
 
15
 
 
16
You should do the following preparation to run these exercises:
 
17
- copy the whole content of this directory in your woprking
 
18
  directory;
 
19
  - create the tree files for the Ada source files. The Ada sources
 
20
  included into this tutorial made up a simple Ada program having the
 
21
  procedure Ex_Proc as its main subprogram, so you can create the
 
22
  tree files by the following command:
 
23
 
 
24
  >gnatmake -c -gnatc -gnatt ex_proc.adb
 
25
 
 
26
Now call asistant with the name of a script file as a parameter. A
 
27
script file is a text file containg the sequence of the asistant
 
28
commands.
 
29
 
 
30
  This tutorial contains two scripts:
 
31
 
 
32
  black_box.scr - contains tasks for performing some black-box
 
33
                  processing of ASIS Compilation Units;
 
34
 
 
35
  white_box.scr - contains tasks for performing some Element-level
 
36
                  (white-box) processing of ASIS Compilation Units;
 
37
 
 
38
Both scripts first demonstrate the effect of some ASIS queries and
 
39
then formulate the task to solve. The scripts contain both the hints
 
40
to find the solution and the version of the correct solution.
 
41
 
 
42
So, to start doing this part of exercises, you should type in the
 
43
command prompt:
 
44
 
 
45
> asistant black_box.scr
 
46
 
 
47
or
 
48
 
 
49
> asistant white_box.scr
 
50
 
 
51
and follow the information the script processing will output into the
 
52
command line window. The general scheme of all the exercises is: when
 
53
a script file is executed, it first performs some sequence of ASIS
 
54
queries, then it outputs the text of a task for you to do and
 
55
switches asistant into interactive mode. When resumed, it outputs the
 
56
solution for the task.
 
57
 
 
58
                     Quick asistant guide
 
59
                     ====================
 
60
 
 
61
asistant is an interactive ASIS interpreter which allows to "execute"
 
62
ASIS queries without writing the full ASIS application. asistant may
 
63
also interprete a sequence of commands written in a file (called a
 
64
script file), the input from the command line and from a script file
 
65
may be combined.
 
66
 
 
67
asistant allows to define and initialize dynamic variables of basic
 
68
ASIS types (Context, Compilation_Unit, Element) and some conventional
 
69
types (integer, string, boolean). The asistant command 'set'
 
70
 
 
71
    > set (var, <some_expression>)
 
72
 
 
73
defines an asistant variable 'var' and sets its type and initial
 
74
value from the type and initial value of '<some_expression>'. The
 
75
'set' command with a single parameter is used to define variables of
 
76
the ASIS Context type.
 
77
 
 
78
The asistant command 'print' outputs values of asistant variables and
 
79
expressions.
 
80
 
 
81
The asistant command 'pause', when used in a script file, paused the
 
82
interpretation of the command from the script file. When the script
 
83
is paused, asistant is switched into the interactive mode and a user
 
84
can input commands from the command prompt.
 
85
 
 
86
To resume the script, input the "run" command.
 
87
 
 
88
To quit asistant, type the 'quit' command.
 
89
 
 
90
If you make any error when working in the asistant environment,
 
91
asistant does not change any variable, it just generates an error
 
92
message and allows you to try again.
 
93
 
 
94
asistant keeps its input in the file input.log, and it keeps the
 
95
track of the session in the file session.log.
 
96
 
 
97
Go ahead and enjoy!
 
 
b'\\ No newline at end of file'