What I have created there is a static array of classes.
I assume you are getting the error that you can only make dynamic instansiations of classes. That means that every time you want an instance of c_Dialog, you have to call new c_Dialog(...). Consequently, if you want a variable of type c_Dialog, it has to be a pointer to it (c_Dialog* var). This is because for normal structs in galaxy, just typing c_Dialog var; actually allocates the instance in memory at runtime, but you can't get a pointer to that instance.
If you want to be able to just write c_Dialog[4] c_Dialog_RaceDialog; you should make c_Dialog a struct rather than a class. Just don't pass them around to functions too much, since that might be a bit expensive.
It's written in sablecc, and based on a java compiler I wrote for a school project, which is why there are a few references to java in the naming.
The tokens are listed in the order of precedence. Helpers are not tokens.
I treat all variable types as identifiers in the parser, so you will not find the galaxy variable types among the tokens.
Also, except for the function string Galaxy_pp_Deobfuscate(string s), all functions added by the compiler are given a unique name (renamed in case of collisions).
It does require a new update, since the native lib is precompiled. If it wasn't precompiled, it would take a couple of seconds to compile it when the app launches - which I found unacceptable.
Allowing for the editor to simply be a syntax checker for galaxy? I don't think I would do that. It seems a tiny bit redundant, since it is already included in the normal editor (even if the error reports are sometimes rather vague) . I also have some school projects that demand my attention.
Hehe.. Yeah.. well, MPQ's arn't that big a problem. To fix the above, I could probably just copy the map to some specific name, and then extract the data.
Anyway. I have been meaning to open source it.. I'm just kindda stalling indefinetly cause I don't like it being a bit messy :(
The autocomplete list now hides after inserting when double clicked.
Fixed an issue where method calls from while conditions to inline methods would be translated incorrectly.
Fixed an issue where assignments to a variable used in a while conditions could be incorrectly optimized.
Fixed an issue where the code foo = new Str(foo); would be translated incorrectly.
The program now checks that you don't use invalid characters in file names.
The program now monitor the source files. If one is deleted on the hard drive, it is removed from the project. (It still doesn't monitor rename, create or move)
I could, but I'm curious - how do you plan to do it? How much of the editor do you plan to integrate (only compiler, or also the editor with syntax highlight and auto completion)? How will you handle new versions of the editor I release?
Also - the code is really written for my eyes only. As a result, there might be an insufficient amount of green lines, and you might find it a bit messy at times.
I have been looking into this and similar stuff in the past, but I have problems making the parser accept a language with that syntax. With my current parser, it has to be able to uniquely determine what you are writing by only looking one or two tokens ahead. The problems with generics in expressions is that they conflict with the less than expression. If you write
boolfoo=bar<baz[...
It wouldn't know if it's a less than or the beginning of a generic function call.
The solution would be for me to change parser, and I might look into that, but that is a rather big thing to do, that will probably take a while.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What I have created there is a static array of classes.
I assume you are getting the error that you can only make dynamic instansiations of classes. That means that every time you want an instance of c_Dialog, you have to call new c_Dialog(...). Consequently, if you want a variable of type c_Dialog, it has to be a pointer to it (c_Dialog* var). This is because for normal structs in galaxy, just typing c_Dialog var; actually allocates the instance in memory at runtime, but you can't get a pointer to that instance.
If you want to be able to just write c_Dialog[4] c_Dialog_RaceDialog; you should make c_Dialog a struct rather than a class. Just don't pass them around to functions too much, since that might be a bit expensive.
You are forgetting to create each element of the array.
There is really no need for a dynamic array if you always use the same constant size.
Edit:
Unless of course you plan to pass the array to other functions.
For a full and precise list of tokens for parsers, I think it would be easiest if I just give you that part of my parser.
http://www.sc2mapster.com/paste/4094/
It's written in sablecc, and based on a java compiler I wrote for a school project, which is why there are a few references to java in the naming.
The tokens are listed in the order of precedence. Helpers are not tokens.
I treat all variable types as identifiers in the parser, so you will not find the galaxy variable types among the tokens.
Also, except for the function
string Galaxy_pp_Deobfuscate(string s)
, all functions added by the compiler are given a unique name (renamed in case of collisions).Yeah, I might do that in a future update. For now at least, it should be up to date.
Right - sorry about that. I'll get on it.
It does require a new update, since the native lib is precompiled. If it wasn't precompiled, it would take a couple of seconds to compile it when the app launches - which I found unacceptable.
Allowing for the editor to simply be a syntax checker for galaxy? I don't think I would do that. It seems a tiny bit redundant, since it is already included in the normal editor (even if the error reports are sometimes rather vague) . I also have some school projects that demand my attention.
Hehe.. Yeah.. well, MPQ's arn't that big a problem. To fix the above, I could probably just copy the map to some specific name, and then extract the data.
Anyway. I have been meaning to open source it.. I'm just kindda stalling indefinetly cause I don't like it being a bit messy :(
Hmm. I think it might be a library I'm using to open mpq files. Could you send me a map with a chineese name, so I can test it?
I'm not sure what you mean "if your project map has a Chineese". Could you try and send me a map file that produces this?
v 2.6.5 is out:
I could, but I'm curious - how do you plan to do it? How much of the editor do you plan to integrate (only compiler, or also the editor with syntax highlight and auto completion)? How will you handle new versions of the editor I release?
Also - the code is really written for my eyes only. As a result, there might be an insufficient amount of green lines, and you might find it a bit messy at times.
Busted.. :( I don't spell check my change log.
I released a new version.. v 2.6.4
The change log will automatically update to the newest version, even if you haven't updated (if it has internet connection).
Just made a small update.. v2.6.3
@Kueken531: Go
I could give you the option to define all the command line args sent to Starcraft II. Why don't you want it shown?
I have been looking into this and similar stuff in the past, but I have problems making the parser accept a language with that syntax. With my current parser, it has to be able to uniquely determine what you are writing by only looking one or two tokens ahead. The problems with generics in expressions is that they conflict with the less than expression. If you write
It wouldn't know if it's a less than or the beginning of a generic function call.
The solution would be for me to change parser, and I might look into that, but that is a rather big thing to do, that will probably take a while.