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
- 6 comments
- 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
- A: UniverseCompiler0.0.5 on 10 May 2010
- #6
XPilot Thu, 15 Jul 2010 02:53:52I 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.
- #5
MotiveMe Tue, 11 May 2010 00:56:23Awesome! :D
- #4
steen-reem Wed, 24 Mar 2010 18:22:42Okay you're right. Thanks! *fixed*
- #3
Astazha Wed, 24 Mar 2010 12:46:06What I'm saying is a statement like:
myInt=-1;
results in the precompiler thinking that =- is supposed to be an operator.
- #2
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.
- #1
Astazha Tue, 23 Mar 2010 20:56:13Assigning a negative value results in unexpected op =-