Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
soc:2009:lynusvaz:notes:start [2009/06/08 22:23] lynusvaz |
soc:2009:lynusvaz:notes:start [2009/08/15 08:40] (current) lynusvaz |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Lynus Vaz: Enhanced scripting language ====== | ====== Lynus Vaz: Enhanced scripting language ====== | ||
| ===== Notes ===== | ===== Notes ===== | ||
| + | [[.:scripting_doc:Features added|Documenting the new features]] | ||
| + | |||
| I've taken a few ideas from Fabrice Bellard's C OTCC compiler: http://bellard.org/otcc/ | I've taken a few ideas from Fabrice Bellard's C OTCC compiler: http://bellard.org/otcc/ | ||
| Also looking at [[http://www.gnu.org/software/bash/bash.html|bash]] | Also looking at [[http://www.gnu.org/software/bash/bash.html|bash]] | ||
| + | |||
| + | Here's the POSIX specification for the shell: [[http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html]] | ||
| + | |||
| + | And the PXE specification: [[http://www.pix.net/software/pxeboot/archive/pxespec.pdf]] | ||
| Proposed syntax: | Proposed syntax: | ||
| Line 33: | Line 39: | ||
| | '||' | | '||' | ||
| MONO_OP => '~' | '!' | MONO_OP => '~' | '!' | ||
| + | |||
| + | Syntax for if-else branches: | ||
| + | if <condition> | ||
| + | <statements> | ||
| + | [ else | ||
| + | <statements> ] | ||
| + | fi | ||
| + | |||
| + | Proposed syntax for while loops: | ||
| + | while <condition> | ||
| + | do | ||
| + | <statements> | ||
| + | done | ||
| + | |||
| + | Proposed syntax for for loops: | ||
| + | for <variable> in <value list> | ||
| + | do | ||
| + | <statements> | ||
| + | done | ||
| + | Pretty similar to the shell syntax, so it should be familiar. | ||
| + | |||
| + | |||