Galaxy precompiler

Started by Steenreem, March 23, 2010, 01:17:36 PM

Previous topic - Next topic

Steenreem

Hello everyone,

I'm Remy I recentely started working on a precompiler for starcraft 2 called Milkyway precompiler (MWC). The idea of a precompiler is that it extend the galaxy langauge and add support for things like syntax checking, type checking, and lexical scoping.

Currently MWC has mainly 2 features:

- Syntax checking. Gives line and column number and sometimes some extra information.

- Enables the use of new and delete. Using code generation, a limited form of dynamic allocation is simulated.

- Block comments are allowed. /* .. */

The tool can be found here: http://www.sc2mapster.com/assets/milkyway-precompiler/

I just started last weekend. MWC is still is in very early developmental phase, so count on bugs. I have tested the syntax checking on some large galaxy files and that works fine. I have already tested the generator code for dynamic allocation in sc2 and it compiles.  It would be of great help if someone could help test a bit.

Future:

For the future I'm planning these features:

       
  • Type checking. Add type checking so that for example "if 3 then   .. " will give an appropriate error message. 
  • Lexical scoping. Are the variables you use actually in scope at   the point where you use them? Are they declared? 
  • For loops. Allow the use of for loops. 
  • OOP concepts. Class methods that have access to the class they   are defined in. 
  • Function pointers. 
  • Garbage collection in dynamic allocation. 
  • References (like in c++)

Kernel64

This is nice. I've been looking for something that's not as complicated and would just allow me to check lines of codes for syntax errors.

A nice feature would be to have something that checks variable names for specific problems like lower/upper case stuff.

Steenreem

Quote from: Kernel64 on March 23, 2010, 05:27:12 PM
This is nice. I've been looking for something that's not as complicated and would just allow me to check lines of codes for syntax errors.

A nice feature would be to have something that checks variable names for specific problems like lower/upper case stuff.

I'd call that feature lexical scoping. I'm working on type checking and lexical scoping now. So hopefully when that's finished it will report any variables names with spelling errors as actual errors.