Sei sulla pagina 1di 45

,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --













Arabic Programming
Languages









Sami Sarhan
University of Jordan




,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


Abstract
A survey about Non-English programming
languages with concentration on Arabic programming
Language is conducted. In this paper we propose a
simple Arabic programming language which is
dedicated for educational purposes. The language is
characterized by simplicity and needs no previous
experience of programming. The syntax directed
translation scheme is used to develop a translator for the
proposed language.
Keywords:
Non-English programming languages, Arabic
programming language, Syntax directed translation,
Abstract stack machine, Context free grammar,
Simulation.
1. Introduction
Computer Programming Languages are symbolic
systems that computers understand. They help your
program serve your needs. Compilers are programs that
help to make this understanding happen. While the
first generation of high-level programming languages,
such as FORTRAN is still in wide use and evolving,
many new languages with higher level abstraction
capability are emerging.
As the programming languages are the most
important interface between computers and scientists,
programming language designs are still a very active
pursuit in the computer science community as languages
are born, age, and eventually die. Programming
language designs and implementation methods have
evolved continuously since the earliest high-level
languages appeared in the 1950s.



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


When the USA Department of Defense did a survey
as part of its background efforts in developing ADA in
the 1970s, it found that over 500 languages were being
used on various defense projects. Programming
languages can be classified into numerically based
languages, Business languages, Artificial Intelligence
languages, and Systems languages.
Development of a programming language does not
proceed in a vacuum. The hardware that supports a
language has a great impact on language design. The
external environment supporting the execution of a
program is termed its operating environment. In
addition to other factors such as the networking
environment, the development status at a particular
phase, and the intended audience[7].

Another significant issue to be thought about is
what are the requirements for building our own
programming language? Many factors have to be taken
into consideration such as the human resources that are
needed to get such a huge project well done, financial
capabilities that will supply the project, and which
operating system to rely on. Unix Operating System is
an open source operating environment; it can support
new programming languages with more free capabilities
[43].
The solution language .=' which stands for (
'' ,-'= ') is a programming language with Arabic
syntax. It is designed for Arab people, especially for
beginners, because of the lack of such languages. The
main goal of this language is to provide a programming
language, which syntax is in Arabic language. This


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


language is dedicated for beginners and requires no
previous experience of programming.

The proposed language can be considered as the
basis of a more powerful language. Many problems can
be solved using this language such as simple
mathematical and scientific problems. It provides also
the capability to build simple software packages.

2. Previous Work
Hundreds of different programming languages have
been designed and implemented. Even in 1969, Sammet
[27,25] listed 120 that were fairly widely used, and
many others have been developed since then. Most
programmers, however, never venture to use more than
a few languages. The appropriate language to use often
depends on the application domain for the problem to be
solved. The appropriate language to use for various
application domains has evolved over the past 30 years.

Initially, languages were designed to execute
programs efficiently. By the middle of 1960s, the task of
a high-level language was to make it easier to develop
correct programs and solve problems for some given
application area. Compiler technology matured in the
1960s, and 1970s, and language technology centered on
solving domain-specific problems. Just like natural
languages, programming languages evolve an
eventually pass out of use. The older languages still in
use have undergone periodic revisions to reflect
changing influences from other areas of computing.
Newer languages like C++, Java, and ML reflect a
composite of experience gained in the design and use of


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


these and the hundreds of other older languages. Some
of these influences are: computer capabilities,
applications, programming methods, implementation
methods, theoretical studies and standardization. Many
reasons explain why programmers prefer one language
over another. Some of them are: clarity and simplicity,
orthogonality, naturalness for application, support for
abstraction, ease of program verification, programming
environment, portability of programs, and cost of use.

Usually programming languages use English alphabet.
Very few of them were developed using other alphabets.
Inter-p is a programming language in Spanish [26].
Another programming language for Spanish speakers is
called Mayor [27]. It has a 16-bit version (1.12) and a
32-bit version (2.01) and it can help you get great
programming skills.
In the context of computing with Indian languages,
people have often asked Can you not allow computer
programs to be in Indian language? Supposedly the
idea is to allow the development of applications in
Indian languages. Nearly a decade ago, it was reported
that Sanskrit is the most appropriate language for
writing computer software. Systems development
laboratory, IIT Madras which has contributed to
significant development in Multilingual computing (and
hence a meaningful IT solution for India), did think of
applications which one could write in regional language,
along the lines of programming with an interpreted
language such as Basic. In fact, as far back as 1989, an
equivalent of Basic was shown to be viable Tamil and
Telugu. Subsequent to the development of a system for
efficient string processing with Indian language text, the


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


lab had proposed the idea of scripting with Indian
languages rather than a programming language itself.

Perl, is a remarkably good choice for writing
applications which would interpret scripts written in
Indian languages. Very little is required by way of
enhancements to standard Perl which handles regular
expressions with great ease and simplicity. The
enhancement is a simple module which can present IIf
characters as equivalent ASCII strings. Such a module
has been developed in the lab and is known as IIperl.
The idea behind this approach is to permit Perl
programs to be written using the IITM editor where text
strings in Indian languages could be present

