XP Language experiment
This is the XP language - a compiled programming language built on top
of the XP Framework and written using it; inspired and still close to PHP
but also with elements from the Java and C# worlds. At the same time, this
experiment also proves how PHP can be used as a platform, with different
possible input syntaxes generating intermediate code to run inside it, and
be able to re-use code written in other syntaxes but also plain old PHP,
but sharing the XP Framework's foundation classes as a common SDK. OverviewHere's a list of the subdirectories inside this one and what you will find inside: - tests : Unittests - cmd : Utility xpclis - demo : Examples - grammar : Grammars - xp : Implementation
MotivationDesigning the XP programming language we had the following goals in mind:
Prerequisites
This experiment requires XP Framework version 5.8.0-dev plus the classes
from this directory. Replace the "use" line in your xp.ini with
the following: use=~/devel/xp/branches/xp5_8;~/devel/xp.forge/trunk/experiments/arena/lang
Getting started
Like in the XP framework, the entry point is always a class. In their most
simple form, these classes have a static main() method. An example: public class HelloWorld { Now you will already start noticing things:
Try it!Compile: $ xcc demo/HelloWorld.xp Run: $ xp HelloWorld
HackingWhen changing the grammar file you need to regenerate the parser: $ make grammar Elements
| Table of contentsArenaPeople |