Click here to Skip to main content
15,886,799 members
Articles / Programming Languages / Java

Create Your Own Programming Language

Rate me:
Please Sign up or sign in to vote.
4.87/5 (53 votes)
21 Jan 2010CPOL12 min read 486.5K   15.4K   87  
I've created my own programming language called Alef++ for fun, and for better understanding: What is a programing language? How does it work? Can I can create my own?
/**
 * The Code Project Open License (CPOL) 1.02
 * 		see : http://www.codeproject.com/info/cpol10.aspx
 * 
 * Author	: Adrabi Abderrahim
 * Mail		: adrabi[at]gmail[dot]com
 * Year		: 2009
 * Discrip	: this code a part of "Create Your Own Programming Language, just game ?" 
 * 			  and code using is from Alef++ project
 * 			  https://sourceforge.net/projects/alefpp/
 */

package main;

import java.io.File;

import st4tic.St4tic;
import st4tic.interpreter.Interpreter;

/**
 * Class main for running St4tic language 
 * 
 * @author Adrabi Abderrahim
 *
 */
public class Main {
	public static void main(String [] $)
	{
	    try
	    {
	      if ($.length == 0) 
	      throw new Exception("Error, file dons't exists !");
	      else if (!new File( $[0] ).exists()) 
	      throw new Exception("Error, reading file : " + $ [0] + " !");
	      St4tic parser = new St4tic(new java.io.FileInputStream($ [0]));    
	      new Interpreter().visit( parser.Start() );
	    }
	    catch (Throwable e)
	    {
	    	System.out.println( "hmmm... sorry you have this error! :\n" + e );
	    }
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
Morocco Morocco
Adrabi!, Just another Ghost in the Shell =)

Comments and Discussions