A special Indian language based command shell has
been used under Linux. This shell allows interaction
with the user in different languages and can display text
in all the scripts. Using the command shell, one can
invoke other Iperl programs such as a sorting program
or email client and retain on the screen a totally regional
language based interaction [39,40].

A lot of research in developing programming languages
was done in Germany. MIKRONIA is a German
programming language [28]. Mikronia- mikro- compiler
(version q13) can convert programs written in Mikronia
language into equivalent Turbo-Pascal (7.0). A German
version of the LOGO programming language was
developed [29]. Also there is a French version of the
LOGO programming language [30]. Some languages
were developed using Russian language such as Actor
Prolog [31], Euphoria programming language [32], and
Javascripts.ru [33,41].


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



The shortage of Information Processing Engineer is
sever in Japan and the importance of teaching
programming as a part of information processing is
increasing. But because of the technical advance of
programming language, it is hard to study existing
programming languages. So Chubachi Yoshihide and
Ohiwa Hajime have developed an Object oriented
Japanese programming language on Java Virtual
Machine [33]. It has high educational effect and also has
a capability to develop any practical software. It has a
structure that can use Java library, and that can cover
from educating beginner to a full-scale software
development.

There is a lot of research associated with Arabic
language. This research includes many aspects of
Arabic work in computer field starting with Arabic fonts
and reaching syntax and semantic analyzers. It includes
the work related to the language understanding, based
on artificial intelligence techniques such as:
morphology, syntax, semantic, character recognition,
speech synthesis/recognition, and translation. Other
work related to the user interface either for hardware or
software applications [11-24, 34-35, 44].

Some research was focused on Arabic
programming languages [36-38]. But still there is no
well-established Arabic programming languages that
can satisfy the requirements of the new computer
applications - the following section will illustrate some
of them -. So in this paper we are trying to propose a
simple programming language using Arabic alphabet
and Arabic syntax.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



3. Existing Arabic Programming Languages

There are some Arabic programming languages. Al-
Khawarizmi is the first Arabic programming language
that is developed by Al-Sakher Company before ten
years. This language is similar to Pascal language.
ArLogo which stands for Arabic logo, it is a translation
for logo language which is designed for children to learn
the logic of programming by letting them draw and
write simple commands in an interesting interface. This
language is only a translation, so it can not be used for
writing computer programs so this is a limitation on it is
use [46, 55]. Jeem is another well known Arabic
programming tool that gives the basic features of high
level programming language as C. Jeem consists of
Arabic alphabet and digits ( - , - ). The main
advantages of it are its simplicity, clarity, obey the
Arabic grammar, and its helpfulness for the student to
write programs in their native language [47]. Al-Risalh
is an Arabic pure object-oriented programming
language that has the basic mechanisms of object-
orientation: objects, classes, and messages. This
language has also the full support of object-orientation
concepts, it supports application programming as well
as systems programming which is similar to smalltalk.
[44] WinoScript which is built on the accidental using
of Arabic variables in Java Script. It is the first Arabic
web programming language (scripting languages). It is
like the java script. [48-51] Perso Perso-Arabic
languages like Urdu, Persian, Sindhi, and Kashmiri [54].

For more details about the mentioned Arabic
programming languages see Appendix A.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


4. The proposed language.
In this section, the characteristics, the syntax, and tools
of the proposed language are discussed.

4.1 Characteristics of the proposed language.
The aim is to develop an interactive Arabic
programming language dedicated for education
purposes and provides the capability to build simple
software packages using multimedia and windows
environment. The language is characterized by
simplicity and does not need a previous experience of
programming so it can be used for beginners. The
language should be portable and compatible with other
systems.
The syntax of the language must be clear and well
understood. Such syntax when properly used will allow
the program structure to reflect the underlying logical
structure of the algorithm. For example the proposed
language should support special commands (primitives)
which are essential for mathematical applications like
addition, subtraction, multiplication, division, square
root, power, log, etc. The language must support an easy
way for input and output, for example dialog boxes can
be provided for input and output. Also the language
should include special commands that support
graphics.

Two approaches can be used to achieve the aim
mentioned above. The first is to develop a programming
language starting from scratch. This approach requires
the developing of editing and translation tools and
providing the appropriate environment. The editor must
provide the ability to write programs and to debug them
easily.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



The second approach requires to develop an Arabic
programming shell for a programming language like
Visual Basic or C++. The components of such a
programming shell is shown in figure 1.


Figure 1 : The structure of a programming shell

The debugger is used to control the notations used in the
program and to invocate the prewritten functions from
the functions database. The intermediate translator
converts the source program into another programming
language like C++ and prepares it for linking and
execution. The programming shell includes arithmetic
and logic operations, control-flow operations, and the
rules for writing functions and procedures.
In this paper only a subset of the proposed language is
introduced.
4.2 Syntax of the language
The general structure of the program is as the
following (any thing written in braces is optional):
} ,--


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


,-' : ,-- ,-- ....................
,--
} '-=
'-= ...........
,'+- .

The following rules govern the syntax of the proposed
language:
Each statement must end with semicolon (), unless it is
the end of the program, where a dot ( . ) should be used.
Or the statement which precedes the false part of the
conditional statement ( ` ), where a space should be
used.
There are two types of identifiers: integer ( _,=-) and
real ( -,-=). The following rules should be considered in
choosing the name of an identifier:
Must begin with a letter and followed by letters or
digits.
The length of the identifier name must not exceed 30
characters.
The identifier name must not be a reserved word.
There are two forms of constant numbers (integer and
real ) which are used directly in the program, and literal
strings which may include any characters (except the
quotation mark itself) between two quotation marks.
The operators used in expressions are:
Relational operators (==, > ,< , =< , => ,<> ).
Logical operators and ( ) , or ( ) .
Mathematical operators (*, /, +, -, mod ( ,- )).
The negative sign operator ( -''- ) which must be
included with its expression between parenthesis e.g. (
-''- ) .
Operator precedence:
Parenthesis.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


* , / , mod ( ,- ), and ( ) .
+ , - ,or ( ) .
== , <> ,=> , =< , > , < .
Assignment ( = ) .
4.3 Statements.
The proposed language includes a set of statements.
Some of them are:
Assignment statement which has the following syntax:
Identifier expression
Simple conditional statement which has the following
syntax:
) expression (compoundstmt
Where compoundstmt is a single statement or
zero or more statements between begin ( ,-- ) and
end ( ,'+- ) .

Complex conditional statement which has the following
syntax:
) expression(compoundstmt ` compoundstmt
- While statement which has the following syntax
'-''= ) expression (compoundstmt
For statement which has the following syntax:
-identifier - lower bound _' upper bound
compoundstmt
Print statement which has the following syntax:
_-= ") Text " identifier expression =- (........
Where line (=- ) means new line .
Read statement which has the following syntax:
) identifier1identifier2 (...................
Clear statement which has the following Syntax:
_--
it is used to clear the screen.
Comment line which has the following syntax: # Text
#


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


A comment can be written anywhere in the
program, and can be written on one or more lines.
4.4 Reserved words.
The proposed language uses a set of reserved words
like:
` -''- ,- ,-- -,-= _,=- ,--
,'+- _-- =- _-= _' - - '-''= .
5. Implementation.
The introduced subset of the proposed language was
implemented using the syntax directed translation
scheme. C programming language was used to
accomplish the implementation [1-6].
5.1 Translation phases.
The architectural diagram of the Translation phases of
the proposed language is shown in figure 2 [8-10].
The syntax directed translation scheme used her
consists of the following phases:
Lexical analyzer: reads the source program (stream of
characters) from right to left and groups them into
tokens (sequences of characters having collective
meaning).
Syntax analyzer: groups recognized tokens
hierarchically into nested collections with collective
meaning.
Intermediate code generator: generates a code for an
abstract stack machine.
Simulator: in the simulation part, the machine has
separate instructions and data memories and all
operations are performed on values on a stack.
Expressions are converted into postfix notations before
the instructions are evaluated to generate the result.
Symbol table : it is used to record the keywords initially
and the identifiers (while the program is scanned) used
in the source program. The information about various


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


attributes of each identifier such type, value are also
recorded in the symbol table.
Error handler : detects errors and reporting them with
allowing further detection of errors in the source
program with some errors recovered when detected.




Figure 2: Translation phases.

4.2 Illustration example.

The following example shows the translation process of
a statement.
Assume the following statement:


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



_,-' ---' --' *
Figure 3 shows the translation steps of the given
statement.



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



4.3 Functions.
The functions were developed during the
implementation using C language. The main functions
are listed below:
int isarabic(int c):
Tests whether an input symbol belongs to Arabic
alphabet or not.
int isarabicnumeric(int c):
Tests whether an input symbol belongs to Arabic
alphabet and digits or not.
int lexan():
Recognizes tokens and eliminates white spaces and
comments and reports any errors if any.
void parse():
Obtains a string of tokens from the lexan and verifies
that the string can be generated by the grammar of the
language and reports any errors if any.
void program():
Verifies the general form of the program.
void declarations():
Verifies the general format of declaration.
void decl():
Verifies the format of declaration for one type.
void identifierlist():
Decides whether one or more identifiers declared for
one type. If there are many identifiers, they must be
separated by commas.
void type():
Decides the type (real or integer).
void compoundstmt():
Decides whether there is a set of statements or empty
can be replaced, by empty.
void statmentlist():


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


Decides whether there is one or more statements which
can be replaced. Each statement must be followed by
semicolon ().
void optionalstmt():
Verifies the form of the block. Where the block is one
statement or compoundstmt between begin and end.
void stmt():
Implements the statements of the proposed language:
1) Assignment statement.
2) If statement with or without else.
3) While statement.
4) For loop statement.
5) Input statement.
6) Output statement.
7) Clear screen statement.
void outputstmt():
Verifies the format of the arguments of the output
statement that should be produced.
void output():
Describes the output that should be produced:
It may be an expression or text or a new line.
void input():
Decides whether one or more identifiers should be
entered.
void factor():
Represents identifier or number or expression between
parenthesis.
void term():
Implements multiplicative operations (*, /, mod, and)
within a term and a factor or recognizes a factor.
void simpleexpression():
Implements additive operations (+, -, or) within a simple
expression and a term.
void exp():


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


Implements the relational operations (==,<>,<,>,<=,>=)
between two simple expressions.
void match(int t):
Advances to the next input token if its argument t
matches the lookahead symbol. Thus match changes the
value of the lookahead variable.
void emit(int t,int tval):
Inserts the intermediate code into an array of records
int lookup(char s[]):
Returns the index of an entry for string s, or 0 if s is not
found.
int insert(char s[],int tok,double tokval,char type):
Returns the index of a new entry for string s, token t.
void init():
Preloads symtable with keywords.
void write_error(char *m):
Prints the message of the error.
void error(int errorno):
Chooses the type of the error.
int newlabel():
Returns a fresh label when ever it is called.
void addinst(int ins,double val,char typ):
Inserts the instruction, its value and type in the
instruction table of the intermediate code.
int lookupins(int ins,double val):
Returns the value of the label for instruction ins in the
instruction table.
void simulation():
Uses the stack data structure to simulate the
intermediate code into output (results) using postfix
notation.
int insertlit(char s[]):
Inserts a literal string into text table.



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


5. Test examples.

Here we introduce a set of examples that illustrates
how the developed compiler works correctly and
properly.
Example 1. In this example the introduced program
contains many features of the solution language. The
program reads an integer number. and finds the
summation from 1 up to that number. It also decides
whether the number is odd or even. This process is
repeated while the range of the numbers is (5 <= range
<= 10), otherwise the number causes getting out from
the loop. Then the program reads a real number and
decides whether it is negative or positive, and prints it.
Finally the program prints a triangle of stars (*).

Source file of example 1.

# '' -'-= =- '-,-- .--, '`- _-'--' - #
,--
_,=- : ,-=-'
_,=- :
-,-= : -,-=
- ,-
_--
_-= ") `+- ` " =-
=- =- (
_-= " ) ,- _,=- -= .= - ,-=-' '-=' ='-'
' ( "
_-= ) =- (
_-= ") - ='' =' ,= = -,-=-
-' _-'- " =- (
_-= ) =- " ' .= ( " :
) (


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


'-''= )) ( ) ~ ((
,--
_' - - ) (
,--
,-=-' ,-=-'
_-= ) ( " "
,'+-
_-= ) " " ) ,-=-' ((
)) ,- ( (
_-= ) =- " = ' " =- (
`
_-= ) =- " ' " =- (
_-= ) =- " ' .= ( " :
) (
,-=-' .
,'+-
_-= ) =- " -,-= .= ( " :
) -,-= (
)) -,-= -''- ( ~ (
_-= ) =- " ' , -=,- " : -,-= (
`
_-= ) =- " , -''- ' " : -,-= (
_-= ) =- =- " _-'--' - -== --' " . =- (
- - _'
,--
- - _' ) - (
_-= (" * " )
_-= ) =- (
,'+-
,'+- .
Sample of output for example 1.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


`+- `
,- _,=- .= - ,-=-' '-=' ' ='-'
_-'--' - ='' =' ,= = -,-=-
' .= :

= '
' .= :

'
' .= :
-,-= .= : -
, -''- ' -
_-'--' - -== --'
* * * * * * * * * * *
* * * * * * * * * *
* * * * * * * * *
* * * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*

Example 2. Here the introduced program reads three
integers numbers and finds the maximum number, and
then calculates the factorial for this maximum number.

Source file of example 2.
# --=, ` '=-- ' ``` ,- - -, - -=, _-'--' -
'+' --' #
,--
_,=- : --
,--
_--


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


_-= ) =- " '=-- ' ``` ,- - -, - --=, _-'--' -
'+' --' --=, ` ( " .
_-= ) =- =- " ` _,=-' ' .= ( " :
) (
_-= ) =- " -'`' _,=-' ' .= ( " :
) (
_-= ) =- " -''`' _,=-' ' .= ( " :
) (


) (

) (

_-= ) =- =- " -, - " (
) ~ (
_-= ) =- " -, -` --' '-= -, ` " (
`
,--
--
- - _'
-- -- *
_-= ) =- =- " -, - -- " " "
-- (
,'+-
,'+- .

Sample of output of example 2.
--=, ` ' ``` ,- - -, - --=, _-'--' - --'
'+' .
` _,=-' ' .= :
' .= -'`' _,=-' :
-''`' _,=-' ' .= :
-, -


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


-, - --
Example 3.

The program introduced in this example reads an
integer positive number and decides whether the number
is prime or not and finds the factors of this number.

Source file of example 3.

# '=,'- ,-, ` ' .=--' -' ' -,-=-- ,-, _-'--' -
-' =' .-,= #
,--
_,=- :
_,=- : _-
,--
_-
_--
_-= ) =- " -,---' .= ) ' / ' ,= ( '=,
'-,= " =- (
_-= ) =- " ' .= : - ("
) (
) (
,--
- - _' ) / (
,--
) ,- (
,--
_-= ) =- " ' ,= -' " =- (
# ,-=' =' = -,,-- -' - ='' .
#
+- ,'
,'+-
) ~ ) ((
_-= ) =- " ' -' " =- (


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


,'+-
`
) (
_-= ) =- " ' ,= -' " =- (
`
,--
_-= ) =- " ,--- ,= -' " =- (
_-
,'+-
) _- (
,--
- - _'
) ,- (
_-= ) " ' .-,= - , " =- (
,'+-
,'+- .
Sample of output of example 3 .
- -,---' .= ) ' / ' ,= ( '-,= '=,
' .= : -
' ,= -'
== ' .-,= - ,
' .-,= - ,
' .-,= - ,
' .-,= - ,
' .-,= - ,
' .-,= - ,
Another sample of output of example 3.
- -,---' .= ) ' / ' ,= ( '-,= '=,
' .= : -
' -'
' .-,= - ,
' .-,= - ,
Conclusion



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


What seems to be very clear from the conducted
survey is that there are many Non-English Programming
Languages which are used in their countries. Arabic
Programming Languages are also exist but not widely
used; some of them have been built but not utilized in a
useful way due to some weak points that degraded such
a specific tool. However; the others were halted in the
mid way of its development process.
The proposed programming language uses an
Arabic alphabet and syntax. Because of its simplicity,
the proposed language can be used by beginners to
develop programs in a simple and easy way. The
proposed language provides the capability to develop
simple software packages. It can be expanded easily so
as to include more powerful options.

Future Work
The present Arabic syntax programming languages
can be used as a core for other more powerful languages
using Arabic alphabet. Other features can be added such
as: rich interface, other data structures such as arrays
and records, other Constructs such as: functions, other
procedures and networking services.
A creative software engineer should aim to add new
unavailable features to the Arabic programming tools.
Such features should not exist in present and used in
wide programming languages, a way to distinguish
Arabic tools from others. The new programming tools
that will be created should satisfy the needs of the
marketplace locally and internationally.
References



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


1. Alfred V.Aho, Ravi Sethi, Jeffrey D.Ullman.
Compilers: principles, Techniques and Tools.
AddisonWesley, 1986.
2. Aycock, J., N. Horspool, J.Janousek and B.
Melichar, Even faster generalized LR parsing. Acta
Information, Vol. 37,No. 9, June 2001.
3. Glass, S. ,D. Ince and E. Fergus. High level
debugger for parser. Software practice and
experience, Vol. 31,No. 10, August 2001.
4. Gebala R.m., C. McNamee and R. Olsson.
Compiler to interpreter: experience with a
distributed programming language. Software
practice and experience, Vol. 31, No. 9, June 2001.
5. Reali, P. (2000). Structure a compiler with Active
Objects. JMLC.
http://www.inf.ethz.ch/personal/reali/papers/JMLC2000
.ps.gz.
Cedval, M.1999. C parser.
http://tdb.uu.se/~mats/KT/99/parser.cc
6. Pratt, T.W. , Programming languages: Design and
Implementation, 4th edition, Prentice Hal, 2001.
7. Pittman, T. and J. Peters. The Art of compiler
Design: Theory and Practice. First edition, Prentice-
Hall International Edition, 1997.
8. Holub A. Compiler Design in C. Second edition.
Prentice-Hall International Edition, 1989.
9. Bochmann, G. V. and P. Ward. Compiler writing
system for attribute grammars, Computer Journal,
Vol.21, No. 2, 1977, pp: 144-148.
10. Ahmed, F.A., Developing an Arabic Parser in a
Multilingual Machine Translation System, M.Sc.
thesis, 1999, Cairo University ISSR.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


12. Shaalan, K., A Knowledge base system for
understanding an inflected Arabic word, M.Sc.
thesis, 1989, Cairo University ISSR.
13. Feddag, A., Arabic Morpho-syntax and semantic
parsing, Department of computer science,
University of Manchester, 3rd international
conference on Multilingual, 10-12 Dec., 1992,
Univ. of Durham.
14. Hlaly., Information system and Arabic: the use of
Arabic in information system, Linguistics signal
and information processing, A subsidiary of
Haarper and Row Publishing Inc., 191-197, 1987.
15. Khayat M., Understanding Natural Arabic, in
proceeding of the First KFUM workshop on
information and computer science, Dhahran, Saudi
Arbia, pp. k1-k4, 1996.
16. Youssef S., A Model for Arabic Syntax and
Morphology, M.Sc. thesis, Faculty of Engineering,
Ain Shams University.
17. Rafea, A. and Shaalan, K., Lexical Analysis of
Inflected Arabic words using Exhaustive Search of
an Augmented Transition Network, Software
Practice and Experience, Vol. 23(6), pp. 567-588,
JhonWiely & Sons, U.K., June, 1993.
18. Shaalan, K., Farouk, A., and Rafea, A., Towards,
an Arabic Parser for Modern Scientific Text, In
proceeding of the 2nd conference on language
Engineering, Egyptian Society of Language
Engineering (ELSE), Egypt., April., 18, 1999.
19. Mady, M. A., Knowledge Based Techniques in an
Arabic Syntax Analysis Environment, PhD thesis,
1994, Cairo University ISSR.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


20. El-Sadany, T., Arabic Morphological Analyszer on
A Personal Computer, M.Sc. thesis, Faculty of
Engineering, Al-Azhar University.
21. Gheith, M. and Aboul Ela, M., Knowledge
Integration in an Efficient Arabic Syntax Analyzer,
Second Conference on Arabic Computational
Linguistic, Kuwait, 1989 (11), pp. 631-642.
22. Azza, A. M., Natural Language Representation for
Arabic Language, M.Sc. thesis, 1991, Cair
University, ISSR.
23. Ahmed, H.K., Automatic Understanding of Arabic
Sentence, M.Sc. thesis, 1990, Cairo University
ISSR.
24. Rafea, A., Understanding an Arabic Word in A
Text Automatically, the 19th Annual Conf. On
Statistics, Computer Science, and Operation
research, Dec. 1984, Egypt.
25. Sammet, J., Programming Languages: History and
Fundamentals, Prentice-Hall, Englewood Cliffs, NJ
(1989).
26. http://wepa.com/ve/categories/x/s/p/index.-en html
27. http://jaramillo.virtualave.net
28. http://home.foni.net/~h-w-gruhn-kn/mik_doku.htm
29. http://www.win-logo.de/
30. http://olivier.sc.free.fr//logosc/telechar.htm
31. http://www.cplire.ru/lab144/koi8/03010000.html
32. http://private.peterlink.ru/Kinz/
33. http://www.javascripts.ru/
34. Mohammed Al-Affendi, Arabic Text Segmentation:
A comparative study of existing algorithms and a
suggested parallel algorithm, Journal of
Mathematical Modeling and Scientific Computing,
Boston, USA, 1996.


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


35. Mohammed El-Affendi, On the progmatics of
Arabic Speech Synthesis and Analysis, the first
workshop on Computer and information systems,
KFUPM, Dhahran, June,1996.
36. Mohammed El-Affendi, Sunbla: An Intermediate
Step in a Gradual Promotion Model for the
development of Arabic Programming Systems, vol.
23, the Arabian Journal for Science and
Engineering, KFUPM, Dhahran, KSA, July, 1994.
37. Mohammed El-Affendi, Implementation hints for
the Arabization of Programming Languages, The
First Arabization Symposium, KSU, CCIS, April,
1987.
38. Mohammed El-Affendi, Towards, an
Advanced Arabic Programming Language: The
Sina Programming Language, The 9th National
Computer Conference, Riyadh, Saudi Arabia,
September, 1986.
39. http://sdlefsn.cs.iitm.ernet.in/mfced
40. http://www.tuxedo.org/~esr/intercal/iperl.html
41.
http://www.home.arcor.de/christain.neher/cgi.servle
ts.html
42. http://en.wikipedia.org/wiki/Arabic_language
43.
http://lists.arabeyes.org/archives/doc/2004/January/
msg00158.html
44. http://en.wikipedia.org/wiki/Non-English-
based_programming_languagesbased_programmin
g_languages
45.
http://doi.ieeecomputersociety.org/10.1109/AICCS
A.2001.934031
46. http://en.wikipedia.org/wiki/ARLOGO


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


47. http://www.jeemlang.com/download.htm
48. http://www.winoscript.com
49. http://www.wino. ws /winoscript /winoscript/ wino /
wino/winoscript/MultilineAr.html
50. http: //www. wino.ws/winoscript/ winoscript /wino
/wino/winoscript/sercal %20cos &s in.html
51. http: //www.wino. ws/winoscript/ winoscript
/Wino.Script
52. http://www.wikipedia.org/Algorithm.html
53. http://tdl.mit.giv.in
54. http://www.bookrags/ logoProgrammingL-
anguages


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


Appendix A

I) Al-Khawarizmi programming language:

1. Alphabet:
- Arabic Letters: ) , , , (.........
- Arabic Numbers: ) , , (.....
- Special Symbols: ) } * ( ) - / & (......

2. Words:
Variables, Functions, Reserved words.

3. Rules for writing Variable and Function names:
- The name must begin with a letter or "_" and
followed by any combination of letters and digits.
- The name must not contain any special symbol.
- Finally, the name must not be any reserved word.

4. Types of Variables:
4.1. Numeric variables: memory locations to save
numbers.
4.2. Boolean variables: memory locations to save
Boolean values ) _- == ' (
4.3. Symbolic variables: memory locations to save
symbols.

Examples of variables and their types:
-,-= , // float
-='-- _-'-' // double
_,=- , // integer
,-=-' .,,= // long
- , // char
-=-- / / Boolean
--'` // const


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --



5. Reserved words:
_,-. _, _,_, ,- ,_ ., ..
,,~ ,, ., = ', _~'
,, '~ . . , _,,- ,
6. Syntax of functions:

_, , , ._' ,

,
_ ,

_,- _,-. , _,-. _,-. ,

.....
- ,-
.....
_ ,

7. Numbers:
7.1. Integer numbers:
The number consists of one or more digits must not
contain any decimal point and is possible to contain '+'
or '-'.
7.2. Real numbers:
The number consists of one or more digits, contain
decimal point and is possible to contain '+' or '-'.
8. Constants:


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


8.1. Numeric constants: numeric variables but there
values must not be changed during program execution.
8.2. Symbolic constants: symbolic variables but there
values must not be changed during program execution.
9. Literals:
Any combination of letters and digits enclosed between
double quotations.
11. Operators:


Arithmetic operators




` '+--,=
- ='' '-'
-''-
_-=''
* -''
/ ---''
'-' ---' =,=-'


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


: - Relational and logical operators:















11. Statements:
11.a) Conditional Statements:
-First type:
) - ( '-=
-Second type:
) - ( '-=
'-= `
-Third type:
) - (
}
.-=' - =,-=-

