Pages: 1
  Print  
Author Topic: Neat Stuff  (Read 2649 times)
Offline (Male) Josh @ Dreamland
Posted on: January 06, 2012, 09:48:41 AM

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

View Profile Email
I was working on this new parser yesterday, and I thought it'd be kind of neat to make my AST generator export SVGs. So I did.

So, given this expression: 2 << 1 + 6 / 2 - 2 / 2 << 8 % 5 + 5 / 2

The AST looks like this, step by step:

ast << create_token_dec_literal("2",1);


ast << create_token_operator("<<",2);


ast << create_token_dec_literal("1",1);


ast << create_token_operator("+",1);


ast << create_token_dec_literal("6",1);


ast << create_token_operator("/",1);


ast << create_token_dec_literal("2",1);


ast << create_token_operator("-",1);


ast << create_token_dec_literal("2",1);


ast << create_token_operator("/",1);


ast << create_token_dec_literal("2",1);


ast << create_token_operator("<<",2);


ast << create_token_dec_literal("8",1);


ast << create_token_operator("%",1);


ast << create_token_dec_literal("5",1);


ast << create_token_operator("+",1);


ast << create_token_dec_literal("5",1);


ast << create_token_operator("/",1);


ast << create_token_dec_literal("2",1);



neathuh
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 #1 Posted on: January 06, 2012, 09:50:53 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Very nice!
Logged
Post made January 06, 2012, 10:05:24 AM was deleted at the author's request.
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: January 06, 2012, 02:46:11 PM

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

View Profile Email
Chickens are neat.

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 (Female) IsmAvatar
Reply #4 Posted on: January 06, 2012, 02:53:46 PM

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

View Profile Email



Having trouble seeing a difference here...

Logged
Offline (Male) Josh @ Dreamland
Reply #5 Posted on: January 06, 2012, 02:54:40 PM

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

View Profile Email
The second picture has grass in it.
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 (Female) IsmAvatar
Reply #6 Posted on: January 06, 2012, 02:55:02 PM

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

View Profile Email
Ah. k
Logged
Pages: 1
  Print