1. I needed practice with PHP.
  2. I needed practice with regex.


So I got an idea: Since I'd already made some Z80 ASM scheme files, why not make my own online scheme parser? So here's BBify, an online tool that wraps code in BBCode tags for syntax highlighting.

It's ugly but it works. I'll definitely be making it look better soon, and better yet, I'm planning to add customized colors. Right now I'm taking colors off the Tango scheme, but the way I have it set up I can just add some form elements and you'll be able to change the colors to whatever you want Very Happy

Currently it only supports strings, numbers (all bases), comments, and directives, but all I have to do to add a new replacement is take the regex for it and stick it in an array. The engine is pretty much done (but buggy).

EDIT: Cemetech already has a mod that does this, doesn't it? Shock
Ooh! This sounds really useful because, as of now, google-code-prettify parses z80 code as C/C++ code. I would love to see if Kerm could wrap this in a BBC tag (for instance, [ z80 ]) and it makes it use your BBC code parser.
Funnily enough, in order to make your computer do some of the work and let the server do less work, our Prettify mod is Javascript. You're welcome to teach it z80 if you'd like!
Mine's PHP (because I'm planning to allow uploads), darn. I can convert it if you want though.

Anyway, update-bump: added instructions, operators, registers, and all that fun stuff.

Z80 assembly wrote:
.nolist
.nolist
#include "ti83plus.inc"
#define ProgStart $9D95
.list
.org ProgStart - 2
.db $BB, $6D
b_call(_ClrLCDFull)
LD HL, 0
LD (PenCol), HL
LD HL, Message
b_call(_PutS)
b_call(_NewLine)
RET
Message:
.db "Hello world!", 0
.end
END
Nice colors; I quite like them. What's your poison, regex? Or some other string processing method?
That it is. And as for the colors, I didn't really pick them lol. Straight from the Tango color scheme, making things easier for me.

But now that I finally made a UI for it, you can set your own colors!
Ah, and you even said that in the OP. Smile I'll be interested to see how well this plays with Prettify; I hope we can work something out. Before that, I'm interested in throwing some of my own ASM source at this and seeing how it handles my personal syntax quirks, not that I think I write terribly nonstandard code.
Well, I updated again.
  1. If you have Javascript enabled, anything you type in the text box now goes through AJAX instead of the usual form. Still works without JS (for once).
  2. You can also choose to upload a file instead. Anything in the file gets echoed into the text box, so you can keep tweaking it directly on the page.
EDIT: And I somehow managed to break colors... Hold on.
EDIT2: Fixed.
EDIT3: And now I got banned from my own website x.x
EDIT4: Special features at http://clrhome.tk/resources/biebify/ Wink
Your server is under maintenance, so I'm afraid I can't test this out yet. Sad I'm sure it's quite cool, though!
Yeah, that was annoying. It's back up now.
New features that don't matter at all:
  • The BBify'r is now W3C-compliant XHTML.
New features that matter if you use the worst browser in existence:
  • The BBify'r is now IFE compliant. All the way down to IE7 (can't test below that ATM).
New features that actually do make a difference:
  • The BBify'r now accepts code from the Pastebin!
EDIT: Oh yeah, and new URL: http://clrhome.org/resources/bbify/
EDIT2: Another major update: Custom rules! I don't have time to post the specs, but just take a look at this as an example and know that <#> are my backreferences. I also took out the nice AJAX stuff because that was getting in the way.
EDIT3: Another update:
Seems like I haven't updated this thread in a while. The BBify'r now accepts Z80 Assembly, Axe, and Lua, in pasted, uploaded, or linked form. That includes detokenizing .8xp Axe source programs!
Deep Thought wrote:
Seems like I haven't updated this thread in a while. The BBify'r now accepts Z80 Assembly, Axe, and Lua, in pasted, uploaded, or linked form. That includes detokenizing .8xp Axe source programs!
Sounds like you're trying to replicate yourself a little SourceCoder there. Wink Maybe I need to step up my game and let SourceCoder understand what Axe programs are.
It doesn't and never will do conversion to 8xp Smile
Deep Thought wrote:
It doesn't and never will do conversion to 8xp Smile
Fair enough. If you'd like to help the SourceCoder syntax highlighter be better, though, I would very much more than welcome the help. I'm not sure if I mentioned that earlier.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement