Replies: 13 comments 5 replies
-
@x87 About opcode abbreviations:
These are some commonly used abbreviations for opcodes. But some need to be added, and CLEO4 also added some:
The above are just some examples In addition, some OPs should also have a syntax supported by compilers similar to "xxxx()":
The above OP is still only a part, and this type of OP is not suitable to be created as a class syntax. We need more flexible abbreviations. |
Beta Was this translation helpful? Give feedback.
-
@XMDS You've made some very good points here. I agree, the mixture of opcodes/keywords/classes is kinda messy and confusing, but this is also something that makes this language very unique and flexible. I agree with the point that some operations are hard to classify (as in literally turn into a class) and very few keywords should exist. I started outlining Sanny Classes Library recently where I try to make consistent names to all known opcodes: In this classification only some opcodes can be expressed with keywords. Only those that are part of the scripting system (jump, wait, return, etc). The rest is being converted into a Class.Member form. I absolutely agree that mathematical operations should be free to use without opcodes and this is where we move towards. A new expression parser is under development and I plan to introduce it with bitwise operations (#97) first and then expand on other opcodes you mentioned. |
Beta Was this translation helpful? Give feedback.
-
@x87 Hm, if SB contains suffix/prefix for strings, maybe need add suffix/prefix to others base datatype (int, float)?
The opportunity is situational, but it can be useful. |
Beta Was this translation helpful? Give feedback.
-
@wmysterio I see your point here. It could be useful in some cases if one prefers low-level syntax with granular control over data types. Ideally I would like people to use shorter variable declaration #32 but I do agree that having suffixes/prefixes for string variables only makes the grammar inconsistent. In other words, we do have s$var and v$var but why can't we have i$var and f$var (same for locals). I will look into adding support for i/f types. It will be low priority though. |
Beta Was this translation helpful? Give feedback.
-
@x87 I know this is of low priority, which is why I wrote "situational". Suffixes/prefixes are useful in places like the
I write now:
But I preferred to get rid of the first line :) |
Beta Was this translation helpful? Give feedback.
-
Oh, in this case it would be much better to support:
|
Beta Was this translation helpful? Give feedback.
-
Looks better than the current version. This syntax is definitely worth adding. I didn't find an obvious use of prefixes/suffixes for integers and float numbers, so I wrote the first thing that came to mind)) |
Beta Was this translation helpful? Give feedback.
-
In fact, I think this kind of abbreviation is not good, because there are so many symbols. In addition, I have a question:
@x87 Why both variables need to be declared? I think it seems to be enough to declare the previous variable
|
Beta Was this translation helpful? Give feedback.
-
In fact, I think such abbreviations are appropriate because the number of characters is will reduced here.
I am in favor of both options. |
Beta Was this translation helpful? Give feedback.
-
Now according to your instructions, I roughly summarize the construction of a grammar Then the grammar at the time of writing:
But the normal mode requires a formal and stable grammar that is conducive to programming, that is, the class grammar. @x87 Are future grammar updates and patterns roughly what I said? In addition, your grammar tables are currently too few, maybe you can share them and update them together (in fact, I don't like markdown to make such a long table. Or it would be better to write on gtawiki). We need a stable version of the SB tool to write cleo in class syntax. Which version do you plan to implement class syntax updates in the future? |
Beta Was this translation helpful? Give feedback.
-
Moved current wiki page into a separate repo This is very raw and subject to change at any moment It's also viewable at https://sannybuilder.github.io/classes |
Beta Was this translation helpful? Give feedback.
-
Update on the classes library 1/18/2021Classification of GTA III commands is complete. See it there https://sannybuilder.github.io/classes/gta3/index.html GTA Vice City command classification is in progress. Everything starting from the command |
Beta Was this translation helpful? Give feedback.
-
Update 3/26/2021The library has been massively updated and got many new features. I have created a new discussion, so please share your ideas and comment here: #136 |
Beta Was this translation helpful? Give feedback.
-
Before that, I found
xxxx()
When WRITE_OPCODES is turned on, this grammar will not be decompiled to OP0050, and it remains the same.In addition, I think the SB tool should default WRITE_OPCODES to be on.Back to the topic, about the grammar when writing. There are usually these types:
This kind of grammar is our most commonly used grammar. When we need a certain function, open the OP search bar to search for ID or a certain word to determine the operation code we need, and then copy and paste.OP grammar causes many writers to memorize certain opcodes by ID or words, and it is the most widely used. But it is not convenient and suitable for programming
2.Class syntax(classes.db)
Because we did not update the classes.db file with this syntax, only a small amount of code can be used.
This kind of syntax is actually very good. I don't have many languages. I think this kind of syntax is like functions in C and JavaScript. But updating the classes.db file is a long-term problem, and this syntax is not suitable for all opcodes. We can use ‘player’, ‘actor’, ‘vehicle’, ‘object’, etc. as class names, but some special opcodes, such as those for setting game parameter environment and other data, are not very good to classify and set a group of class names. And the parameters in the brackets of this syntax (parameters) are not very friendly to beginners, they don't necessarily know how many parameters this opcode has and what the parameter types are.
3.Keyword(gta3sc)
This is the original syntax of this scripting language. I still don't understand that SASCR mode uses this syntax, but what is the meaning of the keyword file in normal mode, I don't think anyone will use this syntax in normal mode. In addition, OP files in SCR mode are actually more confusing. Even though this grammar still requires the writer to be familiar with the parameters of each command, more people will use gta3sc to expand and write cleo with vscode, because the writing environment and mode of vscode are very good. In addition, I don't know if SB's SCR mode will fully support this syntax, such as "if end_if". In short, the current SCR model is very confusing, I prefer vscode.
The above. Now when writing CLEO, the grammar is actually a mixture of OP grammar + class grammar, which is actually very messy. . .
@x87 I remember I discussed keywords with you before. Currently, due to the updated keyword file, the same English words in the OP grammar will also be highlighted due to keyword highlighting. This is actually uncomfortable. In addition, after the const of 3.7.0 is highlighted, it will be more uncomfortable to mix up. I think that in normal mode, classes (classes.db) and keywords should be combined to update a new syntax, and When in use, the keywords are highlighted. Otherwise in normal mode There is no point in updating keywords. Of course this is just my suggestion. In addition to discussing grammar, I also want to add some abbreviated grammars of basic opcodes.
Beta Was this translation helpful? Give feedback.
All reactions