flat assembler
Message board for the users of flat assembler.
Index
> Main > How does an CLI interpret scripts? |
Author |
|
baldr 11 Mar 2010, 07:13
MeshNix,
It depends on how complex your CLI script language is. |
|||
11 Mar 2010, 07:13 |
|
ManOfSteel 11 Mar 2010, 10:12
Well it's quite straightforward even for complex shells. The only difference is that they have many more features and are much more flexible than simpler ones. It's not about "more black magic".
The basic principle is the same: the script file is read and parsed like an assembler/compiler does, but here, every command is executed "live" as if the user was entering them. It may execute internal commands or external programs. It may also support branching, control statements, read/writing environment variables, its own variables, data structures, etc. In Unix shells, the script may not be executed by the shell itself. The first line (the shebang) defines the interpreter to be used, which might not be the same shell or even *a* shell, but python or perl. Start small. For example, only support two internal commands. Then check how other things are done by reading source code and implementing your own routines. |
|||
11 Mar 2010, 10:12 |
|
adroit 11 Mar 2010, 12:54
baldr,
My shell basically supports commands that allow for data manipulation, like array splices, and things of that sort. ManOfSteel, Thanks! I've started designing my shell. My shell basically supports on-line processing, and batch processing. But, I have found few source codes (in assembly). But not that are to complex. Do you know any links where i can find any? |
|||
11 Mar 2010, 12:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.