`
}
.-=' - =,-=-

11.b) Switch Statements:
. ,,~,
_
,.
- _ ,' ,,
- ,. ,' ,,
-- ,,
-: ,, .
o , .= ,-
,' .= ,-
: . '


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


_,,- ) ,-- (
}
--'` ''= : '-=
--'` ''= : '-=
--'` ''= : '-=
.-+- : '-=

11.c) Conditional Statements:
-first type:
'-''= ) '---' ',' --- =' -,-, - ,---- -, (
'-=
'-''= ) _,=- (
}
_-=


-Second type:
'--,- ) - ( '-=

'--,- ) - (
}
.-=' - =,-=-



}
.-=' - =,-=-

'--,- ) - (

'-,` '-= " - "
---` '-= " --- "
=' '-= " = "



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


12. Arrays:

First type:-
,- - - ,--' - ,---' | ,= |
_,=- | |
-Second type:
,- - - ,--' - ,---' | ,= || ,= |
_,=- | || |
II) Arlogo:
It is the Arabic language logo project; it is based on
Logo language and tries to create the first open source
Arabic programming language. The idea of creating a
programming language like this for children come from
the realization that most existing computer languages
were designed to do computation and lacked the ability
to handle non-numeric symbols, and most languages
had complex syntax rules, so Elementary grade students
can use it for simple tasks with very little preparation
and its structure exemplify mathematically-important
concepts with minimal intrusion from programming
conventions.
The "turtle" is a triangular object that appears on
the computer screen and moves in response to the
simple commands typed on the keyboard, Users learn to
create programs that draw simple geometric figures,
such as squares or triangles, which can be combined
into bigger programs that draw more complex figures,
such as houses.
Arlogo makes it possible for beginners to learn to
program fairly quickly because it starts out with The
"turtle" is a triangular object that appears on the
computer screen and moves in response to the simple
commands typed on the keyboard, Users learn to create
programs that draw simple geometric figures, such as


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


squares or triangles, a set of words called primitives that
are easy to understand. For example, " ---" would make
the turtle go forward, and " ,-," would make it turn to
the right," '-," would make it turn to the left, while
" '-= " would hide it from view. Using those primitives,
a user can write a set of instructions, known as a
procedure " ' ", name it, and use it to build other
procedures. A procedure is executed by typing its name.
An example of a procedure that draws a square is:
Example : draw a squire

Example : draw a squire
'-,
---
'-,
--- ---
'-,
---
'-,



This draws a square with sides 100 units long (in the
image the turtle has yet to turn LT 90 to be back in its
starting position).
These procedures use a constant of 30 for the sides of
the square and the triangle, which means that if we
wanted to draw squares and triangles of different sizes
we would have to modify the procedures. Logo uses
variables in the title line of a procedure to allow the use
of different values every time the procedure is executed;
the variable name is separated from the procedure name
by a space and a colon (:). To execute procedures using
variables, the name of the procedure must be followed
by a space and a numerical value. For example, the



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


command " _-- " would draw a square of 60 units. A
procedure can call other procedures, as shown and can
also call itself, making Logo a recursive language.

III) Jeem Programming Languages
Jeem consists of three parts:

1. Declarative statements:
As any variable starts with letter and consists of
letter, digit or _
2. Executable statements:
3. Compilers statements:
These statements execute at compile time. Any
compiler statements start of one of
those
Graphics Example on Jeem language:
Draw Mathematical relation to draw Flower curve
,'

_, _- ,, _ , _,,
., ~,- ,- _,~ . . _ - . ,-

',
:: _ ,= .,- _, _-' ' - .- , . , ,
:: _,-. ., . , ,- ., .,-
__' ' .,' '
_ ., - ,.
_ ,-' _ . , . , . . ,-
. ,-' _,-.
,-' _ . . _ . ,-


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


,-' _ . _,-.
-' - - `
_ -' - _- `
,, ,_' , . , , _- . ,
,, ,_' , _ . , , _ .- ,
.' ' . ., , -' '
. ','
,~. .,, ,_'
-' -
, -' -
, '~ _,' _

