| Intentional Programming | ACI Concept | AAL definition | AAL syntax | AAL parser | Object Representation | OpCode | Reference Links |
How to use AAL as Intentional Programming System.
String s = new [StackAlloc] String("asdf"); |
void foo(int i) { } [ compiler.findNode("FunctionDecl").getType().attatchAttribute("Key", "Value); ] |
[ compiler.loadTypeLib(new JavaLib("java/net")); // all classes of java.net are available ] java.net.SocketServer ss = new java.net.SocketServer(); |
[ compiler.pushGrammar(); // make new scope block for the grammar compiler.registerRule("RegExpExpr", new RegExp("Expression [ '=~' REGEX_EXPRESSION ]" )); compiler.replaceRule("Expression", "RegExpExpr"); ] // now this new Grammar element is available ("asdf" + b) =~ /asdf/; [ // remove the Grammar defintion. compiler.popGrammar(); ] |
[ compiler.registerToken("END_OF_LISP", "<<EndOfLisp"); compiler.replaceGrammarUntil(new LispInterpreter(), "END_OF_LISP"); ] (defun x (a b) (+ a b)) <<EndOfLisp acdk.lang.System.println("now back in ACDK"); // using the method defined in lisp acdk.lang.System.println(x(1, 2)); |
[ Code logAdder = new LogInOutAdder(orgRule: compiler.getRule("FunctionBody"), classname: "MyClass", funcname: "foo"); compiler.replaceRule("FunctionBody", locAdder); ] class MyClass { public void bar() {} public int foo(int i) { // LogInOutAdder whould insert a statement to print out something like "MyClass.foo(42) entered" return i + 1; } } |
Object o = "asdf"; o.length(); // this line will be explained |
class AClass { void foo(); } // commit point to generate LST here fore the class Rule. [ // AClass as LST definition is alrady available compiler.dosomething(); // has to be interpreted. ] |