ACDK White Paper - Aal Language
Translation: Xue Changyu
About AAL Language (Artefaktur Aspects Language) (Because this language is still in the initial development phase)
This chapter content:
Overall concept
Foreword
AAL and ACDK
Compilation / explanation
DMI integration
AAL language definition
basis
Strong / weak type binding
Language characteristics
Object-oriented characteristics
method
abnormal
Select and loop
other
AAL compiler
Compiler review
The compiler is integrated in AAL
Compiler frame
Overall concept
Foreword
AAL is used as a basic language that is similar to Java, but there are some main features.
A very powerfull feature of Lisp is the fact, that most language constructs which are hard wired in most language are simply also implemented inside the language itself. A simple if condition is just also implemented in Lisp. On a simplified view if is just an function Which takes 2 or 3 arguments.
(if condition_expression then_expression else_expression).
This is also possible because Lisp has a very small core syntax definition - all programm and data are organized in lists Unfortunatelly this fact give the universal power of lisp, but make it also quite hard to read In higher languages different things are expressed with.. DiffERENT SYNTAX ELEMENTS.
Semantik and Syntax CAN Express Specific IDiomatics.
For example: It is easy to use the regular expression in Perl because it is the same as other language characteristics.
In traditional languages, such as Java and C , regular expressions are implemented by using library functions.
In the regular expression of AAL, it is possible not only to have a special function, but there should be special syntax.
Use the interface to compile / explain yourself, which can make the user define a new syntax structure when compiling / run.
AAL and ACDK
* AAL language is based on and runs in ACDK.
* AAL can implement an ACDK interface.
* AAL interface can be implemented by the ACDK class
* All DMI servers and clients can be implemented.
Compilation / explanation
* Direct explanation.
* Compiler for C (ACDK)
* Compiler for Java VM
* Compiler for .NET VM
DMI integration
A good feature is to allow several languages to be marked in one source code.
The interpreter can be used to select the appropriate execution of these tags.
AAL language definition
basis
Language will follow the ACDK / Java / C # / Python Paradigma.
Strong / weak type binding
ALS will support the binding between types and types.
Void foo (aclass cls); / / strong type
Void foo (CLS); // If the type
Void bar ()
{
Aclass acls = new aclass ();
o = new aclass ();
Foo (ACLS); // Select First Version
Foo (O); // Select Second Version
Foo ((aclass) o); // select first version iemethod (); // @ uses invoke
Acls.method (); // Uses Direct Method Call
}
Language characteristics
Preprocessor / aspects
* The basic pre-processing program is fully available
* Language hand can be attached to method call, and so on.
Perhaps it may be connected to the property.
Unit concept
* Units, similar to Java's Modell.
Type Modell
* As long as it is possible, the performance of the stack is preferred.
* BYVAL instantiates.
* Allow separate declarations and definitions (execution).
* in, out, inout, byval variable direction
Object-oriented characteristics
* Class with interface and parent class
* Properties is connected in this class
* Constructor / destructor
* Static method
* Public / private
* Extending / Overwriting class uses object-oriented C / SmallTalk. Method
* Anonymous class
* LAMDA expression
* Entrusted.
* Signal / Slot
method
* Free standard method.
* Multiple functions.
* Default parameters.
* For too many parameters will use collections to enable them to access.
* Named parameters (in the caller or being called by the caller)
* User custom operation is similar to C .
abnormal
* All is characterized by abnormal clause processing.
Select and loop
* Similar to C / Java
* Foreach Construction
other
* Regexp (Regular Expression Process Pack) as a syntax element
AAL compiler
Compiler review
1. File Expression Analyzer Detection Syntax Declaration.
2. Language Expression Analyzer Build Syntax Tree
3. Decision of the connector Use the grammat tree as a reference
4. Translate to other code or execution
The compiler is integrated in AAL
By the AAL language compiler yourself in the compile time AAL compiler you will be able to access and extend. It can be used to learn new language structures.
Compiler structure should have the same range regulations Similar to type
Example for defining a new operation:
String Add2Strings (String S1, String S2)
{
StringBuffer SB (s1.length () s2.length ());
Sb.append (s1); sb.append (s2);
Return sb.toString ();
}
Void foo ()
{
asl.compiler.addoperator ("<<", binaeroperator);
String S1 = "Hallo";
String S3 = S1 << "AAL";
}
Example for defining new loopType:
Class mykeywordparser
Implements asl.compiler.KeywordParser
{
Void Parse (Asl.compiler.Parser P, Asl.compiler.treenode CNode, Textscanner Scanner)
{
// Parse text Until finished
}
}
Void foo ()
{
asl.compiler.addkeyword ("mykeyword", new mykeywordparser ());
MyKeyword (CH, New String ("ASDF"))
{
}
}
BackTick operations may be used to evaluate code debris in other compilers or interpreses
Void foo ()
{
Lisp = new lispcompiler ();
INT i = 2;
INT J = Lisp (`( $ I 3)`);
}
Compiler frame
Class Type
{
}
Class Variable
{
TYPE GETTYPE ();
}
Class Expression
{
TYPE getResultType ();
}
Class code
{
}
Class Statement
Extends Code
{
}
Class codeblock
Extends Code
{
}
Interface CodeInterface
{
}
Interface function
Implements codeInterface
{
}
Class Forstatement
Extends Statement
Implements codeInterface
{
}
Class Unit
{
}
Class Function
Extends Type
Implements codeInterface
{
}
Class Interface
Extends Type
Implements CodeInterface // for Constructionors
{
}
Class Class
Extends Interface
{
}
Class Scanner
{
}
I am very sorry, this article has no translation, there is no translation in the middle. The main reason is that when translation is translated, I can't affirmed the original text, and I don't want to translate misleading. You: P, my foreign language is limited, sorry translation: Xue Changyu Changning @ mail.com2004-12