, -' - , - ,
_ -' - .- , . , ,
_ -' - .- , . , ,
-' - _ .- , , - ,
_ -' - _ .- , , - , _
-' - _ .- , , - ,
_ -' - _ .- , , - , _
,, ,_' , _. , , _. ,
, -' - , - ,




,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


Execution



IV) Al-Risalh:
1) Tokens of the Language:
Tokens in Al-Risalh are represented by a sequence
of characters that can be treated as a single logical
entity. Each token is either an identifier, reserved word,
literal, relational operator, delimiter, blank space, or
plus-multioperator.
1.1. Identifiers.
Tokens that start with an Arabic letter are
considered to be identifiers. The syntax for an identifier
for Al-Risalh is as follows::
<identifier> ::= <letter> <identifier-tail>
<identifier-tail> ::= <letter> <identifier-tail>
<digit> <identifier-tail>
<stretcher> <identifier-tail>
_ <identifier-tail> |


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


1.2. Delimiters.

A computer program is a linear string of characters.
To represent the structural elements of this language it is
necessary to add delimiters to this string in some way to
mark out the blocks, sections, statements, expressions,
tokens, and other syntactic elements. Certain symbols
are set aside for this process. The delimiters that are
used in this language are: ( . _ " : (

1.3. Reserved Words of the Al-Risalh Language

Reserved words are special identifiers that are part
of the built-in vocabulary of the language and are used
exclusively by the language.


1.4. Literals

The digits are the Arabic numbers 0 through 9 or
the Hindi numbers. The syntax for literals is:
<number> ::= <digits> <fraction> <exponent>
<fraction> ::= . <digits>
<exponent> ::= E <sign> <digits>
<digits> ::= <sign> <digit> <digits-tail>
<digits-tail> ::= <digit> <digits-tail>
<digit> ::= 0|1|2|3|4|5|6|7|8|9|
1.5. Arithmetic Operations
In the language, a mathematical expression must be part
of either an assignment statement or a logical statement.
There are four main arithmetic operators in the
language: addition, subtraction, division, and
multiplication.



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


1.6. The Built-in Functions

There are six built-in functions in this language:
sqrt -= , abs '=- , sin '= , cosin '-= , sqr _,-- , and
power .

1.7. Relational Operators

The definition of the Al-Risalh language semantics
allows the programmer to assign variables of different
atomic types. This will not cause a type mismatch
semantic error message. Also the definition of the Al-
Risalh language semantics allows the programmer to
use the equal operator with class heritage, in which the
derived class is assigned to the base class as follows:

class circle derived from shape
begin
. . .
end class
message run of myshape
begin
c : circle;
s : shape;
s = c
end message
The above assignment statement is legal since every
derived class (object) c will be in base class s (object)
but not vice versa. In the case of assigning, for example,
an array of 10 indices to an array with 20 indices the
definition of the language semantics will allow that. To
illustrate this, suppose the student declares the follows:
list1 = array [1..10]
list2 = array [1..20]


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


and later in the program he assigned list1 to list2:
list2 = list1;
the above statement is legal since the values in list1 will
override the values in list2. Therefore, the values of list2
will disappear and will be replaced by the values in
list1. Also the programmer can replace the value of
index 7 in list2 by the value of index 3 in list1 as
follows:
list2[7] = list1[3];

the above statement will make the value in index 7 of
list2 disappear and it will be replaced by the value in
index 3 of list1.

2) Class Declarations

