Saturday, December 15, 2018

Why I like Default

It is from the lab, always throwing in the 50 lines of code that reads a line then sends data to the thing under test. I never minded, but it was never the central issues.   I just hit that point where do it once, get a simple 'brackets with while loop' going.

 If Shunt was widely available I simply send it the script and it returns it in executable order. Above and beyond having Shunt and  expressions and variables, the net cost of a while loop is about 60 lines of code. Just get it down to those lines of code, farm out everything else. One always has a simple boot language. With that while loop I am free to throw all sorts of scripts at hunt, I have modularized, I can loop around things.

Two basic recursions in the assembler, expression parenthesis and while brackets. Very simple to manage, most of what I do is simplify and code removal,  the stranded code I throw in just to get around some pesky problem at the moment, as I learn.  O we have to methods, the recursive 'bracket assembler' and the Shunt  three stack. They are transforms of one another, Shunt using a separate stack for operators, he other method  using the compiler stack.

The linux command standard

Not difficult. Tokens separated by space, Dash character allowed in tokens and I guess the Dot fits into names, and maybe it knows about filenames as standard. Tha is is, a string format

The binary format is the well know argc, argv, bu we adapt the argc so it can be counted by sequential commands. So, the console loop needs the official token parser, the one and only, so it can have a string and binary mode. The issue comes up because the tokenizer ould be swappable, but to us, swapping out the command formats is like redefining the DMA bus all the time. Tokenize, is part of the DMA controller. Choosing a different Tokenizer standard is like switching computer architectures. My 30 lines of tokenizer remains permanent, it defines the bus architecture. This is not syntax, upper level. This is like object code  format in a microprocessor. So console loop says linux format is al we get, either space separated string or args array and argc index and the ConsoleLoop  goes from the one to the other as needed,  internally.

So, you type something in the console, the assumption its you type a standard string command, with args, as normal.  Any syntax is loadable, Default preloaded but not active.  If I type default, the Default parser gets control, but is still limited to linux command format on the bus. Ditto for Python and Forth, if availability.  What happens in Default is the same, interactive syntax until exit, by the same path. The different is that Default is always thee, limited to opaque place holders for variables and wile loops.  I have to work this flow though because the default  integration of console loop. The code os coming up, it has about 15 syntax error checks, and will other wise loop without crashing. So the command line is being used by me, rather than testing strings.

No comments: