Just to make it even more obfuscated

Posted by s on Dec. 20, 2008, 1:31 a.m.

Instead of converting the function name to hex, the function name is now encoded with a radix of 63

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvwxyz_

Alright, Luda wins. Names are now held in a hash with a counter so that new names get a new ID (This conversion was simply a replacement of the radix conversion with fewer lines of code because I was already memoizing)

With all the name shuffling though I finally got around to commenting the outputted assembly

def fac{:if{: – . *}{++}}

Becomes

F1:;:if.2 { : – fac() * } { ++ }

;{:if.2

;{===

cmp long[esp]

;}===

je ELSE1

BEGIF1:

;{:

push long[esp]

;}:

;{–

dec long[esp]

;}–

mov long[ebp],FCALL8

add ebp,4

jmp F1

FCALL8:;fac()

;{*

stackmul

;}*

jmp ENDIF1

ELSE1:

;{++

inc long[esp]

;}++

ENDIF1:

;}:if.2

sub ebp,4

jmp long[ebp]

I should work on the single line macro explanations being bloated to 3 lines

And . syntax turned out to simplify the syntax. &. and . can be used for recursion, which is kind of useful when you're using an anonymous function

Rather than hardcode CharacterBuffer to be constant in name, I've modified the inline ASM to have a #identifier system to inline desym() usage. Good to expand macro system rather than hardwire things

After reading of regex, I have a want to use it in the parsing. But of course, that'd probably just make things worse. Works with implementing Thue though

If this seems overly dry to you, blame PY for taunting me with cookies. But just in case it isn't, here's a Rue fib ruleset

\.0::=.

0–::=–9

1–::=0

2–::=1

3–::=2

4–::=3

5–::=4

6–::=5

7–::=6

8–::=7

9–::=8

(?<=\D)\+\+0::=10

^\+\+0::=10

0\+\+::=1

1\+\+::=2

2\+\+::=3

3\+\+::=4

4\+\+::=5

5\+\+::=6

6\+\+::=7

7\+\+::=8

8\+\+::=9

9\+\+::=++0

\.1(?P<fib>\D|$)::=,\g<fib>

\.2(?P<fib>\D|$)::=,\g<fib>

\.(?P<fib>\d+)::=.\g<fib>–.\g<fib>—-

,$::=++

,\+\+::=++++

^\+\+::=1

I'm thinking of adding imports and classes. I've added the ability to add rules for rules infinitely, and I'm thinking of doing classes in that ugly Java way with the file per class. Then you'd do :class{texttoparse} for class.txt to parse the brackets

And there

Comments

[deleted user] 16 years ago

Yes

Cpsgames 16 years ago

Indeed.

s 16 years ago

Most certainly not