A class can be a standalone class or derived from a
base class. However, this technique resolves the classes
and class libraries issue in object-oriented programming.
The class syntax is as follows:
<Class-decl> ::= Class
<class-decl-head>
begin
<class-friends>
<class-public-msgs>
<class-privates>
end class

< _,'--' - ,'`- ,=,-''>
< _,-- - ,=,- > ::= ,=,-
,--
< ,=,---='-- >
< .-'-'- -'' - ,=,-'' >
< ',-,-= - ,=,-' >
,=,- ,'+-
The above syntax allows us to have a class as an
abstract data type (ADT). And objects of this class are
available at run time. The syntax expresses the
reusability (inheritance) feature; one can derive a class
from another class. Also this type of declaration will


,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


help the student when compiling Al-Risalh programs,
since Al-Risalh uses one pass compilation.

V) WinoScript:
Example 1:

-= ,--' --=` ;

,-- ,--' -=' = '<TABLE WIDTH="100%"
HEIGHT="100%"><TR><TD>';
,'+- ,--' -=' = "</TD></TR></TABLE>";
,'=' ,--' = "</TD><TD>";
,--' ;

,--- '-' (){
''--' ,--' '-' ") ,= ''--' ")
,= ,--' ''--' ''--' . - .- ;

'-= ,--' ''--' ,= ''--' . '-= ;
,--- ,--' '--' '-= ''--' / -= --=` ;

-' ,--' = "";
-' ,-- -=' ;
'- ) ,--' ; ~ '-= ''--' -= --=` ; ++){
++;
-' ,= ''--' . _,=- ) , );
) ,--- '--' ( } -' ,'=' ; }
}
-' ,'+- -=' ;
''--' ,--' '-' ") = ''--' ")

''--' . .-- -'
}



,=- '-,-=-' ,,''

,-' ,=-' ,'' '-,'-' ,--- --


'= '-' (){
''--' ,--' '-' ") ,= ''--' ")
,= ,--' ''--' ''--' . .-- ;
// ,--'' ") ,= ''--' " , " ,= ''--' " , " - .- ")

-' ,--' ,-- -=' ,= ''--' ,'+- -=' ;
''--' ,--' '-' ") = ''--' ")

''--' . .-- -'
}
.,-=-' --= '=