Re: Anouncing: Mike's Turbo Euphoria!

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Heh, figures. Why do you do this? Do you really
> think we believe all this
> crap about your fancy IDE's and now this "Turbo
> Euphoria" thing? You must
> have some imagination, because you'll need a lot
> more to figure out how
> to actually WRITE these things...
>
>  - Matt

Heh?
WTF are you talking about man?
I was just rewriting the main translation loop.
Here is the source I was working on:
-- TURBORIA.E
-- The Euphoria In-Line Compiler


-- By Mike The Spike

without warning

-- Standard Include Files
include file.e
include get.e

-- ASM Include Files
include asm.e


sequence name, addr
name = {}
addr = {}

function parse_string(sequence str)
-- Parse Euphoria Code String Into Tokens ...
object ret, word
ret = {}
word = ""
for i = 1 to length(str) do
        if str[i] = ',' or str[i] = ' ' or str[i] = '\t' or
str[i] = '(' or str[i] = ')'
           or str[i] = '+' or str[i] = '-' or str[i] = '*' or
str[i] = '/' then
                ret = append(ret,word)
                ret = append(ret,str[i])
                word = ""
        else
                word = word & str[i]
        end if
end for
ret = append(ret,word)
return ret
end function


global function new_func(sequence code)
-- Compile Euphoria Code Into Machine Code
object address, toks, asm
toks = parse_string(code)
asm = ""

-- Translate to ASM
for i = 1 to length(toks) do
        if sequence(toks[i]) then
                if equal(toks[i],"integer") then
                        for ix = i to length(toks) do
                                if atom(toks[ix]) then
                                        if toks[ix] = '\n' then
                                                exit
                                        end if
                                end if

end for

end function

global procedure add_routine(sequence name)
end procedure


if sequence(new_func("procedure math(integer a,integer
b)\n integer cp \n return a+b")) then end if


Hehe, you can always try to beat me into writing this
lib. Try to finish it before I do. This sounds like
the kind of work Pete Eberlein would be great at.
There's always the possibility I back out, like I
ussualy do.


Mike The Spike

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu