whaddsoft
|
|
Reply #30 Posted on: July 31, 2009, 05:16:47 pm |
|
|
Joined: Jul 2008
Posts: 12
|
In other other news, I'll be continuing development on Linux. Most of you know ENIGMA works on Linux now. Since the OS is more picky with things--for instance, file name capitalization--I think it'd be a good idea to move to it. And file names aren't the extent of it; big GCC, as in, the GCC which is not minimalist or for Windows and likely has the majority of GNU devs on its case, offers more precise error checking and warns on more things. Which is nice, as it prevents errors down the road.
Anyway, I'ma get back to working on the compiler. I have to find my new instance system and put it in the shell folder. After it's at a good stop point, I'm wiping the SVN and reuploading everything. (Makes it easier switching back and forth between platforms).
No news on ENIGMA's LibOGC frontend.
Cheers. A2h will hopefully make me edit this tomorrow. Maybe even post new.
How about make it cross platform compatible? Just write once, compile many times?
|
|
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #32 Posted on: August 01, 2009, 09:25:45 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
whaddsoft-- If you mean that I should use something cross platform, there's nothing *that* cross platform for me to use. I'm writing it in as low a level interfaces as I can manage. From what I'm seeing, it should work on everything with a monitor.
...Okay, not really. But from what I can tell, pretty much everything in the realm of computers that doesn't support Win32Api supports XLib. And everything else... Well, I'll get to it.
Anyway, as for progress:
int a = 0; if a = 1 b=2c=3 else d=4 e=5 f='test removal of strings'g=\"poop\" \ endorphin = /*removal of comments*/ 6; motherlicker = 7; //or eight\r\n end\ break; label: goto label; awful_code() return 0 /*
Becomes these so far:
ddd n = 0; ss(n = 0);n=0;n=0;bbbb;n=0;n=0;n=";n=";nnnnnnnnn = 0; nnnnnnnnnnnn = 0; nnn;bbbbb; nnnnn: pppp nnnnn; nnnnnnnnnn();pppppp 0; int a = 0; if(a = 1);b=2;c=3;else;d=4;e=5;f=";g=";endorphin = 6; motherlicker = 7; end;break; label: goto label; awful_code();return 0; Although I was originally considering total removal of spaces, it's proven to work efficiently without doing so thus far. I think I may yet do so for later efficiency/ease, however.
As for explanation of methodology here...
This is a more insightful revamping of my original parser; the one written in GML. However, this one is more capable of handling all the C++ tokens, too. The old one was modified to do so; this one is being designed for it.
I'm still using the original flow of things, though, so I think I can get away with saying it was still originally GML. The idea was good enough that it operated fine for its time... now it just needs some polishing up.
Anyway, how it works is relatively easy when you break it down. The code is first stripped of all comments, strings, and whitespace for workability. Comments/Other whitespace become a single space. Strings of any type are replaced with the quote character ("). Variable names become "n". They are then broken down into specific treatments based on if they represent a statement...
Statements requiring () are replaced with "s". These include if(), with(), switch()... Statements requiring a parameter without needing or plain without () become "p". Take return x; and goto lbl; for example. Statements requiring an immediate semicolon are parsed as "b". This is raising some questions as to what to do with "do" and "else".
Those two exceptions ("do" and "else") cannot be treated the same.
do do a=b() until c=d until e=f if a if b c() else else d() The first code is valid if "do do" is left alone. The second is only valid if it becomes "else; else". The semicolon there means "do nothing". I'm considering just adding a token for each of them. (Probably "c" for do and "e" for else).
These will mean a couple extra rules added in two simple functions.
The code will seem so simple when it's all laid out. But for now, it's scraping brain matter.
|
|
« Last Edit: August 01, 2009, 09:27:43 pm by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #35 Posted on: August 04, 2009, 11:51:18 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
And the Commodore 64, sure. I just have to write up a couple window functions for t-- oh, that's right.
But seriously, all the major OSes either are Microsoft, or they support XLib. So that's BASICALLY everything with a monitor. And since GL guarantees two colors, and XLib doesn't guarantee shit, we're good.
Progress:
(ddd)a is ccccca instead, so )a isn't misread and replaced with );a Still working toward finishing parsers. Tomorrow I must experiment with syntax checker, making sure it's finished and incorporating inline structures/classes. (And inline asm if syntax check doesn't have that in yet).
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #40 Posted on: August 07, 2009, 07:24:21 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
* Josh wonders where the discussion went, but likes combos
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #42 Posted on: August 07, 2009, 08:20:58 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
* Josh laughs for a number of reasons
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #44 Posted on: August 07, 2009, 09:21:13 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
* Josh hates bittersweet compromises
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|