1
The Axe Parser Project / Re: Axe Parser
« on: May 30, 2010, 12:14:20 pm »Actually, I was thinking about binary flags. There's two possible ways to do this though...And about commands.htm:That's actually a really cool suggestion! Are you suggesting that saying Fix 135 would behave the same as Fix 1:Fix 3:Fix 5 ? That could work, I like the idea!
Fix CODE: Changes how text is drawn. Code must be a constant.
Wouldn't it make more sense to make CODE consist of flags? That way you can set multiple values at once. Especially useful if you want to reset everything at the end of your code.
Option 1: BigText = 1, so passing in any odd number (number with lsb set) will enable BigText while any even number (lsb reset) will automatically enable SmallText.
Option 2: make seperate, independent flags for "opposite options". So BigText = 1, SmallText = 2 (next option = 4, etc.).
Benefits option 1: room for more flags (I have no idea whether this is an issue), possibly more intuitive, probably easier to execute (the internal function which gets called when a programmer uses "Fix" would be smaller and faster).
Benefits option 2: it's possible to set one option without changing (and without knowing the current value of) other options (I don't know whether there are any situations where you'd want to do this).
Which option to choose (1, 2 or the approach you suggested yourself) is something you have to decide, I just wanted to point out the possibilities.
Btw, I understand Axe was developed specifically to be editable on-calc. However, I wonder whether you've thought about making a computer version as well? The data structure (source program) both versions see would be identical, so the port should be pretty straight-forward. (Well, except for the .8xp header, but that's not a big issue; the encoding of the content itself is the same, which makes life far easier.) I'm thinking about developing on-calc, then when you've completed your program (when you have to transfer it to a computer anyway if you intend to share it with more people then just a couple of friends), you pull it through a compiler which really tries hard to optimize things as far as possible, potentially using techniques which are just not suitable for the on-calc compiler.
Like I said, it's a minor nit-pick; it's more of a linguistics thing than a technical one. I'm a computer science student myself, the standard example I know is "you have five fingers, with indices 0, 1, 2, 3 and 4. The first has index zero, the second has index one, ..., the fifth (and last) has index four." Essentially, ordinal numbers start at "first" (both in computer science and in general) while cardinal numbers start at zero (at least in computer science). With "ordinal numbers" and "cardinal numbers" I mean the linguistic terms.Pointers (page 9)Actually, in computer science, you really DO start counting at zero so you can have a 0th element as part of a list.
Actually, there's no such thing as "the zeroth item"; the correct way to say this would be "the first byte has address zero, the second byte has address one". Not exactly intuitive, I know. If you don't want to change this I can understand.