MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon 23 Feb, 2009 3:19 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I've been working on a little expression parser over the weekend. Given an input string in the format
Code:
.db "(-8>>2)+ceil(pi())+2**sqrt(abs((~0>>>(30|1))-(10>?1)))",0
it will produce a floating-point value (10 in this case). The internal number cruncher is BBC BASIC's FPP (so you would need BBC BASIC installed) and so all the features of BBC BASIC's FPP are provided either in the form of a function or an operator. The syntax is vaguely C-like with a few functions (min, max, pow) turned into operators (<?, >?, **) and a few additional operators (\ for integer division, >>> for an unsigned right shift).

I suspect the technique is more useful than the implementation (especially given the dependency on BBC BASIC), so would anyone find it useful if I wrote this up?

Edit: Apparently not. Here's an archive of the source with some documentation.


Top
 Profile  
Reply with quote  
PostPosted: Wed 25 Feb, 2009 11:38 pm 
Offline
Regular Member

Joined: Sun 14 Sep, 2008 10:00 am
Posts: 88
I was dreaming on making something like that. :p

I will see the code to see how is that made.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt