Pages: « 1 2 3 4 5 »
  Print  
Author Topic: Subject  (Read 11961 times)
Offline (Unknown gender) whaddsoft
Reply #30 Posted on: July 31, 2009, 05:16:47 PM
Member
Joined: Jul 2008
Posts: 12

View Profile Email
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
Offline (Male) RetroX
Reply #31 Posted on: August 01, 2009, 11:44:07 AM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
That's going to happen, except you need to be responsible and realize certain things when writing your code for non-Windows OSes (filenames, is one example).
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Josh @ Dreamland
Reply #32 Posted on: August 01, 2009, 09:25:45 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
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:

Code: [Select]
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:
Code: [Select]
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;
Code: [Select]
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.
Code: [Select]
do do a=b() until c=d until e=f
Code: [Select]
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
Offline (Male) RetroX
Reply #33 Posted on: August 02, 2009, 05:33:53 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
If I honestly find anyone that codes like that, I will grab them by their throat and toss them out a window.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) notachair
Reply #34 Posted on: August 03, 2009, 02:52:33 AM

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299

View Profile
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.
Amiga?
Logged
Offline (Male) Josh @ Dreamland
Reply #35 Posted on: August 04, 2009, 11:51:18 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
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
Offline (Male) Rusky
Reply #36 Posted on: August 05, 2009, 10:29:10 AM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
*chokes and dies*
Logged
Offline (Male) notachair
Reply #37 Posted on: August 06, 2009, 06:44:38 AM

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299

View Profile
* a2h covers Rusky's eyes
Logged
Offline (Female) IsmAvatar
Reply #38 Posted on: August 06, 2009, 10:37:42 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
* IsmAvatar puts pennies on Rusky's eyes
Logged
Offline (Male) RetroX
Reply #39 Posted on: August 06, 2009, 12:46:54 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
* RetroX realizes he had just misread IsmAvatar's post
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Josh @ Dreamland
Reply #40 Posted on: August 07, 2009, 07:24:21 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
* 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
Offline (Male) Rusky
Reply #41 Posted on: August 07, 2009, 10:18:52 AM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
* Rusky writes a real parser
Logged
Offline (Male) Josh @ Dreamland
Reply #42 Posted on: August 07, 2009, 08:20:58 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
* 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
Offline (Male) Rusky
Reply #43 Posted on: August 07, 2009, 08:26:10 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
* Rusky fights with Josh on MSN
Logged
Offline (Male) Josh @ Dreamland
Reply #44 Posted on: August 07, 2009, 09:21:13 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
* 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
Pages: « 1 2 3 4 5 »
  Print