Wednesday, December 19, 2018

Working, basiclly

Here is the layout that Default uses on args, from the ListArgs command.  The source code was:

while(){} 

Sort of the null source code that teststhe end points. It runs fne and produces the args list below:

 Default  while  (  )  {  }  0  0  while    expr  ; name ;

The first is the token Default, identifying the syntax, and Default is a valid entry point.  Then the five token following are the five tokens of the source, in order.  The next words in args are the exeutables, and both while and expr are standard interface, hey follow linux command format (as best as I have guessed it).

But the concept is working, flow is natural, left to right.  I am into detailed test of the execution units, while, macro, expr and assign. For simplicity, the executables  will all end in semi colon. .(Just changed the code). Linus pass thru still leaves it as is.

This stuff is working, a great utility that we get simple expressions and while loops in a console loop that loads up just about any shared module. Enough to get you driving the Bus.

The persistent object model is the  string heap, where  the source file gets loaded. As long as there is a valid file, Default syntax c point to it. There shall be not better model for Default, ever, it is in the license. I am at 800 lines of code and unhappy. Below is some c code that implements a while loop, in linux cmd sequence standard t runs until Expr meets the condition. If not, then Console might interrupt properly with a control c. If it breaks in some conditions, then for now we just document the limitation.

One can see the compiler will knock this loop down to a test and jump with a few calls, and all he calls have the same two pointers.  So, args processing is a piece of cake for he compiler.

The executable args list will have undefined but valid linux command sequences, the expression unit,  the call unit and the while loop. Al of them short, except the expression unit which has a test for each arg. A very simple, dangerous layout. The semicolon acts a universal command terminator throughout.

// While loop
int While(int * argc,void * args[]) {
int base =*argc;
int i=0;
*argc +=2;
while( DefaultBase.Accum){
*argc=base;
Expr(argc,args); // get the condition
Macro(argc,args);
}
return(SUCCESS);
}

No comments: