diff options
author | Thomas "Cakeisalie5" Touhey <thomas@touhey.fr> | 2017-02-26 02:22:24 +0100 |
---|---|---|
committer | Thomas "Cakeisalie5" Touhey <thomas@touhey.fr> | 2017-02-26 02:22:24 +0100 |
commit | c8965a17966c9cade3d19ccb27481004bf80eed4 (patch) | |
tree | ff0335189aefb9b931132ceb43ec7887311ce98e | |
parent | 3631d1a6acd10e1ee38fe63f2927575369a40a0d (diff) |
Continued trying to document things.
-rw-r--r-- | README.md | 47 | ||||
-rw-r--r-- | characters.yml | 135 |
2 files changed, 117 insertions, 65 deletions
@@ -114,26 +114,41 @@ If the character data has a `set` field, then the character is in a set; otherwise, it should be considered as part of the default set. #### Embedded CASIO BASIC documentation -Some characters will have the `type` field, either directly or in their -category. This type means they have a special meaning in Basic. There are -two types: `function` and `object`. If it is one of the two, there is an -associated syntax, which is either `<name>(arg1, arg2)` or `<name> arg1,arg2`, -the first syntax is when `par` is `true` and the second one is when it is -`false`. Note that for the first syntax, the ending parenthesis is not -mandatory. If `par` is `false` (or non-existent), then the `fix` field can be +Some characters will have the `type` field. This type means they have a special +meaning in CASIO Basic. There are two types: `function` and `object`. There is +an associated syntax, which is either `<name>(arg1, arg2)` or +`<name> arg1,arg2`, the first syntax is when `par` is `true` and the second one +is when it is `false`. +Note that for the first syntax, the ending parenthesis is not mandatory. + +If `par` is `false` (or non-existent), then the `fix` field can be set to `infix`, which means the function will be used with either `arg1 <name>` or `arg1 <name> arg2`. -There is no need for more arguments for it to work, if you use this -documentation as a base for an interpreter: as in Python, your function should -receive an undetermined number of arguments of whatever type, and return (or -not) whatever it wants. The other fields listed here are there for pure -documentation. - If the function/object should receive arguments, it can be documented using the -`args` field. This field receives a comma-separated arguments names list. If -the function is supposed to make an action, this action can be documented using -the `action` field. If it is supposed to return something, it should can +`args` field, and if it has, after these arguments, optional arguments, it can +be documented with the `optn` field. These fields receives a list of argument +strings. An argument type can be imposed by add-in `:<code>` at the end of the +argument string; for example, here are the `For` and `To` entries: + + - + code: 0xF704 + name: For + category: Statement + args: ["to:0xF705"] + action: ... + multi: [0x46, 0x6F, 0x72, 0x20] + - + code: 0xF705 + name: To + category: Operator + args: ["assign:0x0E"] + optn: ["step:0xF706"] + action: ... + multi: [0x20, 0x54, 0x6F, 0x20] + +If the function is supposed to make an action, this action can be documented +using the `action` field. If it is supposed to return something, it should can be documented using the `return` field. ### Fonts diff --git a/characters.yml b/characters.yml index f25ec20..b4cfcd3 100644 --- a/characters.yml +++ b/characters.yml @@ -793,7 +793,7 @@ multi: [0xE5B1] ascii: - " nPr " - - " \perm " + - " \\perm " - code: 0x89 name: Addition @@ -911,7 +911,7 @@ multi: [0x1C] ascii: - " nCr " - - " \comb " + - " \\comb " - code: 0x99 name: Substraction @@ -936,8 +936,8 @@ return: Get the reciprocal number. multi: [0xE5CA] ascii: - - "\rcp" - - "\^-1" + - "\\rcp" + - "\\^-1" - code: 0x9C name: Degree @@ -2575,215 +2575,252 @@ code: 0xF700 name: If category: Statement - multi: 0x49,0x66,0x20 + args: [expression] + action: Jumps to the corresponding Then if the expression is evaluated true; + otherwise, jumps to the corresponding Else if it exists, or to the IfEnd. + multi: [0x49, 0x66, 0x20] - code: 0xF701 name: Then category: Statement - multi: 0x54,0x68,0x65,0x6E,0x20 + args: [expression] + action: If the last executed instruction was an If, evaluate the expression; + otherwise, jump to the corresponding IfEnd. The official CASIO Basic + interpreter doesn't accept Else statements before Then statements. + multi: [0x54, 0x68, 0x65, 0x6E, 0x20] - code: 0xF702 name: Else category: Statement - multi: 0x45,0x6C,0x73,0x65,0x20 + args: [expression] + action: If the last executed instruction was an If, evaluate the expression; + otherwise, jump to the corresponding IfEnd. + multi: [0x45, 0x6C, 0x73, 0x65, 0x20] - code: 0xF703 name: IfEnd category: Statement - multi: 0x49,0x66,0x45,0x6E,0x64 + args: [] + action: Does nothing; the most interesting thing about this instruction is + its offset. + multi: [0x49, 0x66, 0x45, 0x6E, 0x64] - code: 0xF704 name: For category: Statement - multi: 0x46,0x6F,0x72,0x20 + args: ["to:0xF705"] + action: If the last instruction wasn't a Next, call the To to initialize; + otherwise, iterate. If the final value is achieved or exceeded, jump to the + instruction right after the corresponding Next; otherwise, assign the + counter to the counter variable, and jump to the next instruction. + multi: [0x46, 0x6F, 0x72, 0x20] - code: 0xF705 name: To - category: Statement - multi: 0x20,0x54,0x6F,0x20 + category: Operator + args: ["assign:0x0E"] + optn: ["step:0xF706"] + action: Fill the For's initial value, counter variable and step value. + multi: [0x20, 0x54, 0x6F, 0x20] - code: 0xF706 name: Step - category: Statement - multi: 0x20,0x53,0x74,0x65,0x70,0x20 + category: Object + args: ["step"] + multi: [0x20, 0x53, 0x74, 0x65, 0x70, 0x20] - code: 0xF707 name: Next category: Statement - multi: 0x4E,0x65,0x78,0x74 + args: [] + action: Jump to the corresponding For. + multi: [0x4E, 0x65, 0x78, 0x74] - code: 0xF708 name: While category: Statement - multi: 0x57,0x68,0x69,0x6C,0x65,0x20 + args: [expression] + action: If the expression is true, do nothing; otherwise, jump to the + instruction right after the corresponding WhileEnd. + multi: [0x57, 0x68, 0x69, 0x6C, 0x65, 0x20] - code: 0xF709 name: WhileEnd category: Statement - multi: 0x57,0x68,0x69,0x6C,0x65,0x45,0x6E,0x64 + args: [] + action: Jump to the corresponding While. + multi: [0x57, 0x68, 0x69, 0x6C, 0x65, 0x45, 0x6E, 0x64] - code: 0xF70A name: Do category: Statement - multi: 0x44,0x6F + args: [] + action: Jump to the corresponding LpWhile. + multi: [0x44, 0x6F] - code: 0xF70B name: LpWhile category: Statement - multi: 0x4C,0x70,0x57,0x68,0x69,0x6C,0x65,0x20 + args: [expression] + action: If the expression is true, jump to the instruction right after the + corresponding Do; otherwise, do nothing. + multi: [0x4C, 0x70, 0x57, 0x68, 0x69, 0x6C, 0x65, 0x20] - code: 0xF70C name: Return category: Statement - multi: 0x52,0x65,0x74,0x75,0x72,0x6E + multi: [0x52, 0x65, 0x74, 0x75, 0x72, 0x6E] - code: 0xF70D name: Break category: Statement - multi: 0x42,0x72,0x65,0x61,0x6B + multi: [0x42, 0x72, 0x65, 0x61, 0x6B] - code: 0xF70E name: Stop category: Statement - multi: 0x53,0x74,0x6F,0x70 + multi: [0x53, 0x74, 0x6F, 0x70] - code: 0xF70F name: ElseIf set: C.Basic - multi: 0x45,0x6C,0x73,0x65,0x49,0x66,0x20 + multi: [0x45, 0x6C, 0x73, 0x65, 0x49, 0x66, 0x20] - code: 0xF710 name: Locate category: Statement - multi: 0x4C,0x6F,0x63,0x61,0x74,0x65,0x20 + multi: [0x4C, 0x6F, 0x63, 0x61, 0x74, 0x65, 0x20] - code: 0xF711 name: Send( category: Function - multi: 0x53,0x65,0x6E,0x64,0x28 + multi: [0x53, 0x65, 0x6E, 0x64, 0x28] - code: 0xF712 name: Receive( category: Function - multi: 0x52,0x65,0x63,0x65,0x69,0x76,0x65,0x28 + multi: [0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x28] - code: 0xF713 name: OpenComport38k category: Statement - multi: 0x4F,0x70,0x65,0x6E,0x43,0x6F,0x6D,0x70,0x6F,0x72,0x74,0x33,0x38,0x6B + multi: [0x4F, 0x70, 0x65, 0x6E, 0x43, 0x6F, 0x6D, 0x70, 0x6F, 0x72, 0x74, 0x33, + 0x38, 0x6B] - code: 0xF714 name: CloseComport38k category: Statement - multi: 0x43,0x6C,0x6F,0x73,0x65,0x43,0x6F,0x6D,0x70,0x6F,0x72,0x74,0x33,0x38,0x6B + multi: [0x43, 0x6C, 0x6F, 0x73, 0x65, 0x43, 0x6F, 0x6D, 0x70, 0x6F, 0x72, 0x74, + 0x33, 0x38, 0x6B] - code: 0xF715 name: Send38k category: Statement - multi: 0x53,0x65,0x6E,0x64,0x33,0x38,0x6B,0x20 + multi: [0x53, 0x65, 0x6E, 0x64, 0x33, 0x38, 0x6B, 0x20] - code: 0xF716 name: Receive38k category: Statement - multi: 0x52,0x65,0x63,0x65,0x69,0x76,0x65,0x33,0x38,0x6B,0x20 + multi: [0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x33, 0x38, 0x6B, 0x20] - code: 0xF717 name: ACBreak set: C.Basic - multi: 0x41,0x43,0x42,0x72,0x65,0x61,0x6B + multi: [0x41, 0x43, 0x42, 0x72, 0x65, 0x61, 0x6B] - code: 0xF718 name: ClrText category: Statement - multi: 0x43,0x6C,0x72,0x54,0x65,0x78,0x74 + multi: [0x43, 0x6C, 0x72, 0x54, 0x65, 0x78, 0x74] - code: 0xF719 name: ClrGraph category: Statement - multi: 0x43,0x6C,0x72,0x47,0x72,0x61,0x70,0x68 + multi: [0x43, 0x6C, 0x72, 0x47, 0x72, 0x61, 0x70, 0x68] - code: 0xF71A name: ClrList category: Statement args: List action: Delete the list's content. - multi: 0x43,0x6C,0x72,0x4C,0x69,0x73,0x74,0x20 + multi: [0x43, 0x6C, 0x72, 0x4C, 0x69, 0x73, 0x74, 0x20] - code: 0xF71B name: LinearReg(a+bx) set: CASIOWIN_2.00 - multi: 0x4C,0x69,0x6E,0x65,0x61,0x72,0x52,0x65,0x67,0x28,0x61,0x2B,0x62,0x78,0x29,0x20 + multi: [0x4C, 0x69, 0x6E, 0x65, 0x61, 0x72, 0x52, 0x65, 0x67, 0x28, 0x61, 0x2B, + 0x62, 0x78, 0x29, 0x20] - code: 0xF71C name: S-L-Normal - multi: 0x53,0x2D,0x4C,0x2D,0x4E,0x6F,0x72,0x6D,0x61,0x6C + multi: [0x53, 0x2D, 0x4C, 0x2D, 0x4E, 0x6F, 0x72, 0x6D, 0x61, 0x6C] - code: 0xF71D name: S-L-Thick - multi: 0x53,0x2D,0x4C,0x2D,0x54,0x68,0x69,0x63,0x6B + multi: [0x53, 0x2D, 0x4C, 0x2D, 0x54, 0x68, 0x69, 0x63, 0x6B] - code: 0xF71E name: S-L-Broken - multi: 0x53,0x2D,0x4C,0x2D,0x42,0x72,0x6F,0x6B,0x65,0x6E + multi: [0x53, 0x2D, 0x4C, 0x2D, 0x42, 0x72, 0x6F, 0x6B, 0x65, 0x6E] - code: 0xF71F name: S-L-Dot - multi: 0x53,0x2D,0x4C,0x2D,0x44,0x6F,0x74 + multi: [0x53, 0x2D, 0x4C, 0x2D, 0x44, 0x6F, 0x74] - code: 0xF720 name: DrawGraph category: Statement - multi: 0x44,0x72,0x61,0x77,0x47,0x72,0x61,0x70,0x68 + multi: [0x44, 0x72, 0x61, 0x77, 0x47, 0x72, 0x61, 0x70, 0x68] - code: 0xF721 name: PlotPhase set: CASIOWIN_2.00 - multi: 0x50,0x6C,0x6F,0x74,0x50,0x68,0x61,0x73,0x65,0x20 + multi: [0x50, 0x6C, 0x6F, 0x74, 0x50, 0x68, 0x61, 0x73, 0x65, 0x20] - code: 0xF722 name: DrawDyna category: Statement - multi: 0x44,0x72,0x61,0x77,0x44,0x79,0x6E,0x61 + multi: [0x44, 0x72, 0x61, 0x77, 0x44, 0x79, 0x6E, 0x61] - code: 0xF723 name: DrawStat category: Statement - multi: 0x44,0x72,0x61,0x77,0x53,0x74,0x61,0x74 + multi: [0x44, 0x72, 0x61, 0x77, 0x53, 0x74, 0x61, 0x74] - code: 0xF724 name: DrawFTG-Con category: Statement - multi: 0x44,0x72,0x61,0x77,0x46,0x54,0x47,0x2D,0x43,0x6F,0x6E + multi: [0x44, 0x72, 0x61, 0x77, 0x46, 0x54, 0x47, 0x2D, 0x43, 0x6F, 0x6E] - code: 0xF725 name: DrawFTG-Plt category: Statement - multi: 0x44,0x72,0x61,0x77,0x46,0x54,0x47,0x2D,0x50,0x6C,0x74 + multi: [0x44, 0x72, 0x61, 0x77, 0x46, 0x54, 0x47, 0x2D, 0x50, 0x6C, 0x74] - code: 0xF726 name: DrawR-Con category: Statement - multi: 0x44,0x72,0x61,0x77,0x52,0x2D,0x43,0x6F,0x6E + multi: [0x44, 0x72, 0x61, 0x77, 0x52, 0x2D, 0x43, 0x6F, 0x6E] - code: 0xF727 name: DrawR-Plt category: Statement - multi: 0x44,0x72,0x61,0x77,0x52,0x2D,0x50,0x6C,0x74 + multi: [0x44, 0x72, 0x61, 0x77, 0x52, 0x2D, 0x50, 0x6C, 0x74] - code: 0xF728 name: DrawRSigma-Con category: Statement - multi: 0x44,0x72,0x61,0x77,0x52,0xE551,0x2D,0x43,0x6F,0x6E + multi: [0x44, 0x72, 0x61, 0x77, 0x52, 0xE551, 0x2D, 0x43, 0x6F, 0x6E] - code: 0xF729 name: DrawRSigma-Plt category: Statement - multi: 0x44,0x72,0x61,0x77,0x52,0xE551,0x2D,0x50,0x6C,0x74 + multi: [0x44, 0x72, 0x61, 0x77, 0x52, 0xE551, 0x2D, 0x50, 0x6C, 0x74] - code: 0xF72A name: DrawWeb category: Statement - multi: 0x44,0x72,0x61,0x77,0x57,0x65,0x62,0x20 + multi: [0x44, 0x72, 0x61, 0x77, 0x57, 0x65, 0x62, 0x20] - code: 0xF72B name: NormalG |