DP parser

This project is now dead.

Guestbook/Forum/Mailing list for discussion - Public access, so no need to register unless you want the messages emailled to you.
Mailing list for DP announcements - Read only, but public access.


News

3/7/2001 B: OK, I've uploaded what I have: two perl snippets, and a dba file (removed 19/7/2001, since it was for quats):

Still no full release of DP. Now there's no more need for quats, I'm feeling much happier. I'm no longer predicting a release date, because I've got embroiled in playing Anachronox. Once that's done, I'll come back to this...


The following is my wishlist of features for DP. Items in bold might make it into the first release. Items in Bolditalics almost definitely will. Items in gray italics are no longer to be implemented.

  1. In-code configuration - because I can't think of another way of setting the options easily. You'll configure it by putting "DP ..." lines in your code. Maybe a config file for default options later, but this comes first.
  2. Call DB - in any of its five modes (compile, make exe, make final, execute, and edit), or any parameters you want, or not at all.
  3. "Magic" indenting - checks your code by indenting/outdenting the loops. Optionally also indents backwards from "return" to the preceding label, if any. [Code for this part, albeit slow, is above]
  4. Forum formatting - creates a version of your source that will be correctly indented and syntax hilighted on these forums.[Code for this is above]
  5. Fix for DE's DEFINE bug - (defined variables all need spaces around them to work. Since the precompiler can only run after DE's precompiler, I'll make it just completely replace DE's DEFINE functionality. You'll need to turn it off in DE).
  6. Documentation - of course, I'll document it!
  7. Call another external program.
  8. Precalculate FOR loop values.
  9. Precalculate CASE statements.
  10. Wrappers for commands that don't give you an access fn (eg a wrapper for "scale object" would give you "get_object_scale()").
  11. WordCase setting - the option to specify variables and commands to lowercase/Title_Case/title_Case2/UPPERCASE, and defines, arrays, types, etc to the case they were defined as, or as any of the four main capitalisations. DP will modify all occurances to fit these settings. (thanks to Kona3D for this idea)
  12. A .reg file to correctly sort out file associations for darkedit. Low priority, will probably release separately.
  13. Brain Editor compatability. (Thanks to catadventurer for this suggestion). Low priority, though.
  14. Errors(E:) and warnings (W:) - DB's error reporting is not exhaustive, nor is it terribly clear. This is a major stumblingblock for newbies. I'd like to include warnings/errors like:
  15. Fix DB's ": at beginning of line" bug - just remove them in the precompiler. Otherwise DB bombs out. (thanks to JoKeR(BW) for pointing this one out!) [Fixed (poorly, IMHO) in 1.09b2 - I might still stick this in as a warning.]
  16. A fix for DB's '^' bug - multiply both sides by 1.0 if they are int. [Fixed in 1.092b]
  17. A fix for DB's '-' bug 2 - Poss some kindof wrapper that subtracts a string from a string, or maybe just return an error. DB thinks "$str-$str" is valid, then it bombs out (I found this one while I was running tests trying to break it). [Less of an issue since 1.09, it only gives a runtime error now]
  18. A fix for DB's get angle z()=0 bug - replace pitch, roll, yaw and getangle(x/y/z) with replacements that work [Fixed in 1.093b - Thank goodness!].
  19. Matrix math functions - this is a free byproduct of fixing DB's "object angle z" bug. [But I'm not doing that anymore. I might provide these as a separate #INCLUDE-able lib, though, since I can see them being useful for filtering DB's world-matrices, and very handy if mesh deformations are ever implemented.]
  20. A fix for DB's '/' bug - multiply both sides by 1.0 if they are int. Default to off, because I guess sometimes you might want 1/2=0 functionality. [Naah, just have this as a warning.]
  21. A fix for DB's '-' bug - place () around any terms that are subtracted. Default to off, because some people might want 1-1+1=-1 behaviour. Sick weirdos. [Naah, just have this as a warning.]

Tech Notes

DarkEDIT

DarkEDIT doesn't let you define your own keywords (yet!), so I can't fix it's syntax hilighting, but this patch should fix everything else that's up with it (ie if you are getting bombed out of DB and DE just says "compilation successful", change this to call DB in edit mode).

DarkEDIT also doesn't let you define your own hotkeys (yet!) so this will have to replace the F5 compiler option. No loss, since it can do that as well, but it would be nice to have it with different keys doing different things.

Coding

Today I'll be writing mostly in perl. I'll release the perl source, and a compiled executable (using IndigoSTAR's "perl2exe": see www.perl2exe.com) for those who don't have perl installed.

Future plans

I'd like to get the error reporting to be extra-ultra-snazzy. I'm not quite sure how I'll be doing this. Ideally, I'd return a filename of errors to DE, which would display them in a window, and as you moved through the errors, it selected the line in your source. That's not gonna happen soon. At the moment DE can only cope with one error at a time, so I'm wondering whether to write the errors into a file and just send the most urgent to DE, or display them on the screen, or what. I also need ideas for other warnings and errors! Does anyone know the filename/syntax for DB's error reporting to DE?

If Guy or Lee implement any of this stuff directly in DE or DB, then I'll remove it from the next version to make it smaller. I'll try to make my code nicely commented, so if they want they can port my algorithms to whatever language they use.

I need other ideas for what people want to see in a well-behaved precompiler, and any improvements you can think of to the above wishlist (any extra warnings/errors, etc).


Legalese

I'm not sure on the legality of calling it DarkPARSER, so I'll call it DP. I wouldn't want to infringe on their potential namespace for trademarks, anyway.

Public License

The source and compiled executables for the current release of DP is released into the public domain.
You can sell it unchanged, as your own original work (but if you do this, people will laugh at you, and be rude to your mum at parties). Anyone can use it for any purpose, even if they work for Microsoft. I'm not going to bestow copyright and ownership of this on anyone, because I feel that is way too restrictive.

That's not to say I wouldn't appreciate any feedback or credit in your code that you care to give me. But I will not bestow ownership of this tool on anyone.

A public domain license may be classed by Microsoft as "potentially viral", along with the GPL, and so it is possible that this product, under their licensing terms, cannot be included with certain of their products.

Liability

This is currently a buggy early-alpha product, with all that the phrase implies. If you don't know what it implies, you shouldn't be coding anyway. Ignorance is no defence against bugs.