Universe

usage

News

  • Added Function Pointers & Multi pass.
  • Added typechecker

Universe

Universe is a language extension for galaxy. The extended language is implemented using the universe compiler which is downloadable from this page. The compiler converts a program written in universe to galaxy so that it can be read by sc2. Besides enabling language extensions, the compiler also performs program analysis. Detailed parsing and type errors are given. There is a lot of room for features. The ones currently implemented and those planned are shown in the features section. Usage is through the command line.

Features

  • Function pointers. Functions are considered first order object in universe. As such they can be returned, given as parameters and be contained in a variable.
  • Multi-pass. Universe is compiled multi-pass. Functions may refer to functions defined earlier in the code. Function prototypes need never to be defined.
  • Type Checking. Various type errors are reported. This includes calling non-existing functions; defining duplicate functions; calling a function with bad arguments; returning with in incorrecy type; not specifying a constant initializer.
  • Syntax Checking. The tool parses a file and reports any parsing errors. Errors show a line and column number. Some information about the error is given but I have tuned this very little.
  • Block comments are allowed.
  • Dynamic allocation. It is possible to use new() and destroy(). Check the dynamic allocation page for more info.

Future Features

  • Polymorphism. (Actually dependant types)
  • OOP concepts. Class methods that have access to the class they are defined in.
  • Improved dynamic allocation. Dynamic arrays.
  • Garbage collection in dynamic allocation.
  • Optimizer

Bugs

Generated code is compiled by sc2 so far. However very little testing has been done. I need at least 1 user to test for me =D

You must login to post a comment. Don't have an account? Register to get one!

  • 6 comments
  • Avatar of XPilot XPilot Thu, 15 Jul 2010 02:53:52

    I think Andromeda (http://www.sc2mod.com/board/index.php?page=Thread&threadID=13) made by geX is a viable alternative, and a much more mature product at this point.

  • Avatar of MotiveMe MotiveMe Tue, 11 May 2010 00:56:23

    Awesome! :D

  • Avatar of steen-reem steen-reem Wed, 24 Mar 2010 18:22:42

    Okay you're right. Thanks! *fixed*

    Last edited on 27 Mar 2010 by steen-reem
  • Avatar of Astazha Astazha Wed, 24 Mar 2010 12:46:06

    What I'm saying is a statement like:

    myInt=-1;

    results in the precompiler thinking that =- is supposed to be an operator.

  • Avatar of steen-reem steen-reem Wed, 24 Mar 2010 08:50:06

    @Mishlai. Looking at the c operators on OperatorsInC I don't see "=-" on there. I think you're want to use "-=", which does parse.

    Last edited on 24 Mar 2010 by steen-reem
  • Avatar of Astazha Astazha Tue, 23 Mar 2010 20:56:13

    Assigning a negative value results in unexpected op =-

  • 6 comments

Facts

Date created
21 Mar 2010
Category
Last update
10 May 2010
Development stage
Planning
Language
  • enUS
License
All Rights Reserved
Recent file